y.layout.organic
Class SmartOrganicLayouter

java.lang.Object
  |
  +--y.layout.CanonicMultiStageLayouter
        |
        +--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 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
static byte SCOPE_ALL
          scope constant - used for layouting all nodes
static byte SCOPE_MAINLY_SUBSET
          scope constant - used for layouting mainly the subset of the nodes
static byte SCOPE_SUBSET
          scope constant - used for layouting the subset of the 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 instance of SmartOrganicLayouter
 
Method Summary
protected  boolean canLayoutCore(LayoutGraph graph)
          Subclasses have to provide information whether or not they can layout the given graph.
protected  void doLayoutCore(LayoutGraph graph)
          Subclasses have to provide core layout code in this method.
 double getCompactness()
          Getter for property compactness.
 long getMaximumDuration()
          Getter for property maximumDuration.
 double getMinimalNodeDistance()
          Getter for property minimalNodeDistance.
 double getPreferredEdgeLength()
          Getter for property preferredEdgeLength.
 double getPreferredMinimalNodeDistance()
          Getter for property preferredMinimalNodeDistance.
 double getQualityTimeRatio()
          Getter for property qualityTimeRatio.
 byte getScope()
          Getter for property scope.
 boolean isDeterministic()
          Getter for property deterministic.
 boolean isNodeOverlapsAllowed()
          Getter for property nodeOverlapsAllowed.
 boolean isNodeSizeAware()
          Getter for property nodeSizeAware.
 void setCompactness(double compactness)
          Setter for property compactness.
 void setDeterministic(boolean deterministic)
          Setter for property deterministic.
 void setMaximumDuration(long maximumDurationMillis)
          Setter for property maximumDuration.
 void setMinimalNodeDistance(double minimalNodeDistance)
          Setter for property minimalNodeDistance.
 void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
          Setter for property nodeOverlapsAllowed.
 void setNodeSizeAware(boolean nodeSizeAware)
          Setter for property nodeSizeAware.
 void setPreferredEdgeLength(double preferredEdgeLength)
          Setter for property preferredEdgeLength.
 void setPreferredMinimalNodeDistance(double preferredMinimalNodeDistance)
          Setter for property preferredMinimalNodeDistance.
 void setQualityTimeRatio(double qualityTimeRatio)
          Setter for property qualityTimeRatio.
 void setScope(byte scope)
          Setter for property scope.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, doLayout, 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 layouting all nodes

See Also:
Constant Field Values

SCOPE_SUBSET

public static final byte SCOPE_SUBSET
scope constant - used for layouting the subset of the nodes only

See Also:
Constant Field Values

SCOPE_MAINLY_SUBSET

public static final byte SCOPE_MAINLY_SUBSET
scope constant - used for layouting mainly the subset of the nodes

See Also:
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


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

Constructor Detail

SmartOrganicLayouter

public SmartOrganicLayouter()
Creates a new instance of SmartOrganicLayouter

Method Detail

canLayoutCore

protected boolean canLayoutCore(LayoutGraph graph)
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)
Subclasses have to provide core layout code in this method.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter

getQualityTimeRatio

public double getQualityTimeRatio()
Getter for property qualityTimeRatio. This setting determines the ratio of layout quality versus time consumption.

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

setQualityTimeRatio

public void setQualityTimeRatio(double qualityTimeRatio)
Setter for property qualityTimeRatio. This setting determines the ratio of layout quality versus time consumption.

Parameters:
qualityTimeRatio - a value between 0.0 (low quality, fast) and 1.0 (high quality, slow)

getMaximumDuration

public long getMaximumDuration()
Getter for property maximumDuration.

Returns:
Value of property maximumDuration.

setMaximumDuration

public void setMaximumDuration(long maximumDurationMillis)
Setter for property maximumDuration.

Parameters:
maximumDurationMillis - New value of property maximumDuration.

getScope

public byte getScope()
Getter for property scope.

Returns:
Value of property scope.

setScope

public void setScope(byte scope)
Setter for property scope.

Parameters:
scope - New value of property scope.

getCompactness

public double getCompactness()
Getter for property compactness.

Returns:
Value of property compactness.

setCompactness

public void setCompactness(double compactness)
Setter for property compactness.

Parameters:
compactness - New value of property compactness.

getPreferredEdgeLength

public double getPreferredEdgeLength()
Getter for property preferredEdgeLength.

Returns:
Value of property preferredEdgeLength.

setPreferredEdgeLength

public void setPreferredEdgeLength(double preferredEdgeLength)
Setter for property preferredEdgeLength.

Parameters:
preferredEdgeLength - New value of property preferredEdgeLength.

getPreferredMinimalNodeDistance

public double getPreferredMinimalNodeDistance()
Getter for property preferredMinimalNodeDistance.

Returns:
Value of property preferredMinimalNodeDistance.

setPreferredMinimalNodeDistance

public void setPreferredMinimalNodeDistance(double preferredMinimalNodeDistance)
Setter for property preferredMinimalNodeDistance.

Parameters:
preferredMinimalNodeDistance - New value of property preferredMinimalNodeDistance.

isNodeSizeAware

public boolean isNodeSizeAware()
Getter for property nodeSizeAware.

Returns:
Value of property nodeSizeAware.

setNodeSizeAware

public void setNodeSizeAware(boolean nodeSizeAware)
Setter for property nodeSizeAware.

Parameters:
nodeSizeAware - New value of property nodeSizeAware.

isDeterministic

public boolean isDeterministic()
Getter for property deterministic.

Returns:
Value of property deterministic.

setDeterministic

public void setDeterministic(boolean deterministic)
Setter for property deterministic.

Parameters:
deterministic - New value of property deterministic.

getMinimalNodeDistance

public double getMinimalNodeDistance()
Getter for property minimalNodeDistance.

Returns:
Value of property minimalNodeDistance.

setMinimalNodeDistance

public void setMinimalNodeDistance(double minimalNodeDistance)
Setter for property minimalNodeDistance.

Parameters:
minimalNodeDistance - New value of property minimalNodeDistance.

isNodeOverlapsAllowed

public boolean isNodeOverlapsAllowed()
Getter for property nodeOverlapsAllowed.

Returns:
Value of property nodeOverlapsAllowed.

setNodeOverlapsAllowed

public void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
Setter for property nodeOverlapsAllowed.

Parameters:
nodeOverlapsAllowed - New value of property nodeOverlapsAllowed.

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

2003