public class IlvRandomLayout extends IlvBasicLinkStyleLayout
This is the simplest layout algorithm. The nodes are moved at
randomly-computed positions inside a user-defined region which can be
specified using the method IlvGraphLayout.setLayoutRegion(IlvRect)
.
Sample drawing produced by the Random Layout algorithm:
See the corresponding chapter of the User Manual for details on the algorithm, the types of graphs for which this algorithm can be used, features and limitations, code samples, 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.
Modifier and Type | Field and Description |
---|---|
static int |
NO_RESHAPE_STYLE
No links reshape option.
|
static int |
STRAIGHT_LINE_STYLE
Straight-line links shape option.
|
ALL_CORNERS, BOTTOM_LEFT, BOTTOM_RIGHT, CENTERED, CLOCK_WISE, CONNECTED_ONE_BEND_BUNDLE, CONNECTED_RECTANGULAR, CONNECTED_SQUARE, COUNTER_CLOCK_WISE, FREE_ONE_BEND_BUNDLE, FREE_RECTANGULAR, FREE_SQUARE, HORIZONTAL_TO_VERTICAL, INNER, NARROW_CONNECTED_RECTANGULAR, NARROW_CONNECTED_SQUARE, NARROW_FREE_RECTANGULAR, NARROW_FREE_SQUARE, NARROW_STRAIGHT_LINE_BUNDLE, NO_BENDS, NO_BUNDLE, OUTER, STRAIGHT_LINE_BUNDLE, TOP_LEFT, TOP_RIGHT, VERTICAL_TO_HORIZONTAL
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvRandomLayout()
Creates a new instance of the Random Layout algorithm.
|
IlvRandomLayout(IlvRandomLayout source)
Creates a new layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
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
IlvRandomLayoutGrapherProperty that
stores the parameter settings of this layout class. |
protected int[] |
getPercentagesOfCompletion()
Returns an array of 4 integer numbers, denoting the percentage of
completion:
After collecting multilinks and self-links.
|
protected void |
init()
Initializes instance variables.
|
protected void |
internalLayout(boolean redraw)
Computes the layout using the Random Layout algorithm.
|
boolean |
supportsLayoutRegion()
Indicates that this layout class can control the size of the drawing
of the graph to fit (exactly or approximately) a user-defined region
(a rectangle) or a user-defined manager view.
|
boolean |
supportsRandomGenerator()
Indicates that this layout class uses randomly generated numbers that
can be initialized with a user-defined seed value.
|
checkAppropriateLink, checkAppropriateLinks, getLayoutCodeOnInterrupt, getLinkStyle, getMovingNodes, getMultiLinkMaxSpread, getMultiLinkMode, getMultiLinkOffset, getMultiLinksCount, getMultiSelfLinkDistribution, getMultiSelfLinkMaxSpread, getMultiSelfLinkOffset, getSelfLinkAbsoluteAttachPosition, getSelfLinkAllowedCorners, getSelfLinkMode, getSelfLinkOrientation, getSelfLinkRelativeAttachPosition, getSelfLinksCount, getSelfLinkSpacing, increasePercentageComplete, isConnectLinksToNodeCenters, isInterrupted, isSelfLinkConnectToNodeCenter, layout, setConnectLinksToNodeCenters, setLinkStyle, setMultiLinkMaxSpread, setMultiLinkMode, setMultiLinkOffset, setMultiSelfLinkDistribution, setMultiSelfLinkMaxSpread, setMultiSelfLinkOffset, setSelfLinkAbsoluteAttachPosition, setSelfLinkAllowedCorners, setSelfLinkConnectToNodeCenter, setSelfLinkMode, setSelfLinkOrientation, setSelfLinkRelativeAttachPosition, setSelfLinkSpacing, supportsAllowedTime, supportsLayoutOfConnectedComponents, supportsLinkClipping, supportsLinkConnectionBox, supportsPercentageComplete, supportsPreserveFixedLinks, supportsPreserveFixedNodes, supportsSaveParametersToNamedProperties, supportsStopImmediately
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, connectAllLinksToCenter, connectLinkToCenter, contentsChanged, createLayoutLinkProperty, createLayoutNodeProperty, createLayoutReport, detach, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, isAnimate, isAutoLayout, isFitToView, isFixed, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isLocalRecursiveLayoutNeeded, isMemorySavings, isParametersUpToDate, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAllowedTime, setAnimate, setAutoCheckAppropriateLinksEnabled, setAutoLayout, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setCoordinatesMode, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setInputCheckEnabled, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLayoutRunning, setLinkClipInterface, setLinkConnectionBoxInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately, supportsAnimation, supportsMemorySavings, supportsSplineRouting, unfixAllLinks, unfixAllNodes, useAnimateRedraw
public static final int STRAIGHT_LINE_STYLE
IlvBasicLinkStyleLayout.setLinkStyle(int)
, the links are given a straight-line shape.public static final int NO_RESHAPE_STYLE
IlvBasicLinkStyleLayout.setLinkStyle(int)
, the links are not reshaped.public IlvRandomLayout()
IlvGraphLayout.attach(IlvGrapher)
. IlvGraphLayout.attach(IlvGraphModel)
. IlvGraphLayout.performLayout()
. public IlvRandomLayout(IlvRandomLayout source)
copy()
method. Any subclass
should provide a copy constructor.
The parameters of the source
layout are copied using the
method copyParameters(IlvGraphLayout)
.
source
- The layout instance that is copied.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 IlvBasicLinkStyleLayout
public 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 link clip and link connection box interfaces, 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 IlvBasicLinkStyleLayout
copyParameters(IlvGraphLayout)
public 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.
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 IlvBasicLinkStyleLayout
source
- The layout instance from which the parameters are copied.copy()
protected void internalLayout(boolean redraw) throws IlvGraphLayoutException
IlvGraphLayout.performLayout()
.internalLayout
in class IlvBasicLinkStyleLayout
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
).IlvGraphLayoutException
IlvGraphLayout.performLayout()
protected int[] getPercentagesOfCompletion()
internalLayout(boolean)
. getPercentagesOfCompletion
in class IlvBasicLinkStyleLayout
IlvBasicLinkStyleLayout.supportsPercentageComplete()
,
IlvGraphLayoutReport.getPercentageComplete()
public final boolean supportsLayoutRegion()
supportsLayoutRegion
in class IlvGraphLayout
true
.IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView)
,
IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView, ilog.views.IlvRect)
,
IlvGraphLayout.setLayoutRegion(ilog.views.IlvRect)
,
IlvGraphLayout.getSpecLayoutRegion()
,
IlvGraphLayout.getCalcLayoutRegion()
,
IlvGraphLayout
public final boolean supportsRandomGenerator()
IlvGraphLayout.setUseSeedValueForRandomGenerator(boolean)
with a true
argument.supportsRandomGenerator
in class IlvGraphLayout
true
.IlvGraphLayout.setSeedValueForRandomGenerator(long)
,
IlvGraphLayout.getSeedValueForRandomGenerator()
,
IlvGraphLayout.setUseSeedValueForRandomGenerator(boolean)
,
IlvGraphLayout.isUseSeedValueForRandomGenerator()
protected IlvGraphLayoutGrapherProperty createLayoutGrapherProperty(String name, boolean withDefaults)
IlvRandomLayoutGrapherProperty
that
stores the parameter settings of this layout class.
The method is used by IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
to create a named property that contains parameter settings
of this layout instance.
createLayoutGrapherProperty
in class IlvBasicLinkStyleLayout
IlvGraphLayoutGrapherProperty
,
IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout, boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.