|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.CanonicMultiStageLayouter
public abstract class CanonicMultiStageLayouter
An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it is passed to the core layout routine itself.
Subclass layout algorithms have to provide implementations for the abstract methodsdoLayoutCore(LayoutGraph)
canLayoutCore(LayoutGraph)
The maximal number of steps involved before and after the core layout
will be invoked are summarized below.
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
CanonicMultiStageLayouter()
Constructs a new AbstractLayouter |
Method Summary | |
---|---|
void |
appendStage(LayoutStage stage)
Appends a stage to the layout pipeline. |
GraphLayout |
calcLayout(GraphInterface graph,
GraphLayout layout)
Returns a layout for the given graph interface and layout. |
GraphLayout |
calcLayout(LayoutGraph layoutGraph)
Returns a layout for the given layout graph. |
boolean |
canLayout(LayoutGraph graph)
Tests whether or not the given graph can be laid out by this layouter. |
protected abstract boolean |
canLayoutCore(LayoutGraph graph)
Subclasses have to provide information whether or not they can layout the given graph. |
protected void |
checkGroupNodeSize(GraphLayout layout,
Object node)
This method throws an IllegalArgumentException if the width/height of the given group node object is zero. |
protected void |
checkNodeSize(GraphLayout layout,
Object node)
This method throws an IllegalArgumentException if the width/height of the given node object is zero. |
void |
doLayout(GraphInterface graph,
GraphLayout layout)
Calculates a layout for the given graph interface and layout. |
void |
doLayout(LayoutGraph layoutGraph)
Calculates a layout for the given graph. |
protected abstract void |
doLayoutCore(LayoutGraph graph)
Subclasses have to provide core layout code in this method. |
void |
enableOnlyCore()
Disables all layout stages and performs only the core layouter. |
LayoutStage |
getComponentLayouter()
Returns the LayoutStage responsible for laying out the connected components of the graph. |
LayoutStage |
getGroupNodeHider()
Returns the LayoutStage that is responsible for
hiding away grouping information for the layout algorithm. |
LayoutStage |
getLabelLayouter()
Returns the algorithm used for placing labels. |
byte |
getLayoutOrientation()
Returns the main layout orientation. |
LayoutStage |
getOrientationLayouter()
Returns the LayoutStage that is responsible for changing the orientation of the computed layout. |
LayoutStage |
getParallelEdgeLayouter()
Returns the LayoutStage responsible for routing parallel edges. |
LayoutStage |
getSelfLoopLayouter()
Returns the LayoutStage used for routing Self-loops. |
LayoutStage |
getSubgraphLayouter()
Returns the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. |
boolean |
isComponentLayouterEnabled()
Returns whether or not ComponentLayouter is enabled. |
boolean |
isGroupNodeHidingEnabled()
Returns whether or not to hide away group nodes before the layout begins. |
boolean |
isLabelLayouterEnabled()
Returns whether or not LabelLayouter is enabled. |
boolean |
isOrientationLayouterEnabled()
Returns whether or not the OrientationLayouter is enabled. |
boolean |
isParallelEdgeLayouterEnabled()
Returns whether or not the ParallelEdgeLayouter is enabled. |
boolean |
isSelfLoopLayouterEnabled()
Returns whether or not the SelfLoopLayouter is enabled. |
boolean |
isSubgraphLayouterEnabled()
Returns whether or not the SubgraphLayouter is enabled. |
void |
prependStage(LayoutStage stage)
Prepends a stage to the layout pipeline. |
void |
removeStage(LayoutStage stage)
Removes a LayoutStage that has been previously added by the methods appendStage(LayoutStage) or prependStage(LayoutStage) . |
void |
setComponentLayouter(LayoutStage layouter)
Sets the LayoutStage responsible for laying out the connected components of the graph. |
void |
setComponentLayouterEnabled(boolean enabled)
Specifies whether or not to enable the ComponentLayouter. |
void |
setGroupNodeHider(LayoutStage layouter)
Sets the LayoutStage that is responsible for
hiding away grouping information for the layout algorithm. |
void |
setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
Specifies whether or not to hide away group nodes before the layout begins. |
void |
setLabelLayouter(LayoutStage labeler)
Sets the algorithm used for placing labels. |
void |
setLabelLayouterEnabled(boolean enabled)
Specifies whether or not to enable the labeling algorithm. |
void |
setLayoutOrientation(byte orientation)
Sets the main layout orientation. |
void |
setOrientationLayouter(LayoutStage layouter)
Sets the LayoutStage that is responsible for changing the orientation of the computed layout. |
void |
setOrientationLayouterEnabled(boolean enabled)
Specifies whether or not to enable the OrientationLayouter. |
void |
setParallelEdgeLayouter(LayoutStage layouter)
Sets the ParallelEdgeLayouter responsible for routing parallel edges. |
void |
setParallelEdgeLayouterEnabled(boolean enabled)
Specifies whether or not to enable the ParallelEdgeLayouter. |
void |
setSelfLoopLayouter(LayoutStage layouter)
Sets the LayoutStage responsible for routing Self-loops. |
void |
setSelfLoopLayouterEnabled(boolean enabled)
Specifies whether or not to enable the SelfLoopLayouter. |
void |
setSubgraphLayouter(LayoutStage layouter)
Sets the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. |
void |
setSubgraphLayouterEnabled(boolean enabled)
Specifies whether or not to enable the SubgraphLayouter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CanonicMultiStageLayouter()
Method Detail |
---|
protected abstract void doLayoutCore(LayoutGraph graph)
protected abstract boolean canLayoutCore(LayoutGraph graph)
protected void checkNodeSize(GraphLayout layout, Object node) throws IllegalArgumentException
IllegalArgumentException
if the width/height of the given node object is zero.
It is called by the doLayout(LayoutGraph)
method for each node object in the input graph.
IllegalArgumentException
- thrown if the width/height of the node object is zero.layout
- a graph layout object.node
- the node object to test.checkGroupNodeSize(GraphLayout,Object)
protected void checkGroupNodeSize(GraphLayout layout, Object node) throws IllegalArgumentException
IllegalArgumentException
if the width/height of the given group node object is zero.
It is called by the doLayout(LayoutGraph)
method for each group node object in the input graph.
IllegalArgumentException
- thrown if the width/height of the group node object is zero.layout
- a graph layout object.node
- the group node object to test.checkNodeSize(GraphLayout,Object)
public void prependStage(LayoutStage stage)
public void appendStage(LayoutStage stage)
public void removeStage(LayoutStage stage)
appendStage(LayoutStage)
or prependStage(LayoutStage)
.
public LayoutStage getLabelLayouter()
GreedyMISLabeling
will be returned.
public void setLabelLayouter(LayoutStage labeler)
setLabelLayouterEnabled(boolean)
.
public LayoutStage getSelfLoopLayouter()
SelfLoopLayouter
will be returned.
public void setSelfLoopLayouter(LayoutStage layouter)
public LayoutStage getParallelEdgeLayouter()
ParallelEdgeLayouter
will be returned.
public void setParallelEdgeLayouter(LayoutStage layouter)
public LayoutStage getComponentLayouter()
public void setComponentLayouter(LayoutStage layouter)
public LayoutStage getSubgraphLayouter()
public void setSubgraphLayouter(LayoutStage layouter)
public LayoutStage getGroupNodeHider()
LayoutStage
that is responsible for
hiding away grouping information for the layout algorithm.
public void setGroupNodeHider(LayoutStage layouter)
LayoutStage
that is responsible for
hiding away grouping information for the layout algorithm.
public LayoutStage getOrientationLayouter()
public void setOrientationLayouter(LayoutStage layouter)
public void setOrientationLayouterEnabled(boolean enabled)
public void setLayoutOrientation(byte orientation)
Note, the documentation for the other layout options assumes that the
default layout orientation LayoutOrientation.TOP_TO_BOTTOM
is
being used.
orientation
- one of
LayoutOrientation.BOTTOM_TO_TOP
,
LayoutOrientation.LEFT_TO_RIGHT
,
LayoutOrientation.TOP_TO_BOTTOM
or
LayoutOrientation.RIGHT_TO_LEFT
.getLayoutOrientation()
public byte getLayoutOrientation()
setLayoutOrientation(byte)
public boolean isOrientationLayouterEnabled()
public void setSelfLoopLayouterEnabled(boolean enabled)
public boolean isSelfLoopLayouterEnabled()
public void setLabelLayouterEnabled(boolean enabled)
public boolean isLabelLayouterEnabled()
public boolean isGroupNodeHidingEnabled()
public void setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
public void setComponentLayouterEnabled(boolean enabled)
public boolean isComponentLayouterEnabled()
public void setParallelEdgeLayouterEnabled(boolean enabled)
public boolean isParallelEdgeLayouterEnabled()
public void setSubgraphLayouterEnabled(boolean enabled)
public boolean isSubgraphLayouterEnabled()
public void enableOnlyCore()
public void doLayout(LayoutGraph layoutGraph)
doLayout
in interface Layouter
public void doLayout(GraphInterface graph, GraphLayout layout)
public GraphLayout calcLayout(LayoutGraph layoutGraph)
public GraphLayout calcLayout(GraphInterface graph, GraphLayout layout)
public boolean canLayout(LayoutGraph graph)
canLayout
in interface Layouter
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |