|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.layout.controller.LayoutController
com.tensegrity.graph.layout.controller.GraphLayoutController
com.tensegrity.graph.layout.controller.WorkflowLayoutController
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.
| 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 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int LINK_DIRECTED
public static final int LINK_LOOP
public static final int RightToLeft
public static final int LeftToRight
public static final int BottomToTop
public static final int TopToBottom
| Constructor Detail |
public WorkflowLayoutController()
WorkflowLayoutController instance.
| Method Detail |
public boolean isVertical()
true if the vertical arrangement is set.public void setVertical(boolean verticalArrangement)
verticalArrangement - true for vertical arrangement or false for
horizontal arrangement of graphpublic void centerToPort(boolean centertoport)
centertoport - true to center to portspublic boolean isCenteredToPort()
True if nodes are to center to the middle of
their bounding box or to their port.public int getEdgeForkLength()
EdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getEdgeForkLengthExpression()
public void setEdgeForkLength(int length)
length.
length - the new value for the edge-fork-lengthEdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setEdgeForkLength(java.lang.String length)
throws MetricExpressionParserException
length.
The given string must contain a valid metric-expression otherwise an
exception is thrown.
length - The new value for the edge-fork-length
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setEdgeForkLength(MetricExpression length)
length.
The given instance of MetricExpression is deep-copied.
length - length the new value for the edge-fork-lengthpublic int getEdgeForkOffset()
EdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getEdgeForkOffsetExpression()
public void setEdgeForkOffset(int offset)
length.
offset - the new value for the edge-fork-offsetEdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setEdgeForkOffset(java.lang.String offset)
throws MetricExpressionParserException
offset.
The given string must contain a valid metric-expression otherwise an
exception is thrown.
offset - offset the new value for the edge-fork-offset
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setEdgeForkOffset(MetricExpression offset)
offset.
The given instance of MetricExpression is deep-copied.
offset - offset the new value for the edge-fork-offsetpublic int getParallelEdgeDistance()
EdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getParallelEdgeDistanceExpression()
public void setParallelEdgeDistance(int distance)
distance.
distance - the new value for the parallel-edge-distanceEdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setParallelEdgeDistance(java.lang.String distance)
throws MetricExpressionParserException
distance. The given string must contain a valid
metric-expression otherwise an exception is thrown.
distance - distance the new value for the parallel-edge-distance
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setParallelEdgeDistance(MetricExpression distance)
distance. The given instance of
MetricExpression is deep-copied.
distance - distance the new value for the parallel-edge-distancepublic int getEdgeBendRounding()
EdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getEdgeBendRoundingExpression()
public void setEdgeBendRounding(int rounding)
rounding.
rounding - the new value for the edge-bend-roundingEdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setEdgeBendRounding(java.lang.String rounding)
throws MetricExpressionParserException
rounding.
The given string must contain a valid metric-expression otherwise an
exception is thrown.
rounding - rounding the new value for the edge-bend-rounding
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setEdgeBendRounding(MetricExpression rounding)
rounding.
The given instance of MetricExpression is deep-copied.
rounding - rounding the new value for the edge-bend-roundingpublic int getNodeDistance()
EdgeLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getNodeDistanceExpression()
public void setNodeDistance(int distance)
distance.
distance - the new value for the node-distanceHierarchicalLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setNodeDistance(java.lang.String distance)
throws MetricExpressionParserException
distance.
The given string must contain a valid metric-expression otherwise an
exception is thrown.
distance - distance the new value for the node-distance
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setNodeDistance(MetricExpression distance)
distance.
The given instance of MetricExpression is deep-copied.
distance - distance the new value for the node-distancepublic int getLayerDistanceFirstLast()
HierarchicalLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getLayerDistanceFirstLastExpression()
public void setLayerDistanceFirstLast(int distance)
distance.
distance - the new layer distance for the first and last layerHierarchicalLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setLayerDistanceFirstLast(java.lang.String distance)
throws MetricExpressionParserException
distance. The given string must contain a valid
metric-expression otherwise an exception is thrown.
distance - distance the new value for the distance of the first and
the last layer
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setLayerDistanceFirstLast(MetricExpression distance)
distance. The given instance of
MetricExpression is deep-copied.
distance - distance the new value for the distance of the first and
the last layerpublic int getLayerDistance()
HierarchicalLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metricpublic MetricExpression getLayerDistanceExpression()
public void setLayerDistance(int distance)
distance.
distance - the new value for the layer-distanceHierarchicalLayoutConstants,
CoordinateSystemMetric,
com.tensegrity.generic.unit.metric.Metric
public void setLayerDistance(java.lang.String distance)
throws MetricExpressionParserException
distance.
The given string must contain a valid metric-expression otherwise an
exception is thrown.
distance - distance the new value for the layer-distance
MetricExpressionParserException - when the given string does not
contain a valid metric-expression.public void setLayerDistance(MetricExpression distance)
distance.
The given instance of MetricExpression is deep-copied.
distance - distance the new value for the layer-distance
public void setNodeOrder(VisualNode node,
int order)
node - the nodes of which the order is to be setorder - the order the node on the according layer.
public void setChildrenAlignment(VisualNode node,
int alignment)
node - the nodes of which the children alignment is to be setalignment - the alignment for the child-nodes.
The possible values are:
public int getDirection()
WorkflowLayoutController.
public void setDirection(int direction)
direction.
direction - the current directionpublic boolean isLoop(LayoutableEdge edge)
edge - LayoutableEdge which type is to determine.
true if the link is a loop.
public void setLoop(LayoutableEdge edge,
boolean loop)
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.
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.public void setJustSwitched(boolean justSwitched)
true.
justSwitched - boolean to indicate when the layout orientation was
switched.public boolean isRootFixed()
public void setRootFixed(boolean pinRoot)
pinRoot - The pinRoot to set.protected void init()
LayoutControllerLayout and
define the according layout-contexts.
init in class GraphLayoutControllerpublic boolean apply()
LayoutControllerVisualGraphObjectContainer 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.
LayoutController.getLayoutDomain()
for more information.
apply in class LayoutControllertrue if the function was successful;
otherwise false, in which case the method LayoutController.getErrorMessage()
could be used to obtain details about the error.LayoutController.setVisualGraphObjectContainer(VisualGraphObjectContainer),
LayoutController.setNodeLayoutContext(String),
LayoutController.setEdgeLayoutContext(String),
LayoutController.apply(List, String, String),
LayoutController.apply(String),
LayoutController.getLayoutDomain()protected void onEndVisualSubgraphLayout(VisualSubgraph visualsubgraph)
LayoutControllerVisualSubgraph has
completed.
onEndVisualSubgraphLayout in class GraphLayoutControllerprotected void onLayoutSubgraph(VisualSubgraph visualsubgraph)
LayoutControllerLayoutController.apply() for each
subgraph for which a layout is to be performed.
onLayoutSubgraph in class GraphLayoutControllerpublic LayoutController deepCopy(VisualGraphObjectContainer visualgraphview)
VisualGraphObjectContainer.
deepCopy in class GraphLayoutControllervisualgraphview - the VisualGraphObjectContainer the copy is
to be associated with.
public void registerBranch(WorkflowLayoutController.BranchInfo info)
public void registerSequence(WorkflowLayoutController.SequenceInfo info)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||