|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.NodeLabelSpaceDrawer
public class NodeLabelSpaceDrawer
This class can be used to wrap Drawer implementations.
It modifies the Drawer.NODE_BORDER_LEFT and
Drawer.NODE_BORDER_RIGHT DataProvider instances and delegates the
actual drawing to the inner drawer.
Actual space requirements are calculated in getHaloSpace(Node, boolean).
This implementation uses the maximum left and right label overlaps as the halo values.
Note that this will only work with Drawer implementations that respect the values
provided through the DataProviders, e.g. MedianLinearSegmentsDrawer and SimplexDrawer.
Here is some example set up code.
// create the Layouter HierarchicLayouter hl = new HierarchicLayouter(); // set a suitable Drawer hl.setDrawer(new SimplexDrawer()); // wrap the Drawer hl.setDrawer(new NodeLabelSpaceDrawer(hl.getDrawer()));
NodeLabelLayouts and can therefor not be
used with layout orientations other than top to bottom.
| Field Summary |
|---|
| Fields inherited from interface y.layout.hierarchic.Drawer |
|---|
NODE_BORDER_BOTTOM, NODE_BORDER_LEFT, NODE_BORDER_RIGHT, NODE_BORDER_TOP, NODE_DISTANCE |
| Constructor Summary | |
|---|---|
NodeLabelSpaceDrawer(Drawer inner)
Creates a new instance of NodeLabelSpaceDrawer |
|
| Method Summary | |
|---|---|
void |
assignCoordinates(LayoutGraph g,
NodeList[] layerLists,
DataProvider layerID)
This method assigns the coordinates to the nodes. |
protected double |
getHaloSpace(Node node,
boolean left)
Calculates the horizontal space requirements for the given node. |
void |
setDummyMap(NodeMap dummy)
Gives the drawer the opportunity to distinguish between dummy nodes and real ones. dummy stores the original edge for each dummy node or null for real nodes. |
void |
setMinimalEdgeDistance(double d)
Sets the minimal distance between two edges in the same layer. |
void |
setMinimalLayerDistance(double d)
Sets the minimal distance between two layers. |
void |
setMinimalMultiEdgeDistance(double d)
Sets the minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. |
void |
setMinimalNodeDistance(double d)
Sets the minimal distance between two nodes in the same layer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeLabelSpaceDrawer(Drawer inner)
| Method Detail |
|---|
public void assignCoordinates(LayoutGraph g,
NodeList[] layerLists,
DataProvider layerID)
Drawer
assignCoordinates in interface Drawer
protected double getHaloSpace(Node node,
boolean left)
node - The node to calculate the halo for.left - Whether to calculate the left (true) or right (false) halo.
public void setDummyMap(NodeMap dummy)
Drawernull for real nodes.
setDummyMap in interface Drawerpublic void setMinimalEdgeDistance(double d)
Drawer
setMinimalEdgeDistance in interface Drawerpublic void setMinimalLayerDistance(double d)
Drawer
setMinimalLayerDistance in interface Drawerpublic void setMinimalMultiEdgeDistance(double d)
Drawer
setMinimalMultiEdgeDistance in interface Drawerpublic void setMinimalNodeDistance(double d)
Drawer
setMinimalNodeDistance in interface Drawer
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||