|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.FixNodeLayoutStage
public class FixNodeLayoutStage
Layout stage that can be used to fix the position of either a single node or the alignment of the bounding box of several nodes (but not the positions of the individual nodes).
Field Summary | |
---|---|
static byte |
FIX_POINT_POLICY_CENTER
Fix point calculation policy that results in the center of a given rectangle to be considered the fix point. |
static byte |
FIX_POINT_POLICY_UPPER_LEFT
Fix point calculation policy that results in the upper left corner of a given rectangle to be considered the fix point. |
static Object |
FIXED_NODE_DPKEY
DataProvider key to specify a DataProvider
whose DataProvider.getBool(Object) method is used to
determine which nodes should be considered fixed. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
FixNodeLayoutStage()
Initializes a new FixNodeLayoutStage . |
|
FixNodeLayoutStage(Layouter core)
Initializes a new FixNodeLayoutStage . |
Method Summary | |
---|---|
protected Rectangle2D |
calculateBounds(LayoutGraph graph,
NodeList fixed)
Calculates the bounding box of the specified nodes. |
protected YPoint |
calculateFixPoint(LayoutGraph graph,
NodeList fixed)
Calculates the fix point for the specified nodes in the specified graph. |
protected YPoint |
calculateFixPoint(Rectangle2D bounds)
Calculates the fix point of the specified rectangle according to the policy returned by getFixPointPolicy() . |
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
byte |
getFixPointPolicy()
Returns the fix point calculation policy used in calculateFixPoint(java.awt.geom.Rectangle2D) to determine which
point in the corresponding rectangle should be considered fixed. |
boolean |
isIncludingEdges()
Determines whether or not subgraph edges should be taken into account when calculating the bounding box of the fixed nodes. |
boolean |
isIncludingLabels()
Determines whether or not label geometries should be taken into account when calculating the bounding box of the fixed nodes. |
void |
setFixPointPolicy(byte policy)
Specifies the fix point calculation policy used in calculateFixPoint(java.awt.geom.Rectangle2D) to determine which
point in the corresponding rectangle should be considered fixed. |
void |
setIncludingEdges(boolean includingEdges)
Specifies whether or not subgraph edges should be taken into account when calculating the bounding box of the fixed nodes. |
void |
setIncludingLabels(boolean includingLabels)
Specifies whether or not label geometries should be taken into account when calculating the bounding box of the fixed nodes. |
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 |
Field Detail |
---|
public static final Object FIXED_NODE_DPKEY
DataProvider
key to specify a DataProvider
whose DataProvider.getBool(Object)
method is used to
determine which nodes should be considered fixed.
public static final byte FIX_POINT_POLICY_CENTER
public static final byte FIX_POINT_POLICY_UPPER_LEFT
Constructor Detail |
---|
public FixNodeLayoutStage()
FixNodeLayoutStage
.
public FixNodeLayoutStage(Layouter core)
FixNodeLayoutStage
.
core
- the core layout algorithm for this stage.Method Detail |
---|
public byte getFixPointPolicy()
calculateFixPoint(java.awt.geom.Rectangle2D)
to determine which
point in the corresponding rectangle should be considered fixed.
By default, FIX_POINT_POLICY_CENTER
is used.
calculateFixPoint(java.awt.geom.Rectangle2D)
.setFixPointPolicy(byte)
,
FIX_POINT_POLICY_CENTER
,
FIX_POINT_POLICY_UPPER_LEFT
public void setFixPointPolicy(byte policy)
calculateFixPoint(java.awt.geom.Rectangle2D)
to determine which
point in the corresponding rectangle should be considered fixed.
By default, FIX_POINT_POLICY_CENTER
is used.
policy
- of one getFixPointPolicy()
public boolean isIncludingEdges()
By default, this property is set to false
, i.e. subgraph
edges are not taken into account.
true
if subgraph edges should be taken into account
and false
otherwise.setIncludingEdges(boolean)
,
calculateBounds(LayoutGraph, y.base.NodeList)
public void setIncludingEdges(boolean includingEdges)
By default, this property is set to false
, i.e. subgraph
edges are not taken into account.
includingEdges
- true
if subgraph edges should be taken
into account and false
otherwise.isIncludingEdges()
,
calculateBounds(LayoutGraph, y.base.NodeList)
public boolean isIncludingLabels()
By default, this property is set to false
, i.e. label
geometries are not taken into account.
true
if label geometries should be taken into account
and false
otherwise.setIncludingLabels(boolean)
,
calculateBounds(LayoutGraph, y.base.NodeList)
public void setIncludingLabels(boolean includingLabels)
By default, this property is set to false
, i.e. label
geometries are not taken into account.
includingLabels
- true
if label geometries should be
taken into account and false
otherwise.isIncludingLabels()
,
calculateBounds(LayoutGraph, y.base.NodeList)
public boolean canLayout(LayoutGraph graph)
Layouter
true
iff the given graph can be laid
out by this algorithm. Calling doLayout
with
the given graph as its argument will only success if
this method returns true
.
public void doLayout(LayoutGraph graph)
Layouter
protected YPoint calculateFixPoint(LayoutGraph graph, NodeList fixed)
calculateBounds(LayoutGraph, y.base.NodeList)
and
calculateFixPoint(java.awt.geom.Rectangle2D)
.
graph
- the graph associated to the specified nodes.fixed
- the list of nodes for which a fix point has to be determined.
protected YPoint calculateFixPoint(Rectangle2D bounds)
getFixPointPolicy()
.
If the specified rectangle is null
or the rectangle has
negative width
or negative height
,
null
will be returned.
bounds
- the rectangle for which to determine the fix point.
null
if
nothing should be fixed.getFixPointPolicy()
protected Rectangle2D calculateBounds(LayoutGraph graph, NodeList fixed)
isIncludingEdges()
and
isIncludingLabels()
determine whether or not edges and labels
are taken into account when calculating the box.
graph
- the graph associated to the specified nodes.fixed
- the list of nodes that determine the bounding box.
isIncludingEdges()
,
isIncludingLabels()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |