Search this API

y.layout.organic
Class SmartOrganicLayouter

java.lang.Object
  extended by y.layout.CanonicMultiStageLayouter
      extended by y.layout.organic.SmartOrganicLayouter
All Implemented Interfaces:
Layouter

public class SmartOrganicLayouter
extends CanonicMultiStageLayouter

This class can be used as a convenience class to gain access to a variety of organic layout algorithms. Its strength lies in being able to conveniently specify a ratio between quality and running time, as well as the ability to specify the degree of the compactness of the drawing and to guarantee non-overlapping nodes.


Field Summary
static Object GROUP_NODE_MODE_DATA
          The data provider key for specifying how to handle group nodes.
static Object GROUP_NODE_MODE_FIX_BOUNDS
          Group node mode constant that can be used to tag a group node.
static Object GROUP_NODE_MODE_FIX_CONTENTS
          Group node mode constant that can be used to tag a group node.
static Object GROUP_NODE_MODE_NORMAL
          Group node mode constant that can be used to tag a group node.
static Object NODE_SUBSET_DATA
          The data provider key for specifying the node subset to be laid out.
static Object PREFERRED_EDGE_LENGTH_DATA
          The data provider key for specifying the preferred edge lengths for each edge The algorithm expects to find DataProvider.getInt(Object) integer values associated with each edge.
static byte SCOPE_ALL
          Scope constant - used for laying out all nodes.
static byte SCOPE_MAINLY_SUBSET
          Scope constant - used for laying out mainly the subset of the nodes.
static byte SCOPE_SUBSET
          Scope constant - used for laying out the subset of nodes only.
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SmartOrganicLayouter()
          Creates a new SmartOrganicLayouter instance
 
Method Summary
protected  boolean canLayoutCore(LayoutGraph graph)
          Subclasses have to provide information whether or not they can layout the given graph.
protected  void configureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
          Configures the ComponentLayouter and graph instance to adhere to the NODE_SUBSET_DATA in case SCOPE_ALL is not set, and to use getMinimalNodeDistance() also for distances between components.
 void doLayout(LayoutGraph layoutGraph)
          Calculates a layout for the given graph.
protected  void doLayoutCore(LayoutGraph graph)
          Subclasses have to provide core layout code in this method.
 double getAutoClusteringQuality()
          Returns the quality ratio of the clustering algorithm.
 double getCompactness()
          Returns the property for the compactness of the resulting layout.
 GroupBoundsCalculator getGroupBoundsCalculator()
          Returns the GroupBoundsCalculator instance used for calculating the size of group nodes.
 double getGroupNodeCompactness()
          Returns the group node compactness factor.
 long getMaximumDuration()
          Returns the maximum duration this algorithm is allowed to run.
 double getMinimalNodeDistance()
          Returns the current minimal node distance this algorithm should enforce if the node overlaps allowance property is set to true.
 OutputRestriction getOutputRestriction()
          Returns the current OutputRestriction instance set for this instance.
 double getPreferredEdgeLength()
          Returns the currently set default preferred edge length.
 double getPreferredMinimalNodeDistance()
          Returns the current preferred minimal node distance this algorithm should use for pairs of nodes that are not directly connected by adjacent edges.
 double getQualityTimeRatio()
          Returns the quality to time ratio.
 byte getScope()
          Returns the scope of the layout.
 boolean isAutoClusteringEnabled()
          Returns whether or not a clustering algorithm should be applied.
 boolean isAutomaticGroupNodeCompactionEnabled()
          Returns whether or not the automatic group node compaction is used.
 boolean isConsiderNodeLabelsEnabled()
          Returns whether or not node labels are considered for the next layout run.
 boolean isDeterministic()
          Returns whether the algorithm will behave deterministically in the next layout run.
 boolean isNodeEdgeOverlapAvoided()
          Returns whether this algorithm is configured to try to avoid node/edge overlaps.
 boolean isNodeOverlapsAllowed()
          Returns whether node overlaps are allowed (but not encouraged) for the next run.
 boolean isNodeSizeAware()
          Determines whether the algorithm should consider the size of the nodes for the layout.
 boolean isSmartComponentLayoutEnabled()
          Determines whether this instance should configure the ComponentLayouter in such a way that it respects the scope's settings SCOPE_SUBSET and SCOPE_MAINLY_SUBSET by keeping other nodes pinned, even if they reside in different components.
 void setAutoClusteringEnabled(boolean autoClusteringEnabled)
          Specifies whether or not a clustering algorithm should be applied to the input graph.
 void setAutoClusteringQuality(double autoClusteringQuality)
          Specifies the quality measure of the clustering algorithm, if option setAutoClusteringEnabled(boolean) is enabled, Possible values are all doubles d with 0 <= d <= 1.
 void setAutomaticGroupNodeCompactionEnabled(boolean enabled)
          Specifies whether or not to use the automatic group node compaction.
 void setCompactness(double compactness)
          Sets the compactness property for the next layout run.
 void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
          Specifies whether or not to consider node labels for the next layout run.
 void setDeterministic(boolean deterministic)
          Sets this algorithm to deterministic mode.
 void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
          Sets the GroupBoundsCalculator instance used for calculating the size of group nodes.
 void setGroupNodeCompactness(double groupNodeCompactness)
          Sets the compactness of group nodes.
 void setMaximumDuration(long maximumDurationMillis)
          Sets the soft limit for the maximum duration this algorithm is allowed to execute.
 void setMinimalNodeDistance(double minimalNodeDistance)
          Sets the minimal node distance this algorithm should enforce between all pairs of nodes for the next run.
 void setNodeEdgeOverlapAvoided(boolean nodeEdgeOverlapAvoided)
          Specifies whether or not to try to avoid node/edge overlaps.
 void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
          Determines whether the next layout run should enforce non-overlapping nodes.
 void setNodeSizeAware(boolean nodeSizeAware)
          Specifies whether or not to consider node sizes for the next layout run.
 void setOutputRestriction(OutputRestriction restriction)
          Sets a restriction on the output generated by this layouter
 void setPreferredEdgeLength(double preferredEdgeLength)
          Sets the default preferred edge length for the next algorithm run.
 void setPreferredMinimalNodeDistance(double preferredMinimalNodeDistance)
          Sets the minimal node distance this algorithm should try to obey for the next run.
 void setQualityTimeRatio(double qualityTimeRatio)
          Specifies the quality to time ratio.
 void setScope(byte scope)
          Sets the scope for the next layout run.
 void setSmartComponentLayoutEnabled(boolean smartComponentLayoutEnabled)
          Sets whether this instance should configure the ComponentLayouter in such a way that it respects the scope's settings SCOPE_SUBSET and SCOPE_MAINLY_SUBSET by keeping other nodes pinned, even if they reside in different components.
protected  void unconfigureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
          Resets the ComponentLayouter from the previous configureComponentLayouter(y.layout.LayoutGraph,y.layout.ComponentLayouter) call.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, checkGroupNodeSize, checkNodeSize, doLayout, enableOnlyCore, getComponentLayouter, getGroupNodeHider, getLabelLayouter, getLayoutOrientation, getOrientationLayouter, getParallelEdgeLayouter, getSelfLoopLayouter, getSubgraphLayouter, isComponentLayouterEnabled, isGroupNodeHidingEnabled, isLabelLayouterEnabled, isOrientationLayouterEnabled, isParallelEdgeLayouterEnabled, isSelfLoopLayouterEnabled, isSubgraphLayouterEnabled, prependStage, removeStage, setComponentLayouter, setComponentLayouterEnabled, setGroupNodeHider, setGroupNodeHidingEnabled, setLabelLayouter, setLabelLayouterEnabled, setLayoutOrientation, setOrientationLayouter, setOrientationLayouterEnabled, setParallelEdgeLayouter, setParallelEdgeLayouterEnabled, setSelfLoopLayouter, setSelfLoopLayouterEnabled, setSubgraphLayouter, setSubgraphLayouterEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCOPE_ALL

public static final byte SCOPE_ALL
Scope constant - used for laying out all nodes.

See Also:
setScope(byte), Constant Field Values

SCOPE_SUBSET

public static final byte SCOPE_SUBSET
Scope constant - used for laying out the subset of nodes only. The above mentioned subset has to be specified by registering an appropriate DataProvider for key NODE_SUBSET_DATA.

See Also:
setScope(byte), Constant Field Values

SCOPE_MAINLY_SUBSET

public static final byte SCOPE_MAINLY_SUBSET
Scope constant - used for laying out mainly the subset of the nodes. The above mentioned subset has to be specified by registering an appropriate DataProvider for key NODE_SUBSET_DATA.

See Also:
setScope(byte), Constant Field Values

NODE_SUBSET_DATA

public static final Object NODE_SUBSET_DATA
The data provider key for specifying the node subset to be laid out. The algorithm expects for each node in the graph to find a boolean that indicates whether the node belongs to the "sphere of action".

See Also:
setScope(byte)

GROUP_NODE_MODE_DATA

public static final Object GROUP_NODE_MODE_DATA
The data provider key for specifying how to handle group nodes. The algorithm expects for each node to find one of the following constants or null: null will be treated like GROUP_NODE_MODE_NORMAL.


GROUP_NODE_MODE_NORMAL

public static final Object GROUP_NODE_MODE_NORMAL
Group node mode constant that can be used to tag a group node. Use the GROUP_NODE_MODE_DATA DataProvider key to associate this constant with a group node to indicate that it should be treated like an ordinary group node.


GROUP_NODE_MODE_FIX_BOUNDS

public static final Object GROUP_NODE_MODE_FIX_BOUNDS
Group node mode constant that can be used to tag a group node. Use the GROUP_NODE_MODE_DATA DataProvider key to associate this constant with a group node to indicate that its bounds should be treated as fixed an its contents should never exceed those bounds.


GROUP_NODE_MODE_FIX_CONTENTS

public static final Object GROUP_NODE_MODE_FIX_CONTENTS
Group node mode constant that can be used to tag a group node. Use the GROUP_NODE_MODE_DATA DataProvider key to associate this constant with a group node to indicate that it can be moved like an ordinary group node however its contents should remain fixed relative to the position of the group node. Note that this implicitly fixes all descendants of the group node.


PREFERRED_EDGE_LENGTH_DATA

public static final Object PREFERRED_EDGE_LENGTH_DATA
The data provider key for specifying the preferred edge lengths for each edge The algorithm expects to find DataProvider.getInt(Object) integer values associated with each edge.

Constructor Detail

SmartOrganicLayouter

public SmartOrganicLayouter()
Creates a new SmartOrganicLayouter instance

Method Detail

getGroupNodeCompactness

public double getGroupNodeCompactness()
Returns the group node compactness factor.
Note: the specified value is only considered if option setAutomaticGroupNodeCompactionEnabled(boolean) is disabled.

By default this value is 0.4.

See Also:
setGroupNodeCompactness(double), setAutomaticGroupNodeCompactionEnabled(boolean)

setGroupNodeCompactness

public void setGroupNodeCompactness(double groupNodeCompactness)
Sets the compactness of group nodes. Values should be in the range [0..1], where 0 results in group nodes not affecting the overall layout too much, whereas a value of 1 forces nodes in the same group to be clustered tightly.
Note: the specified value is only considered if option setAutomaticGroupNodeCompactionEnabled(boolean) is disabled.

By default this value is 0.4.

Throws:
IllegalArgumentException - if compactness value does not lie in [0..1]
Parameters:
groupNodeCompactness - the new value.
See Also:
setAutomaticGroupNodeCompactionEnabled(boolean)

isAutomaticGroupNodeCompactionEnabled

public boolean isAutomaticGroupNodeCompactionEnabled()
Returns whether or not the automatic group node compaction is used. If this option is enabled the group node compactness is determined automatically, i.e., it only depends on the general compactness specified by option setCompactness(double)). The value specified by option setGroupNodeCompactness(double) is ignored.

By default this option is enabled.

Returns:
true if the automatic group node compaction is used.
See Also:
setAutomaticGroupNodeCompactionEnabled(boolean), setGroupNodeCompactness(double), setCompactness(double)

setAutomaticGroupNodeCompactionEnabled

public void setAutomaticGroupNodeCompactionEnabled(boolean enabled)
Specifies whether or not to use the automatic group node compaction. If this option is enabled the group node compactness is determined automatically, i.e., it only depends on the general compactness specified by option setCompactness(double)). The value specified by option setGroupNodeCompactness(double) is ignored.

By default this option is enabled.

Parameters:
enabled - whether to use the automatic group node compaction.
See Also:
setGroupNodeCompactness(double), setCompactness(double)

isAutoClusteringEnabled

public boolean isAutoClusteringEnabled()
Returns whether or not a clustering algorithm should be applied.

By default, automatic clustering is not enabled.

See Also:
setAutoClusteringEnabled(boolean)

setAutoClusteringEnabled

public void setAutoClusteringEnabled(boolean autoClusteringEnabled)
Specifies whether or not a clustering algorithm should be applied to the input graph. If this option is enabled, the following steps are performed during the layout:
  1. a clustering algorithm is applied to the input graph.
  2. all nodes of the same cluster are put into a new group node.
  3. the common layout is applied to the modified graph.
  4. group nodes denoting clusters (inserted during step 2) are removed.
The user can also specify customized clusters by defining appropriate groups.

By default, automatic clustering is not enabled.

Note: the runtime of the clustering algorithm does not depend on the specified maximal duration (see method setMaximumDuration(long)).

Parameters:
autoClusteringEnabled - whether the clustering should be applied.

getAutoClusteringQuality

public double getAutoClusteringQuality()
Returns the quality ratio of the clustering algorithm.

See Also:
setAutoClusteringQuality(double)

setAutoClusteringQuality

public void setAutoClusteringQuality(double autoClusteringQuality)
Specifies the quality measure of the clustering algorithm, if option setAutoClusteringEnabled(boolean) is enabled, Possible values are all doubles d with 0 <= d <= 1. The higher d the higher the clustering quality. Default value is 1.

Note: the expected runtime of the clustering algorithm increases with d. The runtime does not depend on the specified maximal duration (see method setMaximumDuration(long)).

Parameters:
autoClusteringQuality - the quality ratio.

isConsiderNodeLabelsEnabled

public boolean isConsiderNodeLabelsEnabled()
Returns whether or not node labels are considered for the next layout run.

Default value is false.

Returns:
true, the labels of nodes are taken into account for the next layout run.
See Also:
setConsiderNodeLabelsEnabled(boolean)

setConsiderNodeLabelsEnabled

public void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
Specifies whether or not to consider node labels for the next layout run. Enabling this setting overrides the value of setNodeSizeAware(boolean), i.e. node sizes are always considered.

Default value is false.

Parameters:
considerNodeLabelsEnabled - if true, the labels of nodes are taken into account for the next layout run.
See Also:
isConsiderNodeLabelsEnabled()

getGroupBoundsCalculator

public GroupBoundsCalculator getGroupBoundsCalculator()
Returns the GroupBoundsCalculator instance used for calculating the size of group nodes. The default is MinimumSizeGroupBoundsCalculator.

Returns:
the instance being used currently

isSmartComponentLayoutEnabled

public boolean isSmartComponentLayoutEnabled()
Determines whether this instance should configure the ComponentLayouter in such a way that it respects the scope's settings SCOPE_SUBSET and SCOPE_MAINLY_SUBSET by keeping other nodes pinned, even if they reside in different components.

The default is false.

Returns:
Whether to configure the component layouter instance.
See Also:
isSmartComponentLayoutEnabled()

setSmartComponentLayoutEnabled

public void setSmartComponentLayoutEnabled(boolean smartComponentLayoutEnabled)
Sets whether this instance should configure the ComponentLayouter in such a way that it respects the scope's settings SCOPE_SUBSET and SCOPE_MAINLY_SUBSET by keeping other nodes pinned, even if they reside in different components.

The default is false.

See Also:
isSmartComponentLayoutEnabled()

setGroupBoundsCalculator

public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Sets the GroupBoundsCalculator instance used for calculating the size of group nodes. The default is MinimumSizeGroupBoundsCalculator.

Throws:
NullPointerException - if the argument is null
Parameters:
groupBoundsCalculator - the instance to use

isNodeEdgeOverlapAvoided

public boolean isNodeEdgeOverlapAvoided()
Returns whether this algorithm is configured to try to avoid node/edge overlaps.

By default, this option is not enabled.

Returns:
whether the option is enabled
See Also:
setNodeEdgeOverlapAvoided(boolean)

setNodeEdgeOverlapAvoided

public void setNodeEdgeOverlapAvoided(boolean nodeEdgeOverlapAvoided)
Specifies whether or not to try to avoid node/edge overlaps. The default is false. Note that the current implementation does not guarantee the non-existence of overlaps but tries to avoid them.

Parameters:
nodeEdgeOverlapAvoided - if true, the algorithm tries to avoid node/edge overlaps.

configureComponentLayouter

protected void configureComponentLayouter(LayoutGraph graph,
                                          ComponentLayouter layouter)
Configures the ComponentLayouter and graph instance to adhere to the NODE_SUBSET_DATA in case SCOPE_ALL is not set, and to use getMinimalNodeDistance() also for distances between components. This will result in the component layouter not rearranging components if they contain pinned-down nodes.

Parameters:
graph - the graph that will be arranged
layouter - the layouter to reconfigure
See Also:
unconfigureComponentLayouter(y.layout.LayoutGraph,y.layout.ComponentLayouter), setSmartComponentLayoutEnabled(boolean)

doLayout

public void doLayout(LayoutGraph layoutGraph)
Description copied from class: CanonicMultiStageLayouter
Calculates a layout for the given graph. The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph. This method is not side effect free in the sense that the order of edges or nodes in the input graph may change during the layout process.

Specified by:
doLayout in interface Layouter
Overrides:
doLayout in class CanonicMultiStageLayouter

unconfigureComponentLayouter

protected void unconfigureComponentLayouter(LayoutGraph graph,
                                            ComponentLayouter layouter)
Resets the ComponentLayouter from the previous configureComponentLayouter(y.layout.LayoutGraph,y.layout.ComponentLayouter) call.

Parameters:
graph - the graph that has been arranged
layouter - the layouter to reset.
See Also:
configureComponentLayouter(y.layout.LayoutGraph,y.layout.ComponentLayouter), setSmartComponentLayoutEnabled(boolean)

canLayoutCore

protected boolean canLayoutCore(LayoutGraph graph)
Description copied from class: CanonicMultiStageLayouter
Subclasses have to provide information whether or not they can layout the given graph.

Specified by:
canLayoutCore in class CanonicMultiStageLayouter

doLayoutCore

protected void doLayoutCore(LayoutGraph graph)
Description copied from class: CanonicMultiStageLayouter
Subclasses have to provide core layout code in this method.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter

getQualityTimeRatio

public double getQualityTimeRatio()
Returns the quality to time ratio. This setting determines the ratio of layout quality versus time consumption. The higher the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout.

The default value is 0.6.

Returns:
Value of property qualityTimeRatio [0.0d .. 1.0d]

setQualityTimeRatio

public void setQualityTimeRatio(double qualityTimeRatio)
Specifies the quality to time ratio. This setting determines the ratio of layout quality versus time consumption.

The default value is 0.6.

Throws:
IllegalArgumentException - if the specified ratio is less than 0 or greater than 1.
Parameters:
qualityTimeRatio - a value between 0.0 (low quality, fast) and 1.0 (high quality, slow)
See Also:
getQualityTimeRatio()

getMaximumDuration

public long getMaximumDuration()
Returns the maximum duration this algorithm is allowed to run. This is a soft limit

By default, the maximum duration is set to 30 seconds.

Returns:
the maximum duration in milliseconds

setMaximumDuration

public void setMaximumDuration(long maximumDurationMillis)
Sets the soft limit for the maximum duration this algorithm is allowed to execute.

By default, the maximum duration is set to 30 seconds.

Throws:
IllegalArgumentException - if the specified duration is less than 0.
Parameters:
maximumDurationMillis - the new soft limit for the duration in milliseconds

getScope

public byte getScope()
Returns the scope of the layout.

Returns:
the scope, one of SCOPE_ALL, SCOPE_SUBSET, or SCOPE_MAINLY_SUBSET
See Also:
setScope(byte)

setScope

public void setScope(byte scope)
Sets the scope for the next layout run. The scope determines which of the nodes should be affected and how they should be affected by the layout run.

Defaults to SCOPE_ALL.

Note: For all scopes but SCOPE_ALL, a data provider for key NODE_SUBSET_DATA has to be registered.

Parameters:
scope - the new scope, should be one of SCOPE_ALL, SCOPE_SUBSET, or SCOPE_MAINLY_SUBSET
See Also:
getScope(), NODE_SUBSET_DATA

getCompactness

public double getCompactness()
Returns the property for the compactness of the resulting layout. Lower values result in less compact drawings.

The default value is 0.5.

Returns:
a value indicating the resulting compactness in [0.0d .. 1.0d].

setCompactness

public void setCompactness(double compactness)
Sets the compactness property for the next layout run. Smaller values result in less compact drawings, greater values result in more compact drawings with 0.5d being a "normal" compactness.

The default value is 0.5.

Throws:
IllegalArgumentException - if the specified value is less than 0 or greater than 1.
Parameters:
compactness - the new compactness value [0.0d .. 1.0d]

getPreferredEdgeLength

public double getPreferredEdgeLength()
Returns the currently set default preferred edge length. The algorithm will try to find a drawing where most of the edges have this length. This default is applied to all edges where there is no specific edge length given using the double DataProvider instance bound to the graph using the PREFERRED_EDGE_LENGTH_DATA key.

Returns:
the preferred default length for edges

setPreferredEdgeLength

public void setPreferredEdgeLength(double preferredEdgeLength)
Sets the default preferred edge length for the next algorithm run.

Parameters:
preferredEdgeLength - the new default preferred edge length
See Also:
getPreferredEdgeLength()

getPreferredMinimalNodeDistance

public double getPreferredMinimalNodeDistance()
Returns the current preferred minimal node distance this algorithm should use for pairs of nodes that are not directly connected by adjacent edges.

Returns:
the preferred minimal distance

setPreferredMinimalNodeDistance

public void setPreferredMinimalNodeDistance(double preferredMinimalNodeDistance)
Sets the minimal node distance this algorithm should try to obey for the next run.

Parameters:
preferredMinimalNodeDistance - the new preferred minimal distance between two nodes that are not directly connected to each other

isNodeSizeAware

public boolean isNodeSizeAware()
Determines whether the algorithm should consider the size of the nodes for the layout. If set to true the algorithm will take the node size into account for given preferred edge lengths.

Returns:
whether node sizes are considered during the core layout

setNodeSizeAware

public void setNodeSizeAware(boolean nodeSizeAware)
Specifies whether or not to consider node sizes for the next layout run. These settings do not affect the hard minimal node distance property.

Parameters:
nodeSizeAware - if true, the sizes of nodes are taken into account for the next layout run.

isDeterministic

public boolean isDeterministic()
Returns whether the algorithm will behave deterministically in the next layout run.

Returns:
the current setting for the next layout run

setDeterministic

public void setDeterministic(boolean deterministic)
Sets this algorithm to deterministic mode. If set to true, the algorithm will yield the same results if given the exact same input and same settings.

Parameters:
deterministic - whether to operate in deterministic mode

getMinimalNodeDistance

public double getMinimalNodeDistance()
Returns the current minimal node distance this algorithm should enforce if the node overlaps allowance property is set to true.

The default value is 0.

Returns:
Value of property minimalNodeDistance.

setMinimalNodeDistance

public void setMinimalNodeDistance(double minimalNodeDistance)
Sets the minimal node distance this algorithm should enforce between all pairs of nodes for the next run.

The default value is 0.

Parameters:
minimalNodeDistance - the minimal distance between nodes that are not interconnected by a common edge
See Also:
setNodeOverlapsAllowed(boolean)

isNodeOverlapsAllowed

public boolean isNodeOverlapsAllowed()
Returns whether node overlaps are allowed (but not encouraged) for the next run.

By default, node overlaps are not allowed.

Note: if scope is set to SCOPE_SUBSET or SCOPE_MAINLY_SUBSET, there might be some overlapping nodes even if this option is set to false.

Returns:
whether node overlaps are allowed to exist after the layout run

setNodeOverlapsAllowed

public void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
Determines whether the next layout run should enforce non-overlapping nodes. The minimal distance between each pair of nodes is determined by the minimal node distance property.

By default, node overlaps are not allowed.

Note: if scope is set to SCOPE_SUBSET or SCOPE_MAINLY_SUBSET, there might be some overlapping nodes even if this option is set to false.

Parameters:
nodeOverlapsAllowed - whether to allow node overlaps
See Also:
setMinimalNodeDistance(double), setScope(byte)

setOutputRestriction

public void setOutputRestriction(OutputRestriction restriction)
Sets a restriction on the output generated by this layouter

Parameters:
restriction - the restriction to use
See Also:
OutputRestriction.NONE, OutputRestriction

getOutputRestriction

public OutputRestriction getOutputRestriction()
Returns the current OutputRestriction instance set for this instance. The default is OutputRestriction.NONE.

Returns:
an OutputRestriction

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.