com.tensegrity.graph.layout.controller
Class WorkflowLayoutController

java.lang.Object
  extended bycom.tensegrity.graph.layout.controller.LayoutController
      extended bycom.tensegrity.graph.layout.controller.GraphLayoutController
          extended bycom.tensegrity.graph.layout.controller.WorkflowLayoutController
All Implemented Interfaces:
Attributable, AttributableOnSet

public class WorkflowLayoutController
extends GraphLayoutController

Class WorkflowLayoutController provides the generic functionality that is needed in many workflow applications.

This class uses the HierarchicalLayout class to arrange the visual nodes and edges of a workflow. It encapsulates details that are necessary to properly use the hierarchical layout and provides a set of methods that are helpful for developing workflow applications.

Version:
$Id: WorkflowLayoutController.java,v 1.105 2006/02/01 10:47:44 MichaelKegel Exp $
Author:
Sharokh Khani

Nested Class Summary
static class WorkflowLayoutController.BranchInfo
          TODO: comment.
static class WorkflowLayoutController.SequenceInfo
          TODO: comment.
 
Field Summary
static int BottomToTop
          Layout direction specifier.
static int LeftToRight
          Layout direction specifier.
static int LINK_DIRECTED
          Edge type specifier.
static int LINK_LOOP
          Edge type specifier.
static int RightToLeft
          Layout direction specifier.
static int TopToBottom
          Layout direction specifier.
 
Fields inherited from class com.tensegrity.graph.layout.controller.GraphLayoutController
BunchedLinkLayout, Circular, DefaultLinkLayout, Energy, HierarchicalToBottom, HierarchicalToLeft, HierarchicalToRight, HierarchicalToTop, None, OrgChartBalanceCentered, OrgChartBalanceLeft, OrgChartBalanceRight, OrgChartListDouble, OrgChartListLeft, OrgChartListRight, RightAngleLinkLayout, SimpleLinkLayout, TreeHV, TreeLoop, TreePlan, TreeRadial
 
Fields inherited from class com.tensegrity.graph.layout.controller.LayoutController
ACTIVE, ACTIVE_EDGELAYOUT, ACTIVE_NODELAYOUT, animation, ANIMATION_TIME, animationDuration, ANIMATIONDURATION, ANIMATIONENABLED, ATTRIBUTENAME_EDGE_LAYOUT, ATTRIBUTENAME_GLOBAL_SETTINGS, ATTRIBUTENAME_LAYOUT_CONTEXT, ATTRIBUTENAME_LAYOUT_SETTING, ATTRIBUTENAME_NODE_LAYOUT, DEFAULTEDGELAYOUTCONTEXT, DEFAULTNODELAYOUTCONTEXT, DEPENDING_ON_LAYOUT_DIRECTION, DYNAMIC, DYNAMIC_PORT_REASSIGNMENT, dynamicEdgeLayout, DYNAMICEDGELAYOUT, dynamicNodeLayout, DYNAMICNODELAYOUT, EDGE_OPTIONS, edgeLayoutContext, ENABLE_ANIMATION, GLOBAL_CONFIGURATION, IGNORE_UNCONNECTED_NODES, INACTIVE, LAYOUT_DOMAIN, layoutDomain, LAYOUTDOMAIN_ALL, LAYOUTDOMAIN_CONSIDER_SELECTED_GROUPS, LAYOUTDOMAIN_SELECTION, LAYOUTDOMAIN_USED, LAYOUTDOMAIN_WHOLE, NODE_OPTIONS, nodeLayoutContext, observable, OTHER_OPTIONS, RELAYOUT_EDGES_ON_CHANGE, RELAYOUT_NODES_ON_CHANGE, SELECTED_GROUPS, state, strErrorMessage, visualGraphObjectContainer, visualGraphView, WHOLE_GRAPH
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Constructor Summary
WorkflowLayoutController()
          Constructs a new WorkflowLayoutController instance.
 
Method Summary
 boolean apply()
          This method applies a layout on the visual nodes and edges of the associated VisualGraphObjectContainer which should, together with an appropriate edge layout context and node layout context, be set in advance.
 void centerToPort(boolean centertoport)
          Determines whether nodes are to center to the middle of their bounding box or to their port.
 LayoutController deepCopy(VisualGraphObjectContainer visualgraphview)
          Creates a new independent layout-controller associated with the given VisualGraphObjectContainer.
 int getDirection()
          Returns a constant that indicates the current layout orientation of the WorkflowLayoutController.
 int getEdgeBendRounding()
          Deprecated. avoid to use this method. make use of #getEdgeBendRoundingExpression() instead.
 MetricExpression getEdgeBendRoundingExpression()
          Returns the current value of the edge-bend-rounding.
 int getEdgeForkLength()
          Deprecated. avoid to use this method. make use of #getEdgeForkLengthExpression() instead.
 MetricExpression getEdgeForkLengthExpression()
          Returns the current value of the edge-fork-length.
 int getEdgeForkOffset()
          Deprecated. avoid to use this method. make use of #getEdgeForkOffsetExpression() instead.
 MetricExpression getEdgeForkOffsetExpression()
          Returns the current value of the edge-fork-offset.
 int getLayerDistance()
          Deprecated. avoid to use this method. make use of #getLayerDistanceExpression() instead.
 MetricExpression getLayerDistanceExpression()
          Returns the current value of the distance for the first and the last layer in coordinate system units.
 int getLayerDistanceFirstLast()
          Deprecated. avoid to use this method. make use of #getLayerDistanceFirstLastExpression() instead.
 MetricExpression getLayerDistanceFirstLastExpression()
          Returns the current value of the distance for the first and the last layer in coordinate system units.
 int getNodeDistance()
          Deprecated. avoid to use this method. make use of #getNodeDistanceExpression() instead.
 MetricExpression getNodeDistanceExpression()
          Returns the current value of the node-distance.
 int getParallelEdgeDistance()
          Deprecated. avoid to use this method. make use of #getParallelEdgeDistanceExpression() instead.
 MetricExpression getParallelEdgeDistanceExpression()
          Returns the current value of the parallel-edge-distance.
protected  void init()
          This method must be overwritten by derived LayoutControllers.
 boolean isCenteredToPort()
          Returns whether nodes are to center to the middle of their bounding box or to their port.
 boolean isLoop(LayoutableEdge edge)
          Indicates whether the edge is being treated as loop or not.
 boolean isRootFixed()
          Indicates whether the root-node position is fixed or the top/left corner of the bounding box of grah.
 boolean isVertical()
          Indicates whether the vertical arrangement being used.
protected  void onEndVisualSubgraphLayout(VisualSubgraph visualsubgraph)
          Override this method with code that should be performed after layout on a VisualSubgraph has completed.
protected  void onLayoutSubgraph(VisualSubgraph visualsubgraph)
          This method will be called by LayoutController.apply() for each subgraph for which a layout is to be performed.
 void registerBranch(WorkflowLayoutController.BranchInfo info)
           
 void registerSequence(WorkflowLayoutController.SequenceInfo info)
           
 void setChildrenAlignment(VisualNode node, int alignment)
          Determines the relative position of a node to their successor nodes.
 void setDirection(int direction)
          Sets the layout direction to the value given by direction.
 void setEdgeBendRounding(int rounding)
          Deprecated. avoid to use this method. make use of #setEdgeBendRounding(String rounding) or #setEdgeBendRounding(MetricExpression rounding) instead.
 void setEdgeBendRounding(MetricExpression rounding)
          Sets the edge-bend-rounding to the value given by rounding.
 void setEdgeBendRounding(java.lang.String rounding)
          Sets the edge-bend-rounding to the value given by rounding.
 void setEdgeForkLength(int length)
          Deprecated. avoid to use this method. make use of #setEdgeForkLength(String length) or #setEdgeForkLength(MetricExpression length) instead.
 void setEdgeForkLength(MetricExpression length)
          Sets the edge-fork-length to the value given by length.
 void setEdgeForkLength(java.lang.String length)
          Sets the edge-fork-length to the value given by length.
 void setEdgeForkOffset(int offset)
          Deprecated. avoid to use this method. make use of #setEdgeForkOffset(String offset) or #setEdgeForkOffset(MetricExpression offset) instead.
 void setEdgeForkOffset(MetricExpression offset)
          Sets the edge-fork-offset to the value given by offset.
 void setEdgeForkOffset(java.lang.String offset)
          Sets the edge-fork-offset to the value given by offset.
 void setJustSwitched(boolean justSwitched)
          Indicates that the layout orientation was switched if the given boolean value is true.
 void setLayerDistance(int distance)
          Deprecated. avoid to use this method. make use of #setLayerDistance(String distance) or #setLayerDistance(MetricExpression distance) instead.
 void setLayerDistance(MetricExpression distance)
          Sets the layer-distance to the value given by distance.
 void setLayerDistance(java.lang.String distance)
          Sets the layer-distance to the value given by distance.
 void setLayerDistanceFirstLast(int distance)
          Deprecated. avoid to use this method. make use of #setLayerDistanceFirstLast(String distance) or #setLayerDistanceFirstLast(MetricExpression distance) instead.
 void setLayerDistanceFirstLast(MetricExpression distance)
          Sets the distance for the first and the last layer to the value given by distance.
 void setLayerDistanceFirstLast(java.lang.String distance)
          Sets the distance for the first and the last layer to the value given by distance.
 void setLoop(LayoutableEdge edge, boolean loop)
          Sets the type of the edge.
 void setNodeDistance(int distance)
          Deprecated. avoid to use this method. make use of #setNodeDistance(String distance) or #setNodeDistance(MetricExpression distance) instead.
 void setNodeDistance(MetricExpression distance)
          Sets the node-distance to the value given by distance.
 void setNodeDistance(java.lang.String distance)
          Sets the node-distance to the value given by distance.
 void setNodeOrder(VisualNode node, int order)
          Sets the order of a node within the according layer.
 void setParallelEdgeDistance(int distance)
          Deprecated. avoid to use this method. make use of #setParallelEdgeDistance(String distance) or #setParallelEdgeDistance(MetricExpression distance) instead.
 void setParallelEdgeDistance(MetricExpression distance)
          Sets the parallel-edge-distance to the value given by distance.
 void setParallelEdgeDistance(java.lang.String distance)
          Sets the parallel-edge-distance to the value given by distance.
 void setRootFixed(boolean pinRoot)
          Determines whether the root-node position is fixed or the top / left corner of the bounding box of graph.
 void setVertical(boolean verticalArrangement)
          Sets the vertical arrangement direction.
 
Methods inherited from class com.tensegrity.graph.layout.controller.GraphLayoutController
setDefaultLayerDistance, setDefaultNodeDistance
 
Methods inherited from class com.tensegrity.graph.layout.controller.LayoutController
addAttributableOnSetListener, addErrorMessage, addLayoutContext, addObserver, addProgressListener, apply, apply, apply, apply, applyDynamic, applyEdgeLayout, applyEdgeLayout, areAttributableEventsEnabled, considerCurrentEdgesRoute, deleteObserver, disableAttributableEvents, duplicateLayoutContext, enableAnimation, enableAttributableEvents, enableDynamicEdgeLayout, enableDynamicNodeLayout, error, getAnimateDuration, getAttribute, getAttributes, getAttributesTree, getAttributesTree, getAttributeType, getAttributeValue, getAutomaticPortReassignment, getAutomaticPortReassignmentDirectionDependent, getBaseLayoutEngine, getBaseLayouter, getConfiguration, getEdgeDefaultLayoutAttributes, getEdgeLayoutContext, getEdgeLayoutContextConstraint, getEdgeLayoutContextList, getEdgeLayouterList, getErrorMessage, getGraphPosition, getIgnoreIsolatedNodes, getLayoutAttribute, getLayoutAttributeSet, getLayoutContext, getLayoutContextList, getLayoutContextList, getLayoutDomain, getLayoutEdgesContextDepended, getLayoutReport, getLayoutService, getNodeDefaultLayoutAttributes, getNodeLayoutContext, getNodeLayoutContextConstraint, getNodeLayoutContextList, getNodeLayouterList, getPreviousEdgeLayoutAttributeMap, getPreviousEdgeLayoutContextMap, getPreviousNodeLayoutAttributeMap, getPreviousNodeLayoutContextMap, getState, getUsingLayoutContexts, getVisualGraphObjectContainer, isAnimationEnabled, isDynamicEdgeLayoutEnabled, isDynamicLayoutSupported, isDynamicNodeLayoutEnabled, isNodeLayoutContext, isRecursive, isValidLayoutContext, journalStartLayout, journalStopLayout, onBeginLayout, onBeginLoading, onBeginVisualSubgraphEdgeLayout, onBeginVisualSubgraphLayout, onEndLayout, onEndLoading, onEndVisualSubgraphEdgeLayout, onLayoutEdgeSubgraph, registerLayout, registerLayout, registerLayoutEngine, registerLayoutEngine, removeAttributableOnSetListener, removeLayoutContext, removeProgressListener, setAnimateDuration, setAttribute, setAttributes, setAttributesTree, setAttributesTree, setAttributeValue, setAutomaticPortReassignment, setAutomaticPortReassignmentDirectionDependent, setBorder, setChanged, setChanged, setConfiguration, setEdgeLayoutContext, setGraphPosition, setIgnoreIsolatedNodes, setLayoutAttribute, setLayoutAttributeSet, setLayoutContext, setLayoutDomain, setLayoutEdgesContextDepended, setLayoutService, setNodeLayoutContext, setVisualGraphObjectContainer, toString, updateLayoutAttributeSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINK_DIRECTED

public static final int LINK_DIRECTED
Edge type specifier. The link is a directed edge

See Also:
Constant Field Values

LINK_LOOP

public static final int LINK_LOOP
Edge type specifier. The link is a loop edge. The layout object uses the ports at the side of the nodes if it is possible.

See Also:
Constant Field Values

RightToLeft

public static final int RightToLeft
Layout direction specifier. Arranges graph right to left.

See Also:
Constant Field Values

LeftToRight

public static final int LeftToRight
Layout direction specifier. Arranges graph left to right.

See Also:
Constant Field Values

BottomToTop

public static final int BottomToTop
Layout direction specifier. Arranges graph bottom to top.

See Also:
Constant Field Values

TopToBottom

public static final int TopToBottom
Layout direction specifier. Arranges graph top to bottom.

See Also:
Constant Field Values
Constructor Detail

WorkflowLayoutController

public WorkflowLayoutController()
Constructs a new WorkflowLayoutController instance.

Method Detail

isVertical

public boolean isVertical()
Indicates whether the vertical arrangement being used.

Returns:
true if the vertical arrangement is set.

setVertical

public void setVertical(boolean verticalArrangement)
Sets the vertical arrangement direction.

Parameters:
verticalArrangement - true for vertical arrangement or false for horizontal arrangement of graph

centerToPort

public void centerToPort(boolean centertoport)
Determines whether nodes are to center to the middle of their bounding box or to their port.

Parameters:
centertoport - true to center to ports

isCenteredToPort

public boolean isCenteredToPort()
Returns whether nodes are to center to the middle of their bounding box or to their port.

Returns:
True if nodes are to center to the middle of their bounding box or to their port.

getEdgeForkLength

public int getEdgeForkLength()
Deprecated. avoid to use this method. make use of #getEdgeForkLengthExpression() instead.

Returns the current edge-fork-length in coordinate system units.

Returns:
int the current edge-fork-length
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getEdgeForkLengthExpression

public MetricExpression getEdgeForkLengthExpression()
Returns the current value of the edge-fork-length.

Returns:
MetricExpression the current edge-fork-length value

setEdgeForkLength

public void setEdgeForkLength(int length)
Deprecated. avoid to use this method. make use of #setEdgeForkLength(String length) or #setEdgeForkLength(MetricExpression length) instead.

Sets the edge-fork-length to the value given by length.
Notice:The edge-fork-length value should be given in coordinate system units

Parameters:
length - the new value for the edge-fork-length
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setEdgeForkLength

public void setEdgeForkLength(java.lang.String length)
                       throws MetricExpressionParserException
Sets the edge-fork-length to the value given by length. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
length - The new value for the edge-fork-length
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setEdgeForkLength

public void setEdgeForkLength(MetricExpression length)
Sets the edge-fork-length to the value given by length. The given instance of MetricExpression is deep-copied.

Parameters:
length - length the new value for the edge-fork-length

getEdgeForkOffset

public int getEdgeForkOffset()
Deprecated. avoid to use this method. make use of #getEdgeForkOffsetExpression() instead.

Returns the current edge-fork-offset in coordinate system units.

Returns:
int the current edge-fork-offset
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getEdgeForkOffsetExpression

public MetricExpression getEdgeForkOffsetExpression()
Returns the current value of the edge-fork-offset.

Returns:
MetricExpression the current edge-fork-offset value

setEdgeForkOffset

public void setEdgeForkOffset(int offset)
Deprecated. avoid to use this method. make use of #setEdgeForkOffset(String offset) or #setEdgeForkOffset(MetricExpression offset) instead.

Sets the edge-fork-offset to the value given by length.
Notice:The edge-fork-offset value should be given in coordinate system units.

Parameters:
offset - the new value for the edge-fork-offset
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setEdgeForkOffset

public void setEdgeForkOffset(java.lang.String offset)
                       throws MetricExpressionParserException
Sets the edge-fork-offset to the value given by offset. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
offset - offset the new value for the edge-fork-offset
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setEdgeForkOffset

public void setEdgeForkOffset(MetricExpression offset)
Sets the edge-fork-offset to the value given by offset. The given instance of MetricExpression is deep-copied.

Parameters:
offset - offset the new value for the edge-fork-offset

getParallelEdgeDistance

public int getParallelEdgeDistance()
Deprecated. avoid to use this method. make use of #getParallelEdgeDistanceExpression() instead.

Returns the current parallel-edge-distance in coordinate system units.

Returns:
int the current parallel-edge-distance
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getParallelEdgeDistanceExpression

public MetricExpression getParallelEdgeDistanceExpression()
Returns the current value of the parallel-edge-distance.

Returns:
MetricExpression the current parallel-edge-distance value

setParallelEdgeDistance

public void setParallelEdgeDistance(int distance)
Deprecated. avoid to use this method. make use of #setParallelEdgeDistance(String distance) or #setParallelEdgeDistance(MetricExpression distance) instead.

Sets the parallel-edge-distance to the value given by distance.
Notice:The parallel-edge-distance value should be given in coordinate system units.

Parameters:
distance - the new value for the parallel-edge-distance
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setParallelEdgeDistance

public void setParallelEdgeDistance(java.lang.String distance)
                             throws MetricExpressionParserException
Sets the parallel-edge-distance to the value given by distance. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
distance - distance the new value for the parallel-edge-distance
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setParallelEdgeDistance

public void setParallelEdgeDistance(MetricExpression distance)
Sets the parallel-edge-distance to the value given by distance. The given instance of MetricExpression is deep-copied.

Parameters:
distance - distance the new value for the parallel-edge-distance

getEdgeBendRounding

public int getEdgeBendRounding()
Deprecated. avoid to use this method. make use of #getEdgeBendRoundingExpression() instead.

Returns the current edge-bend-rounding value in coordinate system units.

Returns:
int the current edge-bend-rounding value
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getEdgeBendRoundingExpression

public MetricExpression getEdgeBendRoundingExpression()
Returns the current value of the edge-bend-rounding.

Returns:
MetricExpression the current edge-bend-rounding value

setEdgeBendRounding

public void setEdgeBendRounding(int rounding)
Deprecated. avoid to use this method. make use of #setEdgeBendRounding(String rounding) or #setEdgeBendRounding(MetricExpression rounding) instead.

Sets the edge-bend-rounding value to the value given by rounding.
Notice:The edge-bend-rounding value should be given in coordinate system units.

Parameters:
rounding - the new value for the edge-bend-rounding
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setEdgeBendRounding

public void setEdgeBendRounding(java.lang.String rounding)
                         throws MetricExpressionParserException
Sets the edge-bend-rounding to the value given by rounding. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
rounding - rounding the new value for the edge-bend-rounding
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setEdgeBendRounding

public void setEdgeBendRounding(MetricExpression rounding)
Sets the edge-bend-rounding to the value given by rounding. The given instance of MetricExpression is deep-copied.

Parameters:
rounding - rounding the new value for the edge-bend-rounding

getNodeDistance

public int getNodeDistance()
Deprecated. avoid to use this method. make use of #getNodeDistanceExpression() instead.

Returns the current node-distance value in coordinate system units.

Returns:
int the current node-distance value
See Also:
EdgeLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getNodeDistanceExpression

public MetricExpression getNodeDistanceExpression()
Returns the current value of the node-distance.

Returns:
MetricExpression the current node-distance value

setNodeDistance

public void setNodeDistance(int distance)
Deprecated. avoid to use this method. make use of #setNodeDistance(String distance) or #setNodeDistance(MetricExpression distance) instead.

Sets the node-distance value to the value given by distance.
Notice:The node-distance value should be given in coordinate system units.

Parameters:
distance - the new value for the node-distance
See Also:
HierarchicalLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setNodeDistance

public void setNodeDistance(java.lang.String distance)
                     throws MetricExpressionParserException
Sets the node-distance to the value given by distance. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
distance - distance the new value for the node-distance
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setNodeDistance

public void setNodeDistance(MetricExpression distance)
Sets the node-distance to the value given by distance. The given instance of MetricExpression is deep-copied.

Parameters:
distance - distance the new value for the node-distance

getLayerDistanceFirstLast

public int getLayerDistanceFirstLast()
Deprecated. avoid to use this method. make use of #getLayerDistanceFirstLastExpression() instead.

Returns the current value for the distance of the first and the last layer in coordinate system units.

Returns:
the current value for the distance of the first and last layer
See Also:
HierarchicalLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getLayerDistanceFirstLastExpression

public MetricExpression getLayerDistanceFirstLastExpression()
Returns the current value of the distance for the first and the last layer in coordinate system units.

Returns:
MetricExpression the current distance of the first and the last layer

setLayerDistanceFirstLast

public void setLayerDistanceFirstLast(int distance)
Deprecated. avoid to use this method. make use of #setLayerDistanceFirstLast(String distance) or #setLayerDistanceFirstLast(MetricExpression distance) instead.

Sets the distance for the first and the last layer to the value given by distance.
Notice:The node-distance value should be given in coordinate system units.

Parameters:
distance - the new layer distance for the first and last layer
See Also:
HierarchicalLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setLayerDistanceFirstLast

public void setLayerDistanceFirstLast(java.lang.String distance)
                               throws MetricExpressionParserException
Sets the distance for the first and the last layer to the value given by distance. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
distance - distance the new value for the distance of the first and the last layer
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setLayerDistanceFirstLast

public void setLayerDistanceFirstLast(MetricExpression distance)
Sets the distance for the first and the last layer to the value given by distance. The given instance of MetricExpression is deep-copied.

Parameters:
distance - distance the new value for the distance of the first and the last layer

getLayerDistance

public int getLayerDistance()
Deprecated. avoid to use this method. make use of #getLayerDistanceExpression() instead.

Returns the current layer-distance value in coordinate system units.

Returns:
int the current layer-distance value
See Also:
HierarchicalLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

getLayerDistanceExpression

public MetricExpression getLayerDistanceExpression()
Returns the current value of the distance for the first and the last layer in coordinate system units.

Returns:
MetricExpression the current distance of the first and the last layer

setLayerDistance

public void setLayerDistance(int distance)
Deprecated. avoid to use this method. make use of #setLayerDistance(String distance) or #setLayerDistance(MetricExpression distance) instead.

Sets the layer-distance value to the value given by distance.
Notice:The layer-distance value should be given in coordinate system units.

Parameters:
distance - the new value for the layer-distance
See Also:
HierarchicalLayoutConstants, CoordinateSystemMetric, com.tensegrity.generic.unit.metric.Metric

setLayerDistance

public void setLayerDistance(java.lang.String distance)
                      throws MetricExpressionParserException
Sets the layer-distance to the value given by distance. The given string must contain a valid metric-expression otherwise an exception is thrown.

Parameters:
distance - distance the new value for the layer-distance
Throws:
MetricExpressionParserException - when the given string does not contain a valid metric-expression.

setLayerDistance

public void setLayerDistance(MetricExpression distance)
Sets the layer-distance to the value given by distance. The given instance of MetricExpression is deep-copied.

Parameters:
distance - distance the new value for the layer-distance

setNodeOrder

public void setNodeOrder(VisualNode node,
                         int order)
Sets the order of a node within the according layer. This value will be ignored if the given order causes a crossing of edges which can be avoid by changing of nodes order.

Parameters:
node - the nodes of which the order is to be set
order - the order the node on the according layer.

setChildrenAlignment

public void setChildrenAlignment(VisualNode node,
                                 int alignment)
Determines the relative position of a node to their successor nodes.

Parameters:
node - the nodes of which the children alignment is to be set
alignment - the alignment for the child-nodes. The possible values are:

getDirection

public int getDirection()
Returns a constant that indicates the current layout orientation of the WorkflowLayoutController.

Returns:
int constant that represents the current layout orientation

setDirection

public void setDirection(int direction)
Sets the layout direction to the value given by direction.

Parameters:
direction - the current direction

isLoop

public boolean isLoop(LayoutableEdge edge)
Indicates whether the edge is being treated as loop or not.

Parameters:
edge - LayoutableEdge which type is to determine.
Returns:
true if the link is a loop.

setLoop

public void setLoop(LayoutableEdge edge,
                    boolean loop)
Sets the type of the edge. A Loop edge connects nodes without of effect of flow direction. The layout engine draw it in such a way that the purpose of them will be recognizable; otherwise the edges will simply connect nodes and effect their position. In this case the layout engine uses the shortest route.

Parameters:
edge - LayoutableEdge which type is to set. The layout engine uses the ports at the side of the nodes if it is possible.
loop - determines whether the edge is treated as loop or not.

setJustSwitched

public void setJustSwitched(boolean justSwitched)
Indicates that the layout orientation was switched if the given boolean value is true.

Parameters:
justSwitched - boolean to indicate when the layout orientation was switched.

isRootFixed

public boolean isRootFixed()
Indicates whether the root-node position is fixed or the top/left corner of the bounding box of grah.

Returns:
Returns the fixing point.

setRootFixed

public void setRootFixed(boolean pinRoot)
Determines whether the root-node position is fixed or the top / left corner of the bounding box of graph.

Parameters:
pinRoot - The pinRoot to set.

init

protected void init()
Description copied from class: LayoutController
This method must be overwritten by derived LayoutControllers. It should be used to register necessary Layout and define the according layout-contexts.

Overrides:
init in class GraphLayoutController

apply

public boolean apply()
Description copied from class: LayoutController
This method applies a layout on the visual nodes and edges of the associated VisualGraphObjectContainer which should, together with an appropriate edge layout context and node layout context, be set in advance. You can set the layout contexts for the main graph and nested subgraphs by invoking methods Layoutable.setNodeLayoutContext(String) and Layoutable.setEdgeLayoutContext(String) or the helper method pair LayoutController.setNodeLayoutContext(String) and LayoutController.setEdgeLayoutContext(String). This method processes subgraphs recursively in a post-order tree traversal. Please note that for a recursive layout, the algorithm is applied to all subgraphs before their parents. The methods LayoutController.onBeginVisualSubgraphLayout(VisualSubgraph) and LayoutController.onLayoutSubgraph(VisualSubgraph) will be triggered for each subgraph. The methods LayoutController.onBeginLayout() and LayoutController.onEndLayout() will be triggered before and after the main graph is arranged respectively.
Notice: The layout area is restricted according to the current layout domain. Please see LayoutController.getLayoutDomain() for more information.

Overrides:
apply in class LayoutController
Returns:
true if the function was successful; otherwise false, in which case the method LayoutController.getErrorMessage() could be used to obtain details about the error.
See Also:
LayoutController.setVisualGraphObjectContainer(VisualGraphObjectContainer), LayoutController.setNodeLayoutContext(String), LayoutController.setEdgeLayoutContext(String), LayoutController.apply(List, String, String), LayoutController.apply(String), LayoutController.getLayoutDomain()

onEndVisualSubgraphLayout

protected void onEndVisualSubgraphLayout(VisualSubgraph visualsubgraph)
Description copied from class: LayoutController
Override this method with code that should be performed after layout on a VisualSubgraph has completed.

Overrides:
onEndVisualSubgraphLayout in class GraphLayoutController

onLayoutSubgraph

protected void onLayoutSubgraph(VisualSubgraph visualsubgraph)
Description copied from class: LayoutController
This method will be called by LayoutController.apply() for each subgraph for which a layout is to be performed.

Overrides:
onLayoutSubgraph in class GraphLayoutController

deepCopy

public LayoutController deepCopy(VisualGraphObjectContainer visualgraphview)
Creates a new independent layout-controller associated with the given VisualGraphObjectContainer.

Overrides:
deepCopy in class GraphLayoutController
Parameters:
visualgraphview - the VisualGraphObjectContainer the copy is to be associated with.
Returns:
a deep-copy of the instance.

registerBranch

public void registerBranch(WorkflowLayoutController.BranchInfo info)

registerSequence

public void registerSequence(WorkflowLayoutController.SequenceInfo info)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.