|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.incremental.PartitionGrid
public class PartitionGrid
Class for creating a partition grid, i.e., a grid that partitions the drawing area into rectangular partition cells. The grid consists of rows and columns that are created using the corresponding constructors of this class or method #addColumn or #addRow. The PartitionGrid object has to be registered to the graph using DataProvider PARTITION_DPKEY;
Each node element can be assigned to a partition cell which consists of a row and a column.
Therefore the user can create partition cell identifiers using method createCellId(RowDescriptor, ColumnDescriptor) or
createCellId(int, int). These cell identifiers have to be assigned to nodes using DataProvider PARTITION_CELL_DPKEY.
Group nodes can also be mapped to a partition cell identifier that represents a multi-cell, i.e., a cell spanning multiple columns and rows.
These identifiers can be created using methods createCellSpanId(RowDescriptor, ColumnDescriptor, RowDescriptor, ColumnDescriptor),
createCellSpanId(int, int, int, int), createCellSpanId(java.util.Collection, java.util.Collection),
createColumnSpanId(int), and createRowSpanId(int).
A group node mapped to such a identifier represents the corresponding multi-cell, i.e., its boundary corresponds
to the smallest rectangle containing all partition cells specified by the multi-cell.
| Field Summary | |
|---|---|
static Object |
PARTITION_CELL_DPKEY
DataProvider key used to store PartitionCellId
instances for nodes of the graph. |
static Object |
PARTITION_GRID_DPKEY
DataProvider key used to store the PartitionGrid structure. |
| Constructor Summary | |
|---|---|
PartitionGrid()
Constructs an empty partition grid. |
|
PartitionGrid(int rowCount,
int columnCount)
Constructs a partition grid with rowCount rows and columnCount columns. |
|
PartitionGrid(int rowCount,
int columnCount,
double rowInsets,
double columnInsets,
double minRowSize,
double minColumnSize)
Constructs a partition grid with rowCount rows and columnCount columns as well as the given insets and min sizes. |
|
| Method Summary | |
|---|---|
ColumnDescriptor |
addColumn()
Adds a new column to the partition grid. |
RowDescriptor |
addRow()
Adds a new row to the partition grid. |
PartitionCellId |
createCellId(int rowIndex,
int columnIndex)
Creates a partition cell identifier that represents the cell defined by the given column and row. |
PartitionCellId |
createCellId(RowDescriptor rd,
ColumnDescriptor cd)
Creates a partition cell identifier that represents the cell defined by the given column and row. |
PartitionCellId |
createCellSpanId(Collection rowList,
Collection columnList)
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. |
PartitionCellId |
createCellSpanId(int fromRowIndex,
int fromColIndex,
int toRowIndex,
int toColIndex)
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. |
PartitionCellId |
createCellSpanId(RowDescriptor fromRow,
ColumnDescriptor fromCol,
RowDescriptor toRow,
ColumnDescriptor toCol)
Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. |
PartitionCellId |
createColumnSpanId(int columnIndex)
Creates a partition cell identifier that represents a cell spanning a whole column. |
PartitionCellId |
createRowSpanId(int rowIndex)
Creates a partition cell identifier that represents a cell spanning a whole row. |
void |
finalizeOrientationChange(OrientationLayouter orientationLayouter,
OrientationLayouter.Transformer transformer)
A method that is called at the end of the OrientationLayouter stage. |
ColumnDescriptor |
getColumn(int index)
Returns the column with the given index. |
YList |
getColumns()
Returns the columns of the partition grid. |
static PartitionGrid |
getPartitionGrid(Graph graph)
Returns the partition grid associated with the given graph. |
RowDescriptor |
getRow(int index)
Returns the row with the given index. |
YList |
getRows()
Returns the rows of the partition grid. |
boolean |
isColumnOrderOptimizationEnabled()
Returns whether the order of the columns should be chosen automatically. |
boolean |
isRowOrderOptimizationEnabled()
Returns whether the order of the rows should be chosen automatically. |
void |
prepareOrientationChange(OrientationLayouter orientationLayouter,
OrientationLayouter.Transformer transformer)
A method that is called at the beginning of the OrientationLayouter stage. |
void |
setColumnOrderOptimizationEnabled(boolean enabled)
Specifies whether the order of the columns should be chosen automatically to minimize edge lengths. |
void |
setRowOrderOptimizationEnabled(boolean enabled)
Specifies whether the order of the rows should be chosen automatically to minimize edge lengths. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Object PARTITION_GRID_DPKEY
DataProvider key used to store the PartitionGrid structure.
The incremental hierarchic layouter uses the graph instance to access the data provider. If the provider contains a partition grid structure
this structure will be considered during layout.
public static final Object PARTITION_CELL_DPKEY
DataProvider key used to store 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.
PartitionCellId| Constructor Detail |
|---|
public PartitionGrid()
public PartitionGrid(int rowCount,
int columnCount)
rowCount - the number of rowscolumnCount - the number of columns
public PartitionGrid(int rowCount,
int columnCount,
double rowInsets,
double columnInsets,
double minRowSize,
double minColumnSize)
rowCount - the number of rowscolumnCount - the number of columnsrowInsets - the top and bottom insets of the rowscolumnInsets - the left and right insets of the columnsminRowSize - the minimum row heightminColumnSize - the minimum column width| Method Detail |
|---|
public boolean isColumnOrderOptimizationEnabled()
true.
public void setColumnOrderOptimizationEnabled(boolean enabled)
For all columns where ColumnDescriptor.setIndexFixed(boolean)
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.
public boolean isRowOrderOptimizationEnabled()
true.
public void setRowOrderOptimizationEnabled(boolean enabled)
For all rows where RowDescriptor.setIndexFixed(boolean)
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.
public PartitionCellId createColumnSpanId(int columnIndex)
columnIndex - the column index of the column defining the cell
public PartitionCellId createCellSpanId(int fromRowIndex,
int fromColIndex,
int toRowIndex,
int toColIndex)
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).
fromRowIndex - the row index of the topmost row defining the cellfromColIndex - the column index of the leftmost column defining the celltoRowIndex - the row index of the bottommost row defining the celltoColIndex - the column index of the rightmost column defining the cell
public PartitionCellId createCellSpanId(Collection rowList,
Collection columnList)
The partition cell identifier represents all cells defined by a column of columnList and a row of rowList.
rowList - the rows defining the cellcolumnList - the columns defining the cell
public PartitionCellId createCellSpanId(RowDescriptor fromRow,
ColumnDescriptor fromCol,
RowDescriptor toRow,
ColumnDescriptor toCol)
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).
fromRow - the topmost row defining the cellfromCol - the leftmost column defining the celltoRow - the bottommost row defining the celltoCol - the rightmost column defining the cell
public PartitionCellId createRowSpanId(int rowIndex)
rowIndex - the row index of the row defining the cell
public static PartitionGrid getPartitionGrid(Graph graph)
graph - the graph
public RowDescriptor addRow()
RowDescriptor.getIndex()) is set to the size of the list returned by getRows().
public ColumnDescriptor addColumn()
ColumnDescriptor.getIndex()) is set to the size of the list returned by getColumns().
public RowDescriptor getRow(int index)
index - the index of the row to be returned
public ColumnDescriptor getColumn(int index)
index - the index of the column to be returned
public YList getRows()
public YList getColumns()
public PartitionCellId createCellId(RowDescriptor rd,
ColumnDescriptor cd)
rd - the row defining the cellcd - the column defining the cell
public PartitionCellId createCellId(int rowIndex,
int columnIndex)
rowIndex - the row index of the row defining the cellcolumnIndex - the column index of the column defining the cell
public void finalizeOrientationChange(OrientationLayouter orientationLayouter,
OrientationLayouter.Transformer transformer)
OrientationLayouter stage.
orientationLayouter - the instance of the orientation layoutertransformer - provides a method for transferring a point to its final positionOrientationLayouter
public void prepareOrientationChange(OrientationLayouter orientationLayouter,
OrientationLayouter.Transformer transformer)
OrientationLayouter stage.
orientationLayouter - the instance of the orientation layoutertransformer - provides a method for transferring an original point to its temporary positionOrientationLayouter
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||