|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.AbstractLayoutStage | +--y.layout.ComponentLayouter
This layout stage arranges the connected components of a graph.
It is possible to specify a core layout algorithm that will be invoked on all connected components of the graph before this layouter arranges the components themselves.
ComponentLayouter will handle hierrchically grouped graphs in a special way. The contents of a group node will always belong to the same component as the group node itself.
Field Summary |
Fields inherited from interface y.layout.Layouter |
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
ComponentLayouter()
Instantiates a ComponentLayouter. |
|
ComponentLayouter(Layouter coreLayouter)
Instantiates a ComponentLayouter. |
Method Summary | |
protected void |
arrangeComponentGraphs(LayoutGraph graph,
NodeList[] nl,
EdgeList[] el,
YRectangle[] rl,
boolean horizontal)
Produces a non-overlapping component graph layout. |
boolean |
canLayout(LayoutGraph graph)
Determines if the preconditions for the graph layout algorithm are fullfilled, by applying them to the connected components. |
void |
doLayout(LayoutGraph graph)
Calculate the layout. |
protected int |
findGraphComponents(LayoutGraph graph,
NodeMap compNumber)
Determines which nodes will belong to the same graph component. |
double |
getComponentSpacing()
Getter for property componentSpacing. |
double |
getGridSpacing()
Getter for property gridSpacing. |
boolean |
isGroupingActive()
Returns whether grouping information bound to the graph will be used to calculate the components. |
void |
setComponentSpacing(double componentSpacing)
Setter for property componentSpacing. |
void |
setGridSpacing(double gridSpacing)
Setter for property gridSpacing. |
void |
setGroupingActive(boolean groupingActive)
Determines whether grouping information bound to the graph should be used to determine the connectedness of the graph structure. |
protected void |
setOrigin(LayoutGraph graph,
NodeList nl,
EdgeList el,
YPoint org,
YRectangle r)
Sets the origin for a subgraph. |
void |
setPreferredLayoutSize(double width,
double height)
Sets the preferred layout size for this layouter. |
Methods inherited from class y.layout.AbstractLayoutStage |
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComponentLayouter(Layouter coreLayouter)
public ComponentLayouter()
Method Detail |
public void setPreferredLayoutSize(double width, double height)
public boolean canLayout(LayoutGraph graph)
protected int findGraphComponents(LayoutGraph graph, NodeMap compNumber)
graph
- the input graphcompNumber
- return value that will hold the zero-based number
of the component that it belongs to. The component number of
Node v
is compNum.getInt()
.
public void doLayout(LayoutGraph graph)
protected void arrangeComponentGraphs(LayoutGraph graph, NodeList[] nl, EdgeList[] el, YRectangle[] rl, boolean horizontal)
Subclasses may want to overwrite this method.
protected void setOrigin(LayoutGraph graph, NodeList nl, EdgeList el, YPoint org, YRectangle r)
public double getGridSpacing()
public void setGridSpacing(double gridSpacing)
gridSpacing
- New value of property gridSpacing.public double getComponentSpacing()
public void setComponentSpacing(double componentSpacing)
componentSpacing
- New value of property componentSpacing.public boolean isGroupingActive()
true
.
public void setGroupingActive(boolean groupingActive)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |