pl.netanel.swt.matrix
Class Grouping

java.lang.Object
  extended by pl.netanel.swt.matrix.Grouping

public class Grouping
extends java.lang.Object

Manages collapse-able hierarchy of item groups. Parent nodes span across its children. There are toggle buttons to collapse/expand groups.


Nested Class Summary
 class Grouping.CellPainter
           
static class Grouping.Node
          Represent a node in the grouping hierarchy.
static class Grouping.NodeVisitor
          Traverses the given node or array of nodes and all the related nodes at the lower levels.
 class Grouping.SeparatorPainter
           
 
Constructor Summary
Grouping(Zone<java.lang.Integer,java.lang.Integer> zone, int axisDirection, Grouping.Node root)
          Creates groups in the given zone that are spanning in the giving direction according to the given node hierarchy.
 
Method Summary
 void dispose()
          Disposes the grouping.
 Matrix<java.lang.Integer,java.lang.Integer> getMatrix()
          Returns the matrix the grouping is created for.
 Grouping.Node getNodeByCellIndex(int indexX, int indexY)
           
 Grouping.Node getNodeByTreeIndex(int... index)
           
 Grouping.Node getRoot()
          Return the root of the grouping hierarchy.
 java.lang.String getText(java.lang.Integer indexX, java.lang.Integer indexY)
          Returns the text of the cell at the given indexes.
 void refresh()
           
 void setToggleImages(Image collapseImage, Image expandImage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grouping

public Grouping(Zone<java.lang.Integer,java.lang.Integer> zone,
                int axisDirection,
                Grouping.Node root)
Creates groups in the given zone that are spanning in the giving direction according to the given node hierarchy.

Sets the count of items in the zone sections automatically.

Parameters:
zone - zone at which grouping should happen
axisDirection - direction of grouping: SWT.HORIZONTAL or SWT.VERTICAL
root - root Node of the grouping hierarchy
Method Detail

dispose

public void dispose()
Disposes the grouping.


getText

public java.lang.String getText(java.lang.Integer indexX,
                                java.lang.Integer indexY)
Returns the text of the cell at the given indexes. If the cell is merged it will return the text of the first cell from the merged group.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
the text of the cell at the given indexes

getRoot

public Grouping.Node getRoot()
Return the root of the grouping hierarchy. This node is not visible.

Returns:

getMatrix

public Matrix<java.lang.Integer,java.lang.Integer> getMatrix()
Returns the matrix the grouping is created for.

Returns:
the matrix the grouping is created for

getNodeByCellIndex

public Grouping.Node getNodeByCellIndex(int indexX,
                                        int indexY)

getNodeByTreeIndex

public Grouping.Node getNodeByTreeIndex(int... index)

setToggleImages

public void setToggleImages(Image collapseImage,
                            Image expandImage)

refresh

public void refresh()


Copyright © 2011 netanel.pl. All Rights Reserved.