|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.tree.AbstractNodePlacer
y.layout.tree.ARNodePlacer
public class ARNodePlacer
This class is used by GenericTreeLayouter and implements a
sophisticated NodePlacer. Subtrees are placed so that the overall
subtree layout's aspect ratio will be close to a given aspect ratio.
| Field Summary | |
|---|---|
static byte |
FILL_STYLE_CENTERED
Byte constant that can be used for the fillStyle property. |
static byte |
FILL_STYLE_JUSTIFY
Byte constant that can be used for the fillStyle property. |
static byte |
FILL_STYLE_LEADING
Byte constant that can be used for the fillStyle property. |
static byte |
FILL_STYLE_TRAILING
Byte constant that can be used for the fillStyle property. |
| Fields inherited from class y.layout.tree.AbstractNodePlacer |
|---|
graph |
| Fields inherited from interface y.layout.tree.NodePlacer |
|---|
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST |
| Constructor Summary | |
|---|---|
ARNodePlacer()
Creates a new instance of ARNodePlacer with default orientation (vertical), aspect ratio (1.0d), fill style ( FILL_STYLE_LEADING),
and default distances (40.0d). |
|
ARNodePlacer(boolean horizontal,
double aspectRatio,
byte fillStyle,
double horizontalDistance,
double verticalDistance)
Creates a new instance of ARNodePlacer with given orientation and distances. |
|
| Method Summary | |
|---|---|
Comparator |
createFromSketchComparator()
Creates a comparator for edges. |
protected byte |
determineChildConnector(Node child)
This method must be implemented by subclasses. |
double |
getAspectRatio()
Gets the preferred aspect ratio. |
byte |
getFillStyle()
Returns the fill style. |
double |
getHorizontalDistance()
Returns the horizontal distance this NodePlacer should use for the arrangement of the elements. |
double |
getVerticalDistance()
Returns the vertical distance this NodePlacer should use for the arrangement of the elements. |
boolean |
isHorizontal()
Returns whether this instance is configured to create horizontal rows of child nodes. |
protected GenericTreeLayouter.SubtreeShape |
placeSubtree(Node localRoot,
byte parentConnectorDirection)
The main placeSubtree method that must be implemented by subclasses. |
void |
setAspectRatio(double aspectRatio)
Sets the preferred aspect ratio. |
void |
setFillStyle(byte fillStyle)
Sets the fill style. |
void |
setHorizontal(boolean horizontal)
Determines whether this instance is configured to create horizontal rows of child nodes. |
void |
setHorizontalDistance(double horizontalDistance)
Sets the horizontal distance this NodePlacer should use for the arrangement of the elements. |
void |
setVerticalDistance(double verticalDistance)
Sets the vertical distance this NodePlacer should use for the arrangement of the elements. |
| Methods inherited from class y.layout.tree.AbstractNodePlacer |
|---|
clone, createProcessor, determineChildConnectors, getNodeShape, getSubtreeShape, placeSubtree |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface y.layout.tree.NodePlacer |
|---|
createProcessor, determineChildConnectors, placeSubtree |
| Field Detail |
|---|
public static final byte FILL_STYLE_LEADING
fillStyle property.
Elements in one lane will be aligned with the leading edge.
public static final byte FILL_STYLE_CENTERED
fillStyle property.
Elements in one lane will be centered with the bounds.
public static final byte FILL_STYLE_JUSTIFY
fillStyle property.
Elements in one lane will be justified with the bounds.
public static final byte FILL_STYLE_TRAILING
fillStyle property.
Elements in one lane will be aligned with the trailing edge.
| Constructor Detail |
|---|
public ARNodePlacer()
FILL_STYLE_LEADING),
and default distances (40.0d).
public ARNodePlacer(boolean horizontal,
double aspectRatio,
byte fillStyle,
double horizontalDistance,
double verticalDistance)
horizontal - true for horizontal row modehorizontalDistance - horizontal distance between adjacent elementsverticalDistance - vertical distance between adjacent elementsaspectRatio - the aspectRatio, this instance should try to obeyfillStyle - a fill style constant describing the node distribution| Method Detail |
|---|
protected byte determineChildConnector(Node child)
AbstractNodePlacer
determineChildConnector in class AbstractNodePlacerchild - the child node
NodePlacer interface
protected GenericTreeLayouter.SubtreeShape placeSubtree(Node localRoot,
byte parentConnectorDirection)
AbstractNodePlacer
placeSubtree in class AbstractNodePlacerlocalRoot - the local root nodeparentConnectorDirection - the direction of the connector shape
public boolean isHorizontal()
true rows will be filled, false for columnspublic void setHorizontal(boolean horizontal)
horizontal - true for horizontal rows,
false for vertical columnspublic double getVerticalDistance()
public void setVerticalDistance(double verticalDistance)
verticalDistance - the new valuepublic double getHorizontalDistance()
public void setHorizontalDistance(double horizontalDistance)
horizontalDistance - the new valuepublic double getAspectRatio()
public void setAspectRatio(double aspectRatio)
aspectRatio - the ratio preferred width / preferred heightpublic byte getFillStyle()
public void setFillStyle(byte fillStyle)
fillStyle - the new fill style constantpublic Comparator createFromSketchComparator()
FromSketchNodePlacer
createFromSketchComparator in interface FromSketchNodePlacer
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||