|
||||||||||
| 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.bus.IlvBusLayout
public class IlvBusLayout
The main class for the Bus Layout algorithm.
The Bus Layout algorithm is designed to display bus network topologies, that is, a set of nodes connected to a bus node. The algorithm takes into account the size of the nodes (so that no nodes overlap) and provides several ordering and alignment options.
Here is a sample drawing produced with the Bus Layout algorithm:

To use this layout style, you must specify a node of the attached graph model
as the "bus" using the method setBus(ilog.views.IlvPolyPointsInterface).
The bus node must be an instance of a class that implements the interface
IlvPolyPointsInterface, for instance, an
IlvPolyline (or a subclass).
The layout algorithm gives the bus polyline the appropriate shape
by moving, adding, or removing points as needed. Therefore, the initial
number of points and the position of those points are not significant.
Note that for the bus object, you can use only implementations of
the interface IlvPolyPointsInterface for which the methods
IlvPolyPointsInterface.allowsPointInsertion() and
IlvPolyPointsInterface.allowsPointRemoval()
return true.
Only the nodes connected to the bus node by a link are laid out.
The following figure illustrates the dimensional parameters of the layout algorithm.

The algorithm not only computes the shape of the bus object and the position of the nodes connected to the bus but also the connection points of the links on the bus node. These points are computed in such a manner as to obtain vertical links.
If the attached graph model encapsulates an IlvGrapher,
the computation of the connection points is provided by a special subclass
of IlvLinkConnector called IlvBusLinkConnector.
Otherwise, the method getConnectionPoint(java.lang.Object, ilog.views.IlvPolyPointsInterface)
is provided to allow you to implement a different mechanism.
See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features, code samples, parameters, and so on.
Note that the initial position of the nodes (at the moment you start the
layout) does not affect the resulting layout.
However, nodes specified as fixed are not moved if you call the method
IlvGraphLayout.setPreserveFixedNodes(boolean) with a true argument. The other
nodes are placed in such a way that overlaps with the fixed nodes are
avoided.
| Field Summary | |
|---|---|
static int |
ALTERNATE
Alternate flow direction. |
static Comparator |
ASCENDING_AREA
Ordering by ascending area. |
static Comparator |
ASCENDING_HEIGHT
Ordering by ascending height. |
static Comparator |
ASCENDING_INDEX
Ordering by ascending index. |
static Comparator |
ASCENDING_WIDTH
Ordering by ascending width. |
static int |
BOTTOM
Bottom alignment option. |
static int |
CENTER
Center alignment option. |
static Comparator |
DESCENDING_AREA
Ordering by descending area. |
static Comparator |
DESCENDING_HEIGHT
Ordering by descending height. |
static Comparator |
DESCENDING_INDEX
Ordering by descending index. |
static Comparator |
DESCENDING_WIDTH
Ordering by descending width. |
static int |
LEFT_TO_RIGHT
Left-to-right flow direction. |
static int |
MIXED
Mixed alignment option. |
static int |
NO_INDEX
No index code. |
static int |
NO_ORDERING
Deprecated. Beginning with ILOG JViews 6.5, pass the value null
to setNodeComparator(java.util.Comparator) instead. |
static int |
NO_RESHAPE_STYLE
No links reshape option. |
static int |
NODES_ABOVE_BUS
Above bus position of the nodes. |
static int |
NODES_BELOW_BUS
Below bus position of the nodes. |
static int |
ORDER_BY_HEIGHT
Deprecated. Beginning with ILOG JViews 6.5, pass the value DESCENDING_HEIGHT to the method setNodeComparator(java.util.Comparator)
instead. |
static int |
ORDER_BY_INDEX
Deprecated. Beginning with ILOG JViews 6.5, pass the value ASCENDING_INDEX to the method setNodeComparator(java.util.Comparator)
instead. |
static int |
STRAIGHT_LINE_STYLE
Straight-line links shape option. |
static int |
TOP
Top alignment option. |
| Fields inherited from class ilog.views.graphlayout.IlvGraphLayout |
|---|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES |
| Constructor Summary | |
|---|---|
IlvBusLayout()
Creates a new instance of the Bus Layout algorithm. |
|
IlvBusLayout(IlvBusLayout source)
Creates a new layout instance by copying an existing one. |
|
| Method Summary | |
|---|---|
int |
checkAppropriateLink(Object link)
Checks whether the input link is appropriate for this 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 IlvBusLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutNodeProperty |
createLayoutNodeProperty(String name,
IlvGraphic node,
boolean withDefaults)
Returns a new instance of IlvBusLayoutNodeProperty
that stores the parameter settings of this layout class for nodes. |
void |
detach()
Overridden version of the method detach. |
IlvPolyPointsInterface |
getBus()
Returns the current bus node. |
float |
getConnectionOnBusMargin()
Returns the horizontal offset between the first/last node on a given level and the left/right margin of the level. |
IlvPoint |
getConnectionPoint(Object link,
IlvPolyPointsInterface bus)
Returns the connection point of link on the bus node. |
int |
getFlowDirection()
Returns the option that specifies the flow direction of the nodes. |
int |
getGlobalVerticalAlignment()
Returns the global vertical alignment style. |
float |
getHorizontalOffset()
Returns the horizontal offset between nodes placed on the same level of the bus. |
int |
getIndex(Object node)
Returns the index associated with a node. |
IlvBusLinkConnector |
getLinkConnector()
Returns the link connector installed on the bus node, if the bus is already specified, or the link connector instance that will be installed on the bus when it is specified. |
int |
getLinkStyle()
Returns the current option for the style of the shape of the links. |
float |
getMargin()
Returns the horizontal offset between the left/right border of the bus level and the left/right border of the layout region. |
float |
getMarginOnBus()
Returns the horizontal offset between the first/last node on a given level and the left/right margin of the level. |
int |
getMaxNumberOfNodesPerLevel()
Returns the maximum number of nodes per level. |
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm. |
Comparator |
getNodeComparator()
Returns the comparator used for sorting the nodes. |
int |
getNodePosition()
Returns the node position option. |
int |
getOrdering()
Deprecated. Beginning with ILOG JViews 6.5, use the method getNodeComparator() instead. |
int |
getVerticalAlignment(Object node)
Returns the local vertical alignment style of the node. |
float |
getVerticalOffsetToLevel()
Returns the vertical offset between the nodes and the horizontal level of the bus to which they are connected. |
float |
getVerticalOffsetToPreviousLevel()
Returns the vertical offset between nodes and the horizontal level of the bus above the nodes. |
protected void |
init()
Initializes instance variables. |
boolean |
isBusLineExtremityAdjustingEnabled()
Returns true if the adjustment of the extremity points
of the bus line is enabled. |
boolean |
isBusWidthAdjustingEnabled()
Returns true if the adjustment of the bus width to the
total width of the nodes is enabled. |
boolean |
isIncrementalMode()
Returns true if the incremental mode is enabled. |
protected void |
layout(boolean redraw)
Computes the layout using the Bus Layout algorithm. |
protected IlvBusLinkConnector |
makeLinkConnector()
Creates a new instance of the link connector. |
void |
setBus(IlvPolyPointsInterface bus)
Allows you to specify the bus node. |
void |
setBusLineExtremityAdjustingEnabled(boolean enable)
Enables the adjustment of the extremity points of the bus line. |
void |
setBusWidthAdjustingEnabled(boolean enable)
Enables the adjustment of the bus width to the total width of the nodes. |
void |
setConnectionOnBusMargin(float margin)
Sets the horizontal offset between the first/last node on a given level and the left/right margin of the level. |
void |
setFlowDirection(int direction)
Allows you to specify the flow direction of the nodes. |
void |
setGlobalVerticalAlignment(int alignment)
Sets the global vertical alignment style. |
void |
setHorizontalOffset(float offset)
Sets the horizontal offset between nodes placed on the same level of the bus. |
void |
setIncrementalMode(boolean enable)
Enables or disables the incremental mode. |
void |
setIndex(Object node,
int index)
Allows you to specify the index of a node. |
void |
setLinkStyle(int style)
Sets the style of the shape of the links. |
void |
setMargin(float margin)
Sets the horizontal offset between the left/right border of the bus level and the left/right border of the layout region. |
void |
setMarginOnBus(float margin)
Sets the horizontal offset between the first/last node on a given level and the left/right margin of the level. |
void |
setMaxNumberOfNodesPerLevel(int nNodes)
Sets the maximum number of nodes per level. |
void |
setNodeComparator(Comparator comparator)
Sets the comparator used for sorting the nodes. |
void |
setNodePosition(int position)
Sets the position of the nodes in respect to the bus line. |
void |
setOrdering(int ordering)
Deprecated. Beginning with ILOG JViews 6.5, use the method setNodeComparator(java.util.Comparator) instead. |
void |
setVerticalAlignment(Object node,
int alignment)
Sets the vertical alignment style of an individual node. |
void |
setVerticalOffsetToLevel(float offset)
Sets the vertical offset between the nodes and the horizontal level of the bus to which they are connected. |
void |
setVerticalOffsetToPreviousLevel(float offset)
Sets the vertical offset between the nodes and the horizontal level of the bus above the nodes. |
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 |
supportsLayoutOfConnectedComponents()
Indicates that this layout class can cut the attached graph into connected components, apply itself to each connected component separately, and use the layout instance returned by the method IlvGraphLayout.getLayoutOfConnectedComponents() to position the connected
components. |
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 |
supportsLinkClipping()
Indicates that this layout class can use a link clip interface to clip the end points of a link. |
boolean |
supportsLinkConnectionBox()
Indicates that this layout class can use a link connection box interface to calculate the end points of a link. |
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 interrupt the current run of layout immediately in a controlled way. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_ORDERING
null
to setNodeComparator(java.util.Comparator) instead.setOrdering(int), the nodes are arranged
on the bus arbitrarily.
public static final int ORDER_BY_HEIGHT
DESCENDING_HEIGHT to the method setNodeComparator(java.util.Comparator)
instead.setOrdering(int), the nodes are arranged
on the bus by height, starting at the upper-left margin
of the bus with the tallest node.
Ordering the nodes by height can save vertical space and produce a
more compact layout.
public static final int ORDER_BY_INDEX
ASCENDING_INDEX to the method setNodeComparator(java.util.Comparator)
instead.setOrdering(int), the nodes are arranged
on the bus in the order of their indexes, starting at the upper-left margin
of the bus 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.
public static final Comparator DESCENDING_HEIGHT
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus by height, starting at the upper-left margin
of the bus 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
on the bus by ascending height, starting at the upper-left margin
of the bus 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
on the bus by ascending width, starting at the upper-left margin
of the bus with the node of the smallest width.
public static final Comparator DESCENDING_WIDTH
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus by width, starting at the upper-left margin
of the bus with the node of the highest width.
public static final Comparator ASCENDING_AREA
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus by ascending area, starting at the upper-left margin
of the bus with the node of the smallest area.
public static final Comparator DESCENDING_AREA
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus by area, starting at the upper-left margin
of the bus with the node of the highest area.
public static final Comparator ASCENDING_INDEX
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus in the order of their indexes, starting at the upper-left margin
of the bus 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.
public static final Comparator DESCENDING_INDEX
setNodeComparator(java.util.Comparator), the nodes are arranged
on the bus in the order of their indexes, starting at the upper-left margin
of the bus 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.
public static final int NO_INDEX
getIndex(java.lang.Object)
when a node has no index value.
public static final int STRAIGHT_LINE_STYLE
setLinkStyle(int), the links are given a straight-line shape.
public static final int NO_RESHAPE_STYLE
setLinkStyle(int), the links are not reshaped.
public static final int CENTER
When used as the argument of the method
setGlobalVerticalAlignment(int),
all the nodes are vertically centered on their level.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int TOP
setGlobalVerticalAlignment(int),
all the nodes are aligned to the top border of their level.
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 level.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int MIXED
setGlobalVerticalAlignment(int),
each node can have a different alignment.
The alignment of an individual node can be set by
setVerticalAlignment(Object, int).
public static final int LEFT_TO_RIGHT
setFlowDirection(int),
all the nodes "flow" from left to right on all levels of the bus.
public static final int ALTERNATE
setFlowDirection(int),
all the nodes "flow" from left to right on the odd bus levels (first,
third, fifth, and so on) and from right to left on the even bus levels
(second, fourth, sixth, and so on). The levels are numbered from the top.
public static final int NODES_ABOVE_BUS
setNodePosition(int),
the nodes are placed above the corresponding bus line.
public static final int NODES_BELOW_BUS
setNodePosition(int),
the nodes are placed below the corresponding bus line.
| Constructor Detail |
|---|
public IlvBusLayout()
IlvGraphLayout.attach(IlvGrapher).
IlvGraphLayout.attach(IlvGraphModel).
setBus(ilog.views.IlvPolyPointsInterface).
IlvGraphLayout.performLayout().
IlvGraphLayout.attach(ilog.views.IlvGrapher),
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel),
IlvGraphLayout.performLayout()public IlvBusLayout(IlvBusLayout 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 |
|---|
public IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout of 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 customization interfaces, are also copied. A copy of the layout instance used for laying out the connected components is set on the new instance.
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 customization interfaces, are also copied. A copy of the layout instance used for laying out the connected components is set on this layout instance.
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.copy()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 void detach()
detach.
detach in class IlvGraphLayoutdetach()
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 - in the following cases:
getBus()).getCalcLayoutRegion().width > 2*getMargin() + 2*getMarginOnBus()
IlvInappropriateLinkException - if the grapher contains links that
cannot be reshaped to a straight line and the link style is
STRAIGHT_LINE_STYLE.
(For details, see IlvInappropriateLinkException).IlvGraphLayout.performLayout(),
IlvGraphLayout.getCalcLayoutRegion(),
getMargin(),
getMarginOnBus()public final boolean supportsPreserveFixedNodes()
setPreserveFixedNodes(boolean) is called with a
true argument.
supportsPreserveFixedNodes in class IlvGraphLayouttrue.IlvGraphLayout.setPreserveFixedNodes(boolean),
IlvGraphLayout.isPreserveFixedNodes()public final boolean supportsLayoutRegion()
This layout uses the layout region to determine the vertical positioning of the upper level of the bus and the horizontal dimension of the levels of the bus. The height of the layout region is not used because it may need to be larger or smaller depending on the amount of space required for the drawing.
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 supportsLayoutOfConnectedComponents()
IlvGraphLayout.getLayoutOfConnectedComponents() to position the connected
components. By default, this layout is an instance of
IlvGridLayout
that can be customized as needed.
supportsLayoutOfConnectedComponents in class IlvGraphLayouttrue.IlvGraphLayout.getLayoutOfConnectedComponents(),
IlvGraphLayout.isLayoutOfConnectedComponentsEnabled(),
IlvGraphLayout.performLayout(boolean, boolean)public final boolean supportsAllowedTime()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in this case.
supportsAllowedTime in class IlvGraphLayouttrue.IlvGraphLayout.setAllowedTime(long),
IlvGraphLayout.getAllowedTime(),
IlvGraphLayoutReport.getCode()public final boolean supportsStopImmediately()
IlvGraphLayoutReport.STOPPED_AND_INVALID in this case.
supportsStopImmediately in class IlvGraphLayouttrue.IlvGraphLayout.stopImmediately(),
IlvGraphLayout.isStoppedImmediately()public final boolean supportsLinkConnectionBox()
The connection box interface is used only if link clipping is enabled
by setting a link clip interface and the link style is straight
line. In this case, the layout algorithm calculates the virtual center
of the end nodes of each link by the link connection box interface and
obtains the final connection points by clipping with the link clip
interface.
The virtual center is defined as the center of the connection box shifted
by the average of the tangential "top" and "bottom" offset in the
horizontal direction and the average of the tangential "left" and "right"
offset in the vertical direction.
For instance, if the tangential offset is 20 at the top side and 10 at
all other sides, the average shift offset is (20 + 10)/2 = 15
in the horizontal direction and (10 + 10)/2 = 10 in the
vertical direction; hence the virtual center is at
connectionBox.center() + (15, 10).
The bus node is never treated by the link clipping, because the
bus node usually has a special bus link connector (see IlvBusLinkConnector). Therefore, the link connection box does not affect
the bus node.
If no link clipping is performed, the layout algorithm does not actively place the end points of links. It relies on the link connectors that are attached to the nodes to find appropriate connection points for the links.
supportsLinkConnectionBox in class IlvGraphLayouttrue.IlvGraphLayout.setLinkConnectionBoxInterface(ilog.views.graphlayout.IlvLinkConnectionBoxInterface),
IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface),
IlvLinkConnector,
setLinkStyle(int),
setBus(ilog.views.IlvPolyPointsInterface),
supportsLinkClipping()public final boolean supportsLinkClipping()
The bus node is never treated by the link clipping because the
bus node usually has a special bus link connector (see IlvBusLinkConnector).
Link clipping is performed only if the link style is straight line. If no link clip interface is given, the layout algorithm does not actively place the end points of links. It relies on the link connectors that are attached to the nodes to find appropriate connection points for the links.
supportsLinkClipping in class IlvGraphLayouttrue.IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface),
IlvLinkConnector,
setLinkStyle(int),
setBus(ilog.views.IlvPolyPointsInterface),
supportsLinkConnectionBox()public final boolean supportsSaveParametersToNamedProperties()
supportsSaveParametersToNamedProperties in class IlvGraphLayouttrue.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout, boolean),
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout),
IlvGrapherAdapter.removeParametersFromNamedProperties()public void setBus(IlvPolyPointsInterface bus)
The number of points on the "polypoints" is not significant.
The methods IlvPolyPointsInterface.allowsPointInsertion() and
IlvPolyPointsInterface.allowsPointRemoval(),
defined in the class IlvPolyPointsInterface, must return
true.
Note that if the attached graph is an IlvGrapher
(or IlvGrapherAdapter), this method automatically
installs on the bus node the instance of the link connector returned
by the method makeLinkConnector().
Remark: It may be useful to restrict users from modifying the bus node.
If the bus node is an IlvPolyline contained in
an IlvGrapher, you can call the method IlvManager.setEditable(ilog.views.IlvGraphic, boolean)
on the grapher instance with a false parameter.
IllegalArgumentException - If bus is not a node in
the attached graph (the method IlvGraphModel.isNode(java.lang.Object) is called), or
the bus object does not allow point insertion and removal (the methods
IlvPolyPointsInterface.allowsPointInsertion() and
IlvPolyPointsInterface.allowsPointRemoval() are called on the
bus object).setBus(IlvPolyline).getBus()public IlvPolyPointsInterface getBus()
IlvGraphModel.isNode(java.lang.Object) is called), the method
automatically searches for a node that is an instance of
IlvPolyPointsInterface.
If none is found, the method returns null.
The method also returns null if the previously specified bus
object is null or is no longer a node in the attached
graph, or if no graph is attached.
IlvPolyline getBus().setBus(ilog.views.IlvPolyPointsInterface)
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.
setIndex(IlvGraphic, int).getIndex(java.lang.Object)public int getIndex(Object node)
NO_INDEX if
node has no index.
getIndex(IlvGraphic).setIndex(java.lang.Object, int)public IlvBusLinkConnector getLinkConnector()
Returns null if the attached graph is not an
IlvGrapherAdapter or IlvGrapher.
makeLinkConnector()protected IlvBusLinkConnector makeLinkConnector()
The default implementation
returns a new instance of IlvBusLinkConnector. This method
can be overridden to create subclasses of IlvBusLinkConnector.
If the overridden method returns null, no link connector
is installed on the bus node.
Note that the method is called only when the attached graph is
an IlvGrapherAdapter or an IlvGrapher.
getLinkConnector()
public IlvPoint getConnectionPoint(Object link,
IlvPolyPointsInterface bus)
link on the bus node.
This method is provided to obtain the connection
points of the links on the bus node in case the attached graph model
does not encapsulate an IlvGrapher. If the attached graph
model encapsulates an IlvGrapher, the layout
of the connection points of the links are computed by the
class IlvBusLinkConnector and this method is not used.
This method should be used only after having performed the layout, that is, after the bus node has been reshaped. Also, the method should be called only for links that have the bus object as the origin or destination node and are not self-links (same origin and destination nodes).
IlvBusLinkConnector,
setConnectionOnBusMargin(float),
getConnectionOnBusMargin()public final void setFlowDirection(int direction)
LEFT_TO_RIGHT -
The nodes "flow" from left to right on all the levels of the bus.ALTERNATE -
The nodes "flow" from left to right on the odd bus levels (first, third,
fifth, and so on) and from right to left on the even bus levels (second,
fourth, sixth, and so on). The levels are numbered from the top.
The default is LEFT_TO_RIGHT.
getFlowDirection()public int getFlowDirection()
setFlowDirection(int)public final void setOrdering(int ordering)
setNodeComparator(java.util.Comparator) instead.
NO_ORDERING -
The nodes are ordered in an arbitrary way.ORDER_BY_HEIGHT -
The nodes are ordered in the descending order of their height.ORDER_BY_INDEX -
The nodes are ordered in the ascending order of their index
(see setIndex(java.lang.Object, int)).NO_ORDERING.
Note that in incremental mode (see setIncrementalMode(boolean)) and
with fixed nodes (see IlvGraphLayout.setFixed(java.lang.Object, boolean)),
the order of the nodes is not completely preserved.
getOrdering(),
setNodeComparator(java.util.Comparator)public int getOrdering()
getNodeComparator() instead.
setOrdering(int)public final void setNodeComparator(Comparator comparator)
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 index
(see setIndex(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.
<