|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.graphlayout.IlvGraphLayout
ilog.views.graphlayout.grid.IlvGridLayout
public class IlvGridLayout
The main class for the Grid Layout algorithm.
The Grid Layout algorithm has two major modes: grid and row/column.
(For details, see the method setLayoutMode(int).)
In grid mode, the layout arranges the nodes of a graph in the cells of a
grid (matrix).
If a node is too large to fit into one grid cell (with a margin), it
occupies multiple cells.
The size of the grid cells can be specified using the methods
setHorizontalGridOffset(float) and
setVerticalGridOffset(float). The margins can be specified using
the methods setTopMargin(float), setBottomMargin(float),
setLeftMargin(float), and setRightMargin(float).
The following sample drawing shows a layout in the grid mode where the grid size has been specified so that each node fits into one grid cell. (Usually such layouts are more esthetic and appear to be more regular, but a larger area is left empty around the smallest nodes. This is generally the best option when all the nodes have the same size.)
In row/column mode, the layout arranges the nodes of a graph either by rows
or by columns (according to the specified option).
The width of the rows is controlled by the width of the layout region parameter.
The height of the columns is controlled by the height of the layout region
parameter.
The margins can be specified using the methods setTopMargin(float),
setBottomMargin(float), setLeftMargin(float), and setRightMargin(float).
The minimum horizontal distance between nodes is equal to the sum of
the left and right margins.
The minimum vertical distance between nodes is equal to the sum of
the top and bottom margins.
For graphs with nodes of heterogeneous size, the row/column mode often allows a more compact layout than the grid mode.
The following sample drawing shows a layout in the row mode.
The algorithm is primarily designed for graphs without (visible) links between the nodes. If links exist, they are ignored by the Grid layout.
Several alignment options are provided (see setGlobalHorizontalAlignment(int)
and setGlobalVerticalAlignment(int)). The alignment can be specified
individually for each node (see setHorizontalAlignment(java.lang.Object, int) and
setVerticalAlignment(java.lang.Object, int)).
An incremental mode is provided (see setIncrementalMode(boolean)).
If the incremental mode is enabled, the stability of the layout is
preserved as much as possible when new nodes are added, existing ones removed,
or node sizes modified. This means that the nodes are placed at the
same location, or in the same order, as in the previous layout whenever possible.
In this mode, the layout algorithm processes the changes incrementally rather than
redoing the entire layout for every change.
Nodes that the layout algorithm is not allowed to move can be specified
using the method IlvGraphLayout.setFixed(java.lang.Object, boolean). (See also
IlvGraphLayout.setPreserveFixedNodes(boolean).)
In grid mode, nonfixed nodes are placed in such a way that they do not
overlap the grid cells occupied by other fixed or nonfixed nodes.
In row/column mode, nonfixed nodes are placed in such a way that they
do not overlap fixed or nonfixed nodes.
Of course, fixed nodes can overlap other fixed nodes.
The layout algorithm can take into account a different node size than
the size corresponding to the bounding box of the node. Using
setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface), you can specify an object that
provides the box that has to be taken into account for each node.
The following diagram shows the dimensional parameters of the layout
in grid mode (the row/column case mode is analogous) when a node box that is different
from the bounding box of the node is used:
| Field Summary | |
|---|---|
static Comparator |
ASCENDING_AREA
Ordering by ascending area option. |
static Comparator |
ASCENDING_HEIGHT
Ordering by ascending height option. |
static Comparator |
ASCENDING_INDEX
Ordering by ascending index option. |
static Comparator |
ASCENDING_WIDTH
Ordering by ascending width option. |
static Comparator |
AUTOMATIC_ORDERING
Automatic ordering option. |
static int |
BOTTOM
Bottom alignment option. |
static int |
CENTER
Center alignment option. |
static Comparator |
DESCENDING_AREA
Ordering by descending area option. |
static Comparator |
DESCENDING_HEIGHT
Ordering by height option. |
static Comparator |
DESCENDING_INDEX
Ordering by descending index option. |
static Comparator |
DESCENDING_WIDTH
Ordering by descending width option. |
static int |
LEFT
Left alignment option. |
static int |
MIXED
Mixed alignment option. |
static int |
NO_INDEX
No index code. |
static Comparator |
NO_ORDERING
No ordering option. |
static int |
RIGHT
Right alignment option. |
static int |
TILE_TO_COLUMNS
Tile-to-columns layout mode. |
static int |
TILE_TO_GRID_FIXED_HEIGHT
Tile-to-grid layout mode with fixed height of the grid. |
static int |
TILE_TO_GRID_FIXED_WIDTH
Tile-to-grid layout mode with fixed width of the grid. |
static int |
TILE_TO_ROWS
Tile-to-rows layout mode. |
static int |
TOP
Top alignment option. |
| Fields inherited from class ilog.views.graphlayout.IlvGraphLayout |
|---|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES |
| Constructor Summary | |
|---|---|
IlvGridLayout()
Creates a new instance of the Grid Layout algorithm. |
|
IlvGridLayout(IlvGridLayout source)
Creates a new layout instance by copying an existing one. |
|
| Method Summary | |
|---|---|
void |
checkAppropriateLinks()
Throws an exception if the links are not appropriate for the layout. |
IlvGraphLayout |
copy()
Copies the layout instance. |
void |
copyParameters(IlvGraphLayout source)
Copies the parameters from a given layout instance. |
protected IlvGraphLayoutGrapherProperty |
createLayoutGrapherProperty(String name,
boolean withDefaults)
Returns a new instance of IlvGridLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutNodeProperty |
createLayoutNodeProperty(String name,
IlvGraphic node,
boolean withDefaults)
Returns a new instance of IlvGridLayoutNodeProperty
that stores the parameter settings of this layout class for nodes. |
void |
detach()
Detaches the graph model from the layout instance. |
float |
getBottomMargin()
Returns the bottom margin. |
int |
getGlobalHorizontalAlignment()
Returns the global horizontal alignment style. |
int |
getGlobalVerticalAlignment()
Returns the global vertical alignment style. |
int |
getHorizontalAlignment(Object node)
Returns the local horizontal alignment style of the node. |
float |
getHorizontalGridOffset()
Returns the horizontal grid offset. |
int |
getIndex(Object node)
Returns the index associated with a node. |
int |
getLayoutMode()
Returns the current layout mode. |
float |
getLeftMargin()
Returns the left margin. |
int |
getMaxNumberOfNodesPerRowOrColumn()
Returns the maximum number of nodes per row in TILE_TO_ROWS mode
or the maximum number of nodes per column in TILE_TO_COLUMNS
mode. |
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm. |
IlvNodeBoxInterface |
getNodeBoxInterface()
Returns the object that provides the rectangle defining the location and size of each node, if one is specified. |
Comparator |
getNodeComparator()
Returns the comparator used for sorting the nodes. |
float |
getRightMargin()
Returns the right margin. |
float |
getTopMargin()
Returns the top margin. |
int |
getVerticalAlignment(Object node)
Returns the local vertical alignment style of the node. |
float |
getVerticalGridOffset()
Returns the vertical grid offset. |
protected void |
init()
Initializes instance variables. |
boolean |
isIncrementalMode()
Returns true if the incremental mode is enabled,
and false otherwise. |
protected void |
layout(boolean redraw)
Computes the layout using the Grid Layout algorithm. |
void |
setBottomMargin(float margin)
Sets the bottom margin parameter. |
void |
setGlobalHorizontalAlignment(int alignment)
Sets the global horizontal alignment style. |
void |
setGlobalVerticalAlignment(int alignment)
Sets the global vertical alignment style. |
void |
setHorizontalAlignment(Object node,
int alignment)
Sets the horizontal alignment style of an individual node. |
void |
setHorizontalGridOffset(float offset)
Sets the spacing of the grid lines on the horizontal axis. |
void |
setIncrementalMode(boolean enable)
Sets the incremental mode. |
void |
setIndex(Object node,
int index)
Sets the index of a node. |
void |
setLayoutMode(int mode)
Sets the layout mode. |
void |
setLeftMargin(float margin)
Sets the left margin parameter. |
void |
setMaxNumberOfNodesPerRowOrColumn(int nNodes)
Sets the maximum number of nodes per row or per column. |
void |
setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
Sets an object that provides the rectangle defining the location and size of each node. |
void |
setNodeComparator(Comparator comparator)
Sets the comparator used for sorting the nodes. |
void |
setRightMargin(float margin)
Sets the right margin parameter. |
void |
setTopMargin(float margin)
Sets the top margin parameter. |
void |
setVerticalAlignment(Object node,
int alignment)
Sets the vertical alignment style of an individual node. |
void |
setVerticalGridOffset(float offset)
Sets the spacing of the grid lines on the vertical axis. |
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded. |
boolean |
supportsLayoutRegion()
Indicates that this layout class can control the size of the graph drawing to fit a user-defined region (a rectangle) or a user-defined manager view. |
boolean |
supportsPreserveFixedNodes()
Indicates that this layout class allows the user to specify fixed nodes. |
boolean |
supportsSaveParametersToNamedProperties()
Indicates that this layout class can transfer the layout parameters to named properties. |
boolean |
supportsStopImmediately()
Indicates that this layout class can control the current run by interrupting the run of the layout immediately. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CENTER
setGlobalHorizontalAlignment(int),
all the nodes are horizontally centered in their grid cell or column.
The alignment of an individual node can be set by
setHorizontalAlignment(Object, int).
When used as the argument of the method setGlobalVerticalAlignment(int),
all the nodes are vertically centered in their grid cell or row.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int LEFT
setGlobalHorizontalAlignment(int),
all the nodes are aligned to the left border of their grid cell or column.
The alignment of an individual node can be set by
setHorizontalAlignment(Object, int).
public static final int RIGHT
setGlobalHorizontalAlignment(int),
all the nodes are aligned to the right border of their grid cell or column.
The alignment of an individual node can be set by
setHorizontalAlignment(Object, int).
public static final int TOP
setGlobalVerticalAlignment(int),
all the nodes are aligned to the top border of their grid cell or row.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int BOTTOM
setGlobalVerticalAlignment(int),
all the nodes are aligned to the bottom border of their grid cell or row.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int MIXED
setGlobalHorizontalAlignment(int)
or setGlobalVerticalAlignment(int),
each node can have a different alignment.
The alignment of an individual node can be set by
setHorizontalAlignment(Object, int) and
setVerticalAlignment(Object, int).
public static final int TILE_TO_ROWS
setLayoutMode(int),
all the nodes are organized in rows and are vertically aligned
with respect to the row border according to the vertical alignment option.
In this mode, the grid offset parameters are not used and the
height of the layout region IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView) controls the maximum
total height of the layout.
public static final int TILE_TO_COLUMNS
setLayoutMode(int),
all the nodes are organized in columns and are horizontally aligned
with respect to the row border according to the horizontal alignment option.
In this mode, the grid offset parameters are not used and the
width of the layout region IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView) controls the maximum
total width of the layout.
public static final int TILE_TO_GRID_FIXED_WIDTH
setLayoutMode(int),
the nodes are placed in the cells of a grid and the width of the
layout region IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView)) controls the maximum
width of the grid.
public static final int TILE_TO_GRID_FIXED_HEIGHT
setLayoutMode(int),
the nodes are placed in the cells of a grid and
the height of the
layout region IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView)) controls the maximum
height of the grid.
public static final Comparator AUTOMATIC_ORDERING
setNodeComparator(java.util.Comparator), the algorithm is free to choose the order
in such a way that it tries to reduce the total area occupied by the layout.
public static final Comparator NO_ORDERING
setNodeComparator(java.util.Comparator), the nodes are arranged
in an arbitrary order.
public static final Comparator DESCENDING_HEIGHT
setNodeComparator(java.util.Comparator), the nodes are arranged
by height, starting at the upper-left corner
with the tallest node.
Ordering the nodes by height can save vertical space and produce a
more compact layout.
public static final Comparator ASCENDING_HEIGHT
setNodeComparator(java.util.Comparator), the nodes are arranged
by ascending height, starting at the upper-left corner
with the node of the smallest height.
Ordering the nodes by height can save vertical space and produce a
more compact layout.
public static final Comparator ASCENDING_WIDTH
setNodeComparator(java.util.Comparator), the nodes are arranged
by ascending width, starting at the upper-left corner
with the node of the smallest width.
public static final Comparator DESCENDING_WIDTH
setNodeComparator(java.util.Comparator), the nodes are arranged
by width, starting at the upper-left corner
with the node of the highest width.
public static final Comparator ASCENDING_AREA
setNodeComparator(java.util.Comparator), the nodes are arranged
by ascending area, starting at the upper-left corner
with the node of the smallest area.
public static final Comparator DESCENDING_AREA
setNodeComparator(java.util.Comparator), the nodes are arranged
by area, starting at the upper-left corner
with the node of the highest area.
public static final Comparator ASCENDING_INDEX
setNodeComparator(java.util.Comparator), the nodes are arranged
in the order of their indexes, starting at the upper-left corner
with the node with the smallest index. Nodes that do not have an
index are placed after the nodes for which an index is specified.
Ordering by index allows you to specify a particular order for the nodes.
setIndex(java.lang.Object, int)public static final Comparator DESCENDING_INDEX
setNodeComparator(java.util.Comparator), the nodes are arranged
in the order of their indexes, starting at the upper-left corner
with the node with the highest index. Nodes that do not have an
index are placed after the nodes for which an index is specified.
Ordering by index allows you to specify a particular order for the nodes.
setIndex(java.lang.Object, int)public static final int NO_INDEX
getIndex(java.lang.Object)
when a node has no index value.
| Constructor Detail |
|---|
public IlvGridLayout()
IlvGraphLayout.attach(IlvGrapher).
IlvGraphLayout.attach(IlvGraphModel).
IlvGraphLayout.performLayout().
IlvGraphLayout.attach(IlvGrapher),
IlvGraphLayout.attach(IlvGraphModel),
IlvGraphLayout.performLayout(),
IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer),
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)public IlvGridLayout(IlvGridLayout source)
copy() method.
Any subclass should provide a copy constructor.
The parameters of the source layout are copied using
the method copyParameters(ilog.views.graphlayout.IlvGraphLayout).
source - The layout instance that is copied.copy(),
copyParameters(ilog.views.graphlayout.IlvGraphLayout)| Method Detail |
|---|
protected void init()
You should not call this method directly. The method is called internally by the constructor without arguments and by the copy constructor. The method must be overridden by subclasses that need to initialize additional instance variables.
init in class IlvGraphLayoutpublic IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout on a nested graph,
this method is used by IlvLayoutProvider to
"clone" the layout instance of a parent graph.
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the layout region specification and the node box interface, are also copied.
If a method of the type supportsXXX is associated
with a parameter, the parameter is copied only if the corresponding
method returns true.
copy in class IlvGraphLayoutpublic void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the layout region specification and the node box interface, are also copied.
If a method of the type supportsXXX is associated with a parameter,
the parameter is copied only if the corresponding method returns true.
copyParameters in class IlvGraphLayoutsource - The layout instance from which the parameters are copied.
protected void layout(boolean redraw)
throws IlvGraphLayoutException
IlvGraphLayout.performLayout().
layout in class IlvGraphLayoutredraw - If true, the attached graph model will be asked
to redraw the graph after layout.
When the layout algorithm moves the nodes and reshapes the links, it is
required to pass the value of the redraw argument to the
methods IlvGraphModel.moveNode(java.lang.Object, float, float, boolean) and
IlvGraphModel.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean).
IlvGraphLayoutException - If an unusual situation occurs.
WARNING: this method can throw one of the subclasses of
IlvGraphLayoutException. Specifically, it can throw an
IlvInappropriateGraphException. It can also throw an
IlvInappropriateLinkException when inappropriate types
of links and/or link connectors are used in an IlvGrapher.
For details, refer to the documentation of these exception classes.IlvGraphLayout.performLayout()public void detach()
IlvGraphLayout.attach(IlvGraphModel).
The method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Grid Layout algorithm removes the alignment specifications of individual nodes.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
detach in class IlvGraphLayoutIlvGraphLayout.attach(IlvGraphModel),
setHorizontalAlignment(java.lang.Object, int),
setVerticalAlignment(java.lang.Object, int)public final boolean supportsLayoutRegion()
If the layout mode (see setLayoutMode(int)) is TILE_TO_GRID_FIXED_WIDTH,
the width of the layout region determines the maximum width of the layout (the
maximum number of columns).
If the layout mode is TILE_TO_GRID_FIXED_HEIGHT,
the height of the layout region determines the maximum height of the layout (the
maximum number of rows).
If the layout mode is TILE_TO_ROWS,
the width of the layout region determines the maximum width of the rows.
If the layout mode is TILE_TO_COLUMNS,
the height of the layout region determines the maximum height of the columns.
However, if the width of a node is larger than the maximum width of the layout or the height of the node is larger than the maximum height of the layout, the bounding box of the node will be placed partially out of the specified layout region.
In all layout modes, the coordinates of the top-left corner of the layout region determines the coordinates of the top-left border of the layout.
supportsLayoutRegion in class IlvGraphLayouttrue.IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView),
IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView, ilog.views.IlvRect),
IlvGraphLayout.setLayoutRegion(ilog.views.IlvRect),
IlvGraphLayout.getSpecLayoutRegion(),
IlvGraphLayout.getCalcLayoutRegion()public final boolean supportsPreserveFixedNodes()
IlvGraphLayout.setPreserveFixedNodes(boolean) is called with a
true argument. Nonfixed nodes are placed in such
a manner that overlaps with fixed nodes are avoided.
supportsPreserveFixedNodes in class IlvGraphLayouttrue.IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter),
IlvGraphLayout.setPreserveFixedNodes(boolean),
IlvGraphLayout.isPreserveFixedNodes()public final boolean supportsAllowedTime()
IlvGraphLayoutReport.STOPPED_AND_INVALID.
supportsAllowedTime in class IlvGraphLayouttrue.IlvGraphLayout.setAllowedTime(long),
IlvGraphLayout.getAllowedTime(),
IlvGraphLayoutReport.getCode()public boolean supportsStopImmediately()
IlvGraphLayoutReport.STOPPED_AND_INVALID.
supportsStopImmediately in class IlvGraphLayouttrue.IlvGraphLayout.stopImmediately(),
IlvGraphLayout.isStoppedImmediately()public boolean supportsSaveParametersToNamedProperties()
.ivl file.
supportsSaveParametersToNamedProperties in class IlvGraphLayouttrue.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout, boolean),
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout),
IlvGrapherAdapter.removeParametersFromNamedProperties()public void setLayoutMode(int mode)
TILE_TO_GRID_FIXED_WIDTH -
The nodes are placed in the cells of a grid (matrix) that has a fixed maximum
number of columns. This number is equal to the width of the layout region
parameter divided by the horizontal grid offset (see
setHorizontalGridOffset(float)).
TILE_TO_GRID_FIXED_HEIGHT -
The nodes are placed in the cells of a grid (matrix) that has a fixed maximum
number of rows. This number is equal to the height of the layout region
parameter divided by the vertical grid offset (see setVerticalGridOffset(float)).
TILE_TO_ROWS -
The nodes are placed in rows. The maximum width of the rows is equal
to the width of the layout region parameter. The height of each row is
the maximum height of the nodes contained in the row (plus margins).
TILE_TO_COLUMNS -
The nodes are placed in columns. The maximum height of the columns is equal
to the height of the layout region parameter. The width of each column is
the maximum width of the nodes contained in the column (plus margins).
The default value is TILE_TO_GRID_FIXED_WIDTH.
getLayoutMode(),
setGlobalHorizontalAlignment(int),
setGlobalVerticalAlignment(int),
setHorizontalAlignment(java.lang.Object, int),
setVerticalAlignment(java.lang.Object, int)public int getLayoutMode()
setLayoutMode(int)public void setIncrementalMode(boolean enable)
If the incremental mode is enabled, the stability of the layout is preserved as much as possible when new nodes are added, existing ones removed, or node sizes modified. This means that the nodes are placed at the same location or in the same order as in the previous layout whenever possible. In this mode, the layout algorithm processes the changes incrementally rather than redoing the entire layout for every change.
To preserve the stability, the incremental mode can keep some regions free. Therefore, the total area of the layout can be larger than when nonincremental mode is used.
Note that the layout is redone from scratch after a change in one of the following parameters:
The default value is false (disabled).
public boolean isIncrementalMode()
true if the incremental mode is enabled,
and false otherwise.
setIncrementalMode(boolean)public void setGlobalHorizontalAlignment(int alignment)
setLayoutMode(int)) is TILE_TO_GRID_FIXED_WIDTH
or TILE_TO_GRID_FIXED_HEIGHT, or
inside the columns if the layout mode is TILE_TO_COLUMNS.
This parameter is not used if the layout mode (see setLayoutMode(int))
is TILE_TO_ROWS.
Valid values are:
CENTER -
the node is centered in its grid cell or column.LEFT -
the node is aligned to the left border of the cell or column.RIGHT -
the node is aligned to the left border of the cell or column.MIXED -
each node can have a different alignment option.
In this case, the horizontal alignment of each individual node can be set by
the method setHorizontalAlignment(Object, int) so that different
alignments can occur in the same layout.
The default value is CENTER.
getGlobalHorizontalAlignment(),
setGlobalVerticalAlignment(int),
setHorizontalAlignment(java.lang.Object, int),
setLayoutMode(int)public int getGlobalHorizontalAlignment()
setGlobalHorizontalAlignment(int)
public void setHorizontalAlignment(Object node,
int alignment)
MIXED. Otherwise, all nodes have the alignment style
that is specified as the global alignment style.
The parameter controls the
horizontal alignment of nodes either inside their grid cell if the
layout mode (see setLayoutMode(int)) is TILE_TO_GRID_FIXED_WIDTH
or TILE_TO_GRID_FIXED_HEIGHT, or
inside the columns if the layout mode is TILE_TO_COLUMNS.
This parameter is not used if the layout mode (see setLayoutMode(int))
is TILE_TO_ROWS.
Valid values are:
CENTER -
the node is centered in its grid cell or column.LEFT -
the node is aligned to the left border of the cell or column.RIGHT -
the node is aligned to the left border of the cell or column.
The default value is CENTER.
getHorizontalAlignment(java.lang.Object),
setGlobalHorizontalAlignment(int)public int getHorizontalAlignment(Object node)
setHorizontalAlignment(java.lang.Object, int),
setGlobalHorizontalAlignment(int)public void setGlobalVerticalAlignment(int alignment)
setLayoutMode(int)) is TILE_TO_GRID_FIXED_WIDTH
or TILE_TO_GRID_FIXED_HEIGHT, or
inside the rows if the layout mode is TILE_TO_ROWS.
This parameter is not used if the layout mode (see setLayoutMode(int))
is TILE_TO_COLUMNS.
Valid values are:
CENTER -
the node is centered in its grid cell or column.TOP -
the node is aligned to the top border of the cell or column.BOTTOM -
the node is aligned to the bottom border of the cell or column.MIXED -
each node can have a different alignment option.
In this case, the vertical alignment of each individual node can be set by
the method setVerticalAlignment(Object, int) so that different
alignments can occur in the same layout.
The default value is CENTER.
getGlobalVerticalAlignment(),
setGlobalHorizontalAlignment(int),
setVerticalAlignment(java.lang.Object, int),
setLayoutMode(int)public int getGlobalVerticalAlignment()
setGlobalVerticalAlignment(int)
public void setVerticalAlignment(Object node,
int alignment)
MIXED. Otherwise, all nodes have the alignment style
that is specified as the global alignment style.
The parameter controls the
vertical alignment of nodes either inside their grid cell if the
layout mode (see setLayoutMode(int)) is TILE_TO_GRID_FIXED_WIDTH
or TILE_TO_GRID_FIXED_HEIGHT, or
inside the rows if the layout mode is TILE_TO_ROWS.
This parameter is not used if the layout mode (see setLayoutMode(int))
is TILE_TO_COLUMNS.
Valid values are:
CENTER -
the node is centered in its grid cell or column.TOP -
the node is aligned to the top border of the cell or column.BOTTOM -
the node is aligned to the bottom border of the cell or column.
The default value is CENTER.
getVerticalAlignment(java.lang.Object),
setGlobalVerticalAlignment(int)public int getVerticalAlignment(Object node)
setVerticalAlignment(java.lang.Object, int),
setGlobalVerticalAlignment(int)public final void setNodeComparator(Comparator comparator)
AUTOMATIC_ORDERING -
The algorithm is free to choose the order in such a way that
it tries to reduce the total area occupied by the layout.NO_ORDERING -
No ordering is performed.DESCENDING_HEIGHT -
The nodes are ordered in the descending order of their height.ASCENDING_HEIGHT -
The nodes are ordered in the ascending order of their height.DESCENDING_WIDTH -
The nodes are ordered in the descending order of their width.ASCENDING_WIDTH -
The nodes are ordered in the ascending order of their width.DESCENDING_AREA -
The nodes are ordered in the descending order of their area.ASCENDING_AREA -
The nodes are ordered in the ascending order of their area.ASCENDING_INDEX -
The nodes are ordered in the ascending order of their indexsetIndex(java.lang.Object, int)).
DESCENDING_INDEX -
The nodes are ordered in the descending order of their index
(see setIndex(java.lang.Object, int)).null -
The nodes are ordered in an arbitrary way.java.util.Comparator
interface -
The nodes are ordered according to this custom comparator.AUTOMATIC_ORDERING.
The ordering of the nodes starts at the upper-left corner.
Note that in incremental mode (see setIncrementalMode(boolean)) or
when nodes are fixed (see IlvGraphLayout.setFixed(java.lang.Object, boolean)) the order of the nodes
is not guaranteed to obey the comparator, since this specification
competes with the other constraints.
Note also that, if the layout mode is TILE_TO_GRID_FIXED_WIDTH
or TILE_TO_GRID_FIXED_HEIGHT, the order options are applied
only for nodes whose size (including margins) is smaller than the
grid cell size (see setHorizontalGridOffset(float) and
setVerticalGridOffset(float)).
getNodeComparator()public Comparator getNodeComparator()
public void setIndex(Object node,
int index)
NO_INDEX as an index value if you want to reset an index
you previously specified.
Note that index must not be negative. The values of the
indexes for consecutive nodes are not necessarily consecutive. Only the
order of the values is important.
getIndex(java.lang.Object)public int getIndex(Object node)
NO_INDEX if
node has no index.