|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.layout.hierarchical.HierarchicalLayout
This Layout uses a Sugiyama layout algorithm to arrange a graph by placing nodes in different layers (rows and columns of an imaginary 2D grid) in such a way that most visual edges flow in the same direction and the number of their intersections are minimized.
A graph arranged by a HierarchicalLayout shows the flow and
hierarchy so clearly that it is often chosen for the
visualization of flow diagram, process chart and workflow applications.
The constants to configure a HierarchicalLayout instance are defined in
class HierarchicalLayoutConstants.
| Field Summary |
| Fields inherited from interface com.tensegrity.graph.layout.NodeLayout |
DIRECTION_BOTTOM_TO_TOP, DIRECTION_LEFT_TO_RIGHT, DIRECTION_RIGHT_TO_LEFT, DIRECTION_TOP_TO_BOTTOM, DIRECTION_UNDEFINED |
| Constructor Summary | |
HierarchicalLayout()
Constructs an instance and initializes it with default attributes. |
|
| Method Summary | |
boolean |
addEdge(LayoutableEdge edge)
This method adds an edge to the layout. |
boolean |
addNode(LayoutableNode node)
This method adds nodes into the layout classes. |
void |
afterLayoutHandler()
This method will be called after the arrangement of the graph is completed. |
void |
beforeAddEdgeHandler(int edgeCount)
This method must be called before inserting edges. |
void |
beforeAddNodeHandler(int nodeCount)
This method will be triggered before inserting nodes. |
void |
beforeLayoutHandler()
This method will be called before performing layout to allow the layout class to do initialization work. |
boolean |
error()
Returns true if an error has occurred; otherwise false. |
int |
getDirection()
Returns a constant that represents the direction of the NodeLayout implementation. |
AttributeSet |
getEdgeAttributesTemplate()
Returns the attribute set of edges which is initialized with default values. |
java.lang.String |
getErrorMessage()
Returns the error-message if an error has occurred. |
long |
getEstimatedArrangingTime()
Returns an estimate time for arranging of a given graph. |
AttributeSet |
getLayoutAttributesTemplate()
This method return an AttributeSet which contains all properties
supported by this Layout.
|
java.lang.String |
getName()
Returns the name of the Layout. |
AttributeSet |
getNodeAttributesTemplate()
Returns the attribute set of nodes which is initialized with default values. |
int |
getPreferEdgeType(AttributeSet usingAttributes)
This method allows a layout classes to inform the caller about it preferred edge type. |
AttributeSet |
getReport()
This method submits a report about the last layout process. |
void |
init()
An instance of this class may be used to arrange different graphs. |
boolean |
isGraphSuitable()
This method checks whether the layout is able to arrange the visual elements it contains. |
boolean |
layout(int x,
int y,
boolean reassignPorts)
Performs the layout process. |
void |
setProgressBar(LayoutProgress progressBar)
This method might be use to set a progress bar. |
void |
updateAttributeSet(AttributeSet layoutAttributs)
This method updates a given AttributeSet with the view
of consistency.
|
void |
useAttribute(AttributeSet layoutAttributs)
This method can be used to configure a layout class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HierarchicalLayout()
| Method Detail |
public void init()
Layout
init in interface LayoutLayout.init()public java.lang.String getName()
LayoutLayout. This name will be used to
identify a layout and must be unique.
getName in interface LayoutLayout.getName()public int getDirection()
NodeLayoutNodeLayout implementation. Valid values are defined through
the 'direction' constants from this interface.
getDirection in interface NodeLayoutNodeLayoutpublic boolean isGraphSuitable()
NodeLayout
isGraphSuitable in interface NodeLayoutNodeLayout.isGraphSuitable()public void beforeAddNodeHandler(int nodeCount)
NodeLayout
beforeAddNodeHandler in interface NodeLayoutnodeCount - The number of nodes that will be added.NodeLayout.beforeAddNodeHandler(int)public boolean addNode(LayoutableNode node)
NodeLayout
addNode in interface NodeLayoutnode - the node that is to be added.
Layout.getErrorMessage()
may be used to get details information.NodeLayout.beforeAddNodeHandler(int)public void beforeAddEdgeHandler(int edgeCount)
NodeLayoutedgeCount may be used for internal preparing
like memory allocation.
beforeAddEdgeHandler in interface NodeLayoutedgeCount - he number of edges that will be added.NodeLayout.beforeAddEdgeHandler(int)public boolean addEdge(LayoutableEdge edge)
NodeLayout
addEdge in interface NodeLayoutedge - The edge that is to be added.
Layout.getErrorMessage()
may be used to get details information.NodeLayout.addEdge(LayoutableEdge)public void useAttribute(AttributeSet layoutAttributs)
LayoutAttributeSet that contains all properties
supported by this Layout.
useAttribute in interface LayoutlayoutAttributs - The attributes that are to be used in the next layout
process.Layout.useAttribute(AttributeSet)public void beforeLayoutHandler()
Layout
beforeLayoutHandler in interface LayoutLayout.beforeLayoutHandler()
public boolean layout(int x,
int y,
boolean reassignPorts)
NodeLayout
layout in interface NodeLayoutx - The left position of the graph bounding box after arranging.y - The top position of the graph bounding box after arranging.reassignPorts - Specifies whether the layout is allowed
to reassign ports or not.
NodeLayout.beforeAddEdgeHandler(int)public void updateAttributeSet(AttributeSet layoutAttributs)
LayoutAttributeSet with the view
of consistency.
Notice: The given AttributeSet must contains valid properties
supported by this Layout. Please see Layout.getLayoutAttributesTemplate()
for more details.
updateAttributeSet in interface LayoutlayoutAttributs - the attributes that are to be updated.Layout.getLayoutAttributesTemplate()public int getPreferEdgeType(AttributeSet usingAttributes)
NodeLayout
getPreferEdgeType in interface NodeLayoutusingAttributes - the configuration that should being used.
public void afterLayoutHandler()
Layout
afterLayoutHandler in interface Layoutpublic AttributeSet getLayoutAttributesTemplate()
LayoutAttributeSet which contains all properties
supported by this Layout.
The provided AttributeSet can be modified to configure this
Layout.The method Layout.useAttribute(AttributeSet)
will be used to put a modified copy of this AttributeSet.
getLayoutAttributesTemplate in interface LayoutAttributeSet of this Layout
if any; otherwise null.Layout.getLayoutAttributesTemplate()public AttributeSet getNodeAttributesTemplate()
NodeLayout
getNodeAttributesTemplate in interface NodeLayoutAttributeSet
for nodes if any; otherwise null.NodeLayout.getNodeAttributesTemplate()public AttributeSet getEdgeAttributesTemplate()
NodeLayout
getEdgeAttributesTemplate in interface NodeLayoutAttributeSet
for nodes if any; otherwise null.NodeLayout.getEdgeAttributesTemplate()public boolean error()
LayoutLayout.getErrorMessage() to obtain
a description text about the last occurred error.
error in interface Layoutpublic java.lang.String getErrorMessage()
LayoutLayout.error() to find out whether
an error has occurred.
getErrorMessage in interface LayoutLayout.getErrorMessage()public AttributeSet getReport()
Layout
getReport in interface LayoutAttributeSet
which contains the report.Layout.getReport()public long getEstimatedArrangingTime()
NodeLayout
getEstimatedArrangingTime in interface NodeLayoutNodeLayout.getEstimatedArrangingTime()public void setProgressBar(LayoutProgress progressBar)
NodeLayout
setProgressBar in interface NodeLayoutprogressBar - The progress bar that is to be updated.NodeLayout.setProgressBar(LayoutProgress)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||