public class IlvLinkLayoutRenderer extends IlvGraphLayoutRenderer
IlvLinkLayoutRenderer
is a subclass
of IlvGraphLayoutRenderer
that is specialized for
link layout.
It applies a layout algorithm that routes the links of the graph,
leaving the node positions unchanged.
The layout algorithm used can be either a normal link layout
with NodeSideFilter
enabled,
or a hierarchical layout configured to only route the links.
Normal link layouts are
IlvLinkLayout
,
IlvShortLinkLayout
, and
IlvLongLinkLayout
.
By default, an IlvLinkLayout
is used.
A hierarchical layout can only be used if a graph layout
renderer is installed that uses an instance of
IlvHierarchicalLayout
for graph layout. (The graph layout renderer can be either enabled or
disabled, see IlvGraphLayoutRenderer.setEnabled(boolean)
.)
In this case, this instance is reused but for the purpose of the link
layout renderer configured to only route the links. To use the hierarchical
layout, you must call setHierarchical(true)
.
The renderer defines two rendering properties on nodes and links
(in addition to any node and link properties defined by the layout algorithm
itself; see IlvGraphLayoutRenderer
for explanations):
NodeSideForOrigin
, which requests the layout algorithm
to attach the link to the specified side of the origin node.NodeSideForDestination
, which requests the layout algorithm
to attach the link to the specified side of the destination node.Top
, Bottom
,
Left
, Right
, Horizontal
,
Vertical
, or Any
(default). For example, a
specification for a link in the style sheet such as NodeSideForDestination:
Horizontal;
means the link should arrive at the left side or the
right side of the node. If the property is defined on a node, it holds
for any link that connects to this node. If the property is defined on
a link, it holds for any node to which the link is connected. If the
property is defined on both a link and the node to which the link is
connected, the property defined on the link is taken into account.
Note:
these properties are only effective for normal link layout algorithms.
If an IlvHierarchicalLayout
layout is used, you must use the
specific properties of this algorithm that control the way links are connected.
Examples of this are:
IlvHierarchicalLayout.setFromPortSide(java.lang.Object, int)
IlvHierarchicalLayout.setToPortSide(java.lang.Object, int)
Warning: Using the NodeSideFilter
constraints reduces
the degree of freedom of the layout to choose the link shapes. Using this
filter may create additional link bends and crossings.
Modifier and Type | Class and Description |
---|---|
static class |
IlvLinkLayoutRenderer.SDMRelativeLinkConnector
Deprecated.
Beginning with JViews 6.0 you should use
IlvSDMFreeLinkConnector instead, which has the same functionality. |
IlvGraphLayoutRenderer.DefaultGraphLayoutParametersProvider, IlvGraphLayoutRenderer.GraphLayoutParametersBean, IlvGraphLayoutRenderer.ParameterSetter
_renderer
PSEUDOCLASS_PREFIX
Constructor and Description |
---|
IlvLinkLayoutRenderer()
Creates a new layout renderer with a
null
filtered renderer. |
IlvLinkLayoutRenderer(IlvSDMRenderer renderer)
Creates a new layout renderer for a specified
filtered renderer.
|
Modifier and Type | Method and Description |
---|---|
Object[] |
getAuxiliaryBeans()
Returns an array containing the
IlvGraphLayout object
returned by IlvGraphLayoutRenderer.getGraphLayout() . |
boolean |
isAddingLinkConnectors()
Deprecated.
Since JViews 6.0, use
IlvGraphLayoutRenderer.isEnsureAppropriateLinks() . |
boolean |
isHierarchical()
Returns
true if this link layout renderer
is configured to use the same
hierarchical layout algorithm as the one used to
position the nodes of the graph. |
boolean |
isUseOldLinkRoutesInHierarchical()
Returns
true if this link layout renderer,
when using the hierarchical layout, keeps the old link routes
before starting the hierarchical layout. |
void |
performAutoLayout(Object layout,
Vector objects)
Implementation of the
IlvAutoLayoutHandler interface. |
void |
performLayout(IlvSDMEngine engine)
Performs the layout algorithm.
|
void |
prepareRendering(IlvSDMEngine engine)
Sets up the link layout algorithm so that it places link
connections on the sides of the link connection rectangle.
|
void |
setAddingLinkConnectors(boolean add)
Deprecated.
Since JViews 6.0, use
IlvGraphLayoutRenderer.setEnsureAppropriateLinks(boolean) . |
void |
setHierarchical(boolean hierarchical)
Configures this link layout renderer to use the same
hierarchical layout algorithm as the one used to
position the nodes of the graph.
|
void |
setUseOldLinkRoutesInHierarchical(boolean enable)
Sets whether this link layout renderer,
when using the hierarchical layout, keeps the old link routes
before starting the hierarchical layout.
|
addGraphLayoutRendererListener, addParameterSetter, addViewListeners, customize, getConstraintsURL, getGraphLayout, getGraphLayout, getGraphLayout, getLayoutProvider, getLayouts, getLinkConnectorMode, getLinkOrderingComparator, getNodeOrderingComparator, getParameter, getParametersMode, getParametersProvider, getRotationAngle, getRotationTransformer, isConnectingLinksToShape, isEnabled, isEnsureAppropriateLinks, isEnsureModelOrdering, isGraphLayoutExceptionPassedOn, isIncrementalLayout, isPartialLayout, isPerformingLayoutOnZoom, isSavingNodePositions, isUsePerObjectParameters, linkGraphicAdded, needsViewListeners, nodeGraphicAdded, nodeGraphicBBoxChanged, propertiesChanged, readConstraints, reloadConstraintsURL, removeAll, removeGraphLayoutRendererListener, removeParameterSetter, removeViewListeners, renderingDone, setConnectingLinksToShape, setConstraintsURL, setEnabled, setEnsureAppropriateLinks, setEnsureModelOrdering, setGraphLayout, setGraphLayoutExceptionPassedOn, setIncrementalLayout, setLinkConnectorMode, setLinkOrderingComparator, setNodeOrderingComparator, setParameter, setParametersMode, setParametersProvider, setPartialLayout, setPerformingLayoutOnZoom, setRotationAngle, setRotationTransformer, setSavingNodePositions, setUsePerObjectParameters, writeConstraints
addLinkGraphic, addNodeGraphic, computeBBox, createLinkGraphic, createNodeGraphic, getEncapsulatedGraphic, getFilteredRenderer, getGraphicProperty, getLinkConnectionRectangle, moveResizeNodeGraphic, processServerAction, removeLinkGraphic, removeNodeGraphic, setFilteredRenderer, updateObjectProperties
callMoveResizeNodeGraphic, convert, convert, getAlias, getAuxiliaryBean, getEngine, getLinkConnectionRectangle, getLocation, propertyChanged, setAlias, setEngine, setLayerName
public IlvLinkLayoutRenderer(IlvSDMRenderer renderer)
renderer
- The filtered renderer.public IlvLinkLayoutRenderer()
null
filtered renderer.public Object[] getAuxiliaryBeans()
IlvGraphLayout
object
returned by IlvGraphLayoutRenderer.getGraphLayout()
.
If the graph layout is IlvLinkLayout
, the sublayouts
of the IlvLinkLayout
returned by
IlvLinkLayout.getShortLinkLayout()
or
IlvLinkLayout.getLongLinkLayout()
are also contained in the array.getAuxiliaryBeans
in class IlvGraphLayoutRenderer
@Deprecated public boolean isAddingLinkConnectors()
IlvGraphLayoutRenderer.isEnsureAppropriateLinks()
.true
if a link connector is added
to the nodes to compute the link connection points.@Deprecated public void setAddingLinkConnectors(boolean add)
IlvGraphLayoutRenderer.setEnsureAppropriateLinks(boolean)
.add
- If true
, add link connectors.public void setHierarchical(boolean hierarchical)
Beginning with JViews 5.5, the IlvHierarchicalLayout
algorithm is able to only route the links of the graph, leaving
the positions of the node unchanged. This method lets you use
this feature easily. For example, here are the rules to put
in the style sheet to use the same hierarchical layout algorithm
for positioning the nodes and routing the links:
SDM { GraphLayout : "Hierarchical"; LinkLayout : "true"; } GraphLayout { flowDirection : "Bottom"; globalLinkStyle : "ORTHOGONAL_STYLE"; } LinkLayout { hierarchical : "true"; }
Notes:
IlvLinkLayout
).
globalLinkStyle
in the example shown) must still be set in the GraphLayout
rule of the style
sheet, even though the hierarchical graph layout object is also used by the LinkLayout renderer.
hierarchical
- If this parameter is true
,
and if no algorithm has been set explicitly by calling
IlvGraphLayoutRenderer.setGraphLayout(ilog.views.graphlayout.IlvGraphLayout)
, this renderer will use a hierarchical
layout algorithm to route the links of the graph. If a
graph layout renderer is attached to the same SDM engine and
configured to use a hierarchical layout algorithm, the
same hierarchical layout will be used by this renderer to
route the links. If this parameter is false
,
this renderer will use by default an IlvLinkLayout
algorithm.IlvHierarchicalLayout
,
IlvGraphLayoutRenderer
public boolean isHierarchical()
true
if this link layout renderer
is configured to use the same
hierarchical layout algorithm as the one used to
position the nodes of the graph.setHierarchical(boolean)
public void setUseOldLinkRoutesInHierarchical(boolean enable)
IlvHierarchicalLayout.setLongLinkCrossingReductionDuringIncremental(boolean)
is disabled, the hierarchical layout tries to respect the old link routes
for long links. In this case, it is useful to enable
the use of old link routes in hierarchical layout.
This mode has no effect when the hierarchical mode is disabled.
isUseOldLinkRoutesInHierarchical()
,
setHierarchical(boolean)
public boolean isUseOldLinkRoutesInHierarchical()
true
if this link layout renderer,
when using the hierarchical layout, keeps the old link routes
before starting the hierarchical layout. The result of the
new link routing depends on the layout parameters set for
the hierarchical layout.setUseOldLinkRoutesInHierarchical(boolean)
,
setHierarchical(boolean)
public void prepareRendering(IlvSDMEngine engine)
prepareRendering
in class IlvGraphLayoutRenderer
engine
- The SDM engine.IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer)
public void performLayout(IlvSDMEngine engine)
performLayout
in class IlvGraphLayoutRenderer
engine
- The SDM engine.public void performAutoLayout(Object layout, Vector objects)
IlvAutoLayoutHandler
interface.
Performs an automatic layout that was caused by a structural or
geometric change of some graphic objects.
performAutoLayout
in interface IlvAutoLayoutHandler
performAutoLayout
in class IlvGraphLayoutRenderer
layout
- The graph layout to be performed.objects
- The vector of graphic objects that caused the need for
layout. These objects were added, removed or have moved.
If null
is passed, the need for layout has
no specific reason (e.g., when all nodes and links have
moved).© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.