Package | com.yworks.yfiles.layout.grid |
Class | public class PartitionGrid |
Inheritance | PartitionGrid YObject Object |
Each node can be assigned to a com.yworks.yfiles.layout.grid.PartitionCellId which represents a set of partition cells. The mapping has to be registered to the graph using DataProvider key PARTITION_CELL_DPKEY. Simple partition cell identifiers which represent a single partition cell, i.e., a row-/column-pair, can be created using method createCellId() or createCellId2().
Nodes can also be mapped to a partition cell identifier that represents a multi-cell, i.e., a cell spanning multiple columns and rows. Please note, however, that multi-cells are not allowed to overlap each other. This means that the user has to ensure that each partition cell (row-/column-pair) is associated with at most one partition cell identifier. The multi-cell identifier can be created using methods createCellSpanId3(), createCellSpanId2(), createCellSpanId(), createColumnSpanId(), and createRowSpanId().
Note: if at least one node is mapped to a multi-cell, enabling option optimizeColumnOrder or optimizeRowOrder has no effect.
Note: A group node mapped to a multi-cell identifier represents the corresponding multi-cell, i.e., its boundary corresponds to the smallest rectangle containing all partition cells (rows and columns) specified by the multi-cell. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout. Mapping a group node to a simple partition cell identifier has no effect.
See also
Property | Defined By | ||
---|---|---|---|
columns : YList [read-only]
Returns the columns of the partition grid. | PartitionGrid | ||
optimizeColumnOrder : Boolean
Getter:
Returns whether the order of the columns should be chosen automatically. | PartitionGrid | ||
optimizeRowOrder : Boolean
Getter:
Returns whether the order of the rows should be chosen automatically. | PartitionGrid | ||
rows : YList [read-only]
Returns the rows of the partition grid. | PartitionGrid |
Method | Defined By | ||
---|---|---|---|
PartitionGrid(init:Boolean = true)
Constructs an empty partition grid. | PartitionGrid | ||
Adds a new column to the partition grid. | PartitionGrid | ||
Adds a new row to the partition grid. | PartitionGrid | ||
Creates a partition cell identifier that represents the cell defined by the given column and row. | PartitionGrid | ||
createCellId2(rowIndex:int, columnIndex:int):PartitionCellId
Creates a partition cell identifier that represents the cell defined by the given column and row index. | PartitionGrid | ||
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. | PartitionGrid | ||
createCellSpanId2(fromRowIndex:int, fromColIndex:int, toRowIndex:int, toColIndex:int):PartitionCellId
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. | PartitionGrid | ||
createCellSpanId3(fromRow:RowDescriptor, fromCol:ColumnDescriptor, toRow:RowDescriptor, toCol:ColumnDescriptor):PartitionCellId
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. | PartitionGrid | ||
createColumnSpanId(columnIndex:int):PartitionCellId
Creates a partition cell identifier that represents a cell spanning a whole column. | PartitionGrid | ||
createRowSpanId(rowIndex:int):PartitionCellId
Creates a partition cell identifier that represents a cell spanning a whole row. | PartitionGrid | ||
equals(o:Object):Boolean | YObject | ||
finalizeOrientationChange(orientationLayouter:OrientationLayouter, transformer:OrientationLayouter_Transformer):void
A method that is called at the end of the com.yworks.yfiles.layout.OrientationLayouter stage. | PartitionGrid | ||
getClass():Class [override] | PartitionGrid | ||
getColumn(index:int):ColumnDescriptor
Returns the column with the given index. | PartitionGrid | ||
[static]
Returns the partition grid associated with the given graph. | PartitionGrid | ||
getRow(index:int):RowDescriptor
Returns the row with the given index. | PartitionGrid | ||
hashCode():int | YObject | ||
[static]
Constructs an empty partition grid. | PartitionGrid | ||
newPartitionGrid2(rowCount:int, columnCount:int):PartitionGrid [static]
Constructs a partition grid with rowCount rows and columnCount columns. | PartitionGrid | ||
newPartitionGrid3(rowCount:int, columnCount:int, rowInsets:Number, columnInsets:Number, minRowSize:Number, minColumnSize:Number):PartitionGrid [static]
Constructs a partition grid with rowCount rows and columnCount columns as well as the given insets and min sizes. | PartitionGrid | ||
optimizeColumns(g:Graph):void
Optimizes the order of the columns of the partition grid for the given graph. | PartitionGrid | ||
optimizeRows(g:Graph):void
Optimizes the order of the rows of the partition grid for the given graph. | PartitionGrid | ||
prepareOrientationChange(orientationLayouter:OrientationLayouter, transformer:OrientationLayouter_Transformer):void
A method that is called at the beginning of the com.yworks.yfiles.layout.OrientationLayouter stage. | PartitionGrid |
Method | Defined By | ||
---|---|---|---|
initPartitionGrid1():void
Initializes this object. | PartitionGrid | ||
initPartitionGrid2(rowCount:int, columnCount:int):void
Initializes this object. | PartitionGrid | ||
initPartitionGrid3(rowCount:int, columnCount:int, rowInsets:Number, columnInsets:Number, minRowSize:Number, minColumnSize:Number):void
Initializes this object. | PartitionGrid |
Constant | Defined By | ||
---|---|---|---|
PARTITION_CELL_DPKEY : Object = y.layout.grid.PartitionGrid.PARTITION_CELL_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store com.yworks.yfiles.layout.grid.PartitionCellId instances for nodes of the graph. | PartitionGrid | ||
PARTITION_GRID_DPKEY : Object = y.layout.grid.PartitionGrid.PARTITION_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.grid.PartitionGrid structure. | PartitionGrid |
columns | property |
columns:YList
[read-only] Returns the columns of the partition grid.
public function get columns():YList
optimizeColumnOrder | property |
optimizeColumnOrder:Boolean
Getter:
Returns whether the order of the columns should be chosen automatically.
The default is true
.
Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), enabling this option has no effect.
Setter: Specifies whether the order of the columns should be chosen automatically to minimize edge lengths. For all columns where com.yworks.yfiles.layout.grid.ColumnDescriptor.indexFixed is set to true
, the relative ordering given by the indices is preserved. The remaining columns may be resorted so that the overall edge lengths are minimized.
Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), enabling this option has no effect.
public function get optimizeColumnOrder():Boolean
public function set optimizeColumnOrder(value:Boolean):void
See also
optimizeRowOrder | property |
optimizeRowOrder:Boolean
Getter:
Returns whether the order of the rows should be chosen automatically.
The default is true
.
Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), enabling this option has no effect.
Setter: Specifies whether the order of the rows should be chosen automatically to minimize edge lengths. For all rows where com.yworks.yfiles.layout.grid.RowDescriptor.indexFixed is set to true
, the relative ordering given by the indices is preserved. The remaining rows may be resorted so that the overall edge lengths are minimized.
Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), enabling this option has no effect.
public function get optimizeRowOrder():Boolean
public function set optimizeRowOrder(value:Boolean):void
See also
rows | property |
rows:YList
[read-only] Returns the rows of the partition grid.
public function get rows():YList
PartitionGrid | () | Constructor |
public function PartitionGrid(init:Boolean = true)
Constructs an empty partition grid.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
addColumn | () | method |
public function addColumn():ColumnDescriptor
Adds a new column to the partition grid. The index of the column (as returned by com.yworks.yfiles.layout.grid.ColumnDescriptor.index) is set to the size of the list returned by columns.
ReturnsColumnDescriptor — the new column.
|
See also
addRow | () | method |
public function addRow():RowDescriptor
Adds a new row to the partition grid. The index of the row (as returned by com.yworks.yfiles.layout.grid.RowDescriptor.index) is set to the size of the list returned by rows.
ReturnsRowDescriptor — the new row.
|
See also
createCellId | () | method |
public function createCellId(rd:RowDescriptor, cd:ColumnDescriptor):PartitionCellId
Creates a partition cell identifier that represents the cell defined by the given column and row.
Parameters
rd:RowDescriptor — the row defining the cell
| |
cd:ColumnDescriptor — the column defining the cell
|
PartitionCellId — the partition cell identifier
|
IllegalArgumentException — if the given column/row is null .
|
createCellId2 | () | method |
public function createCellId2(rowIndex:int, columnIndex:int):PartitionCellId
Creates a partition cell identifier that represents the cell defined by the given column and row index.
Parameters
rowIndex:int — the row index of the row defining the cell
| |
columnIndex:int — the column index of the column defining the cell
|
PartitionCellId — the partition cell identifier
|
IllegalArgumentException — if the given column/row index is not valid.
|
createCellSpanId | () | method |
public function createCellSpanId(rowList:Collection, columnList:Collection):PartitionCellId
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows.
The partition cell identifier represents all cells spanned by the columns of columnList and rows of rowList.
A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout.
Parameters
rowList:Collection — the rows defining the cell
| |
columnList:Collection — the columns defining the cell
|
PartitionCellId — the partition cell identifier
|
createCellSpanId2 | () | method |
public function createCellSpanId2(fromRowIndex:int, fromColIndex:int, toRowIndex:int, toColIndex:int):PartitionCellId
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows.
The partition cell identifier represents all cells defined by a row with index between fromRow and toRow (both including) and a column with index between fromCol and toCol (both including).
A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout.
Parameters
fromRowIndex:int — the row index of the topmost row defining the cell
| |
fromColIndex:int — the column index of the leftmost column defining the cell
| |
toRowIndex:int — the row index of the bottommost row defining the cell
| |
toColIndex:int — the column index of the rightmost column defining the cell
|
PartitionCellId — the partition cell identifier
|
createCellSpanId3 | () | method |
public function createCellSpanId3(fromRow:RowDescriptor, fromCol:ColumnDescriptor, toRow:RowDescriptor, toCol:ColumnDescriptor):PartitionCellId
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows.
The partition cell identifier represents all cells defined by a row between fromRow and toRow (both including) and a column between fromCol and toCol (both including).
A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout.
Parameters
fromRow:RowDescriptor — the topmost row defining the cell
| |
fromCol:ColumnDescriptor — the leftmost column defining the cell
| |
toRow:RowDescriptor — the bottommost row defining the cell
| |
toCol:ColumnDescriptor — the rightmost column defining the cell
|
PartitionCellId — the partition cell identifier
|
createColumnSpanId | () | method |
public function createColumnSpanId(columnIndex:int):PartitionCellId
Creates a partition cell identifier that represents a cell spanning a whole column.
A group node mapped to such a partition cell identifier represents the column, i.e., its enclosing boundary corresponds to that of the column. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout.
Parameters
columnIndex:int — the column index of the column defining the cell
|
PartitionCellId — the partition cell identifier
|
createRowSpanId | () | method |
public function createRowSpanId(rowIndex:int):PartitionCellId
Creates a partition cell identifier that represents a cell spanning a whole row.
A group node mapped to such a partition cell identifier represents the row, i.e., its enclosing boundary corresponds to that of the row. The boundary does not depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered during the layout.
Parameters
rowIndex:int — the row index of the row defining the cell
|
PartitionCellId — the partition cell identifier
|
finalizeOrientationChange | () | method |
public function finalizeOrientationChange(orientationLayouter:OrientationLayouter, transformer:OrientationLayouter_Transformer):void
A method that is called at the end of the com.yworks.yfiles.layout.OrientationLayouter stage.
Parameters
orientationLayouter:OrientationLayouter — the instance of the orientation layouter
| |
transformer:OrientationLayouter_Transformer — provides a method for transferring a point to its final position
|
See also
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getColumn | () | method |
public function getColumn(index:int):ColumnDescriptor
Returns the column with the given index.
Parameters
index:int — the index of the column to be returned
|
ColumnDescriptor — the column with the given index or null if there is no such column
|
getPartitionGrid | () | method |
public static function getPartitionGrid(graph:Graph):PartitionGrid
Returns the partition grid associated with the given graph.
Parameters
graph:Graph — the graph
|
PartitionGrid — the partition grid of the graph or null if the graph has no associated partition grid
|
getRow | () | method |
public function getRow(index:int):RowDescriptor
Returns the row with the given index.
Parameters
index:int — the index of the row to be returned
|
RowDescriptor — the row with the given index or null if there is no such row
|
initPartitionGrid1 | () | method |
protected final function initPartitionGrid1():void
Initializes this object. See the documentation of the corresponding factory method newPartitionGrid1()
for details.
See also
initPartitionGrid2 | () | method |
protected final function initPartitionGrid2(rowCount:int, columnCount:int):void
Initializes this object. See the documentation of the corresponding factory method newPartitionGrid2()
for details.
Parameters
rowCount:int | |
columnCount:int |
See also
initPartitionGrid3 | () | method |
protected final function initPartitionGrid3(rowCount:int, columnCount:int, rowInsets:Number, columnInsets:Number, minRowSize:Number, minColumnSize:Number):void
Initializes this object. See the documentation of the corresponding factory method newPartitionGrid3()
for details.
Parameters
rowCount:int | |
columnCount:int | |
rowInsets:Number | |
columnInsets:Number | |
minRowSize:Number | |
minColumnSize:Number |
See also
newPartitionGrid1 | () | method |
public static function newPartitionGrid1():PartitionGrid
Constructs an empty partition grid.
ReturnsPartitionGrid |
newPartitionGrid2 | () | method |
public static function newPartitionGrid2(rowCount:int, columnCount:int):PartitionGrid
Constructs a partition grid with rowCount rows and columnCount columns.
Parameters
rowCount:int — the number of rows
| |
columnCount:int — the number of columns
|
PartitionGrid |
newPartitionGrid3 | () | method |
public static function newPartitionGrid3(rowCount:int, columnCount:int, rowInsets:Number, columnInsets:Number, minRowSize:Number, minColumnSize:Number):PartitionGrid
Constructs a partition grid with rowCount rows and columnCount columns as well as the given insets and min sizes.
Parameters
rowCount:int — the number of rows
| |
columnCount:int — the number of columns
| |
rowInsets:Number — the top and bottom insets of the rows
| |
columnInsets:Number — the left and right insets of the columns
| |
minRowSize:Number — the minimum row height
| |
minColumnSize:Number — the minimum column width
|
PartitionGrid |
optimizeColumns | () | method |
public function optimizeColumns(g:Graph):void
Optimizes the order of the columns of the partition grid for the given graph. Note that this method is for internal use only!
If you want to use the column order optimization, please use option optimizeColumnOrder.Parameters
g:Graph — the given graph.
|
See also
optimizeRows | () | method |
public function optimizeRows(g:Graph):void
Optimizes the order of the rows of the partition grid for the given graph. Note that this method is for internal use only!
If you want to use the column order optimization, please use option optimizeRowOrder.Parameters
g:Graph — the given graph.
|
See also
prepareOrientationChange | () | method |
public function prepareOrientationChange(orientationLayouter:OrientationLayouter, transformer:OrientationLayouter_Transformer):void
A method that is called at the beginning of the com.yworks.yfiles.layout.OrientationLayouter stage.
Parameters
orientationLayouter:OrientationLayouter — the instance of the orientation layouter
| |
transformer:OrientationLayouter_Transformer — provides a method for transferring an original point to its temporary position
|
See also
PARTITION_CELL_DPKEY | Constant |
public static const PARTITION_CELL_DPKEY:Object = y.layout.grid.PartitionGrid.PARTITION_CELL_DPKEY
com.yworks.yfiles.base.DataProvider key used to store com.yworks.yfiles.layout.grid.PartitionCellId instances for nodes of the graph. Each node is placed inside the columns/rows defined by the corresponding partition cell identifier. Instances can be shared among multiple nodes, but don't have to be shared. Note, that multi-cell identifiers (i.e., a identifier that represents multiple columns/rows) are not allowed to overlap each other.
See also
PARTITION_GRID_DPKEY | Constant |
public static const PARTITION_GRID_DPKEY:Object = y.layout.grid.PartitionGrid.PARTITION_DPKEY
com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.grid.PartitionGrid structure. If the provider contains a partition grid structure this structure will be considered during layout (provided that the layout algorithm supports such constraints).
See also