|
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 for wrapping Drawer implementations.
It modifies the DataProvider instances registered with the graph using keys Drawer.NODE_BORDER_LEFT
and Drawer.NODE_BORDER_RIGHT and delegates the actual drawing to the inner drawer.
Actual space requirements are calculated by 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.
MedianLinearSegmentDrawer and SimplexDrawer.
// 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, therefore, cannot 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 drawerDelegate)
Creates an instance of NodeLabelSpaceDrawer using the delegate Drawer instance to
perform the core work. |
|
| Method Summary | |
|---|---|
void |
assignCoordinates(LayoutGraph graph,
NodeList[] layerLists,
DataProvider layerID)
Assigns the coordinates to the nodes of the given graph. |
protected double |
getHaloSpace(Node node,
boolean left)
Calculates the horizontal space requirements for the given node. |
void |
setDummyMap(NodeMap dummyMap)
Specifies a NodeMap instance for identifying the dummy nodes from the real ones. |
void |
setMinimalEdgeDistance(double d)
Specifies the minimum distance between two edges that span the same layer. |
void |
setMinimalLayerDistance(double d)
Specifies the minimum distance between two layers. |
void |
setMinimalMultiEdgeDistance(double d)
Specifies the minimum distance between two edges sharing source/target in the same layer. |
void |
setMinimalNodeDistance(double d)
Specifies the minimum 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 drawerDelegate)
NodeLabelSpaceDrawer using the delegate Drawer instance to
perform the core work.
drawerDelegate - the delegate Drawer instance| Method Detail |
|---|
public void assignCoordinates(LayoutGraph graph,
NodeList[] layerLists,
DataProvider layerID)
Drawer
assignCoordinates in interface Drawergraph - the graphlayerLists - the array of NodeLists each of which contains nodes that belong to the same layerlayerID - the DataProvider that returns the zero-based index of the layer to which each node belongs
protected double getHaloSpace(Node node,
boolean left)
This implementation uses the maximum left and right label overlaps as halo values.
node - the given nodeleft - true if the left halo should be calculated, false if the right halo should be
calculated
public void setDummyMap(NodeMap dummyMap)
NodeMap instance for identifying the dummy nodes from the real ones.
setDummyMap in interface DrawerdummyMap - the NodeMap that returns an object (the original edge) for each dummy node or
null for real nodespublic void setMinimalEdgeDistance(double d)
Minimum distance must be non-negative.
setMinimalEdgeDistance in interface Drawerpublic void setMinimalLayerDistance(double d)
Minimum distance must be non-negative.
setMinimalLayerDistance in interface Drawerpublic void setMinimalMultiEdgeDistance(double d)
Minimum distance must be non-negative.
setMinimalMultiEdgeDistance in interface Drawerpublic void setMinimalNodeDistance(double d)
Minimum distance must be non-negative.
setMinimalNodeDistance in interface Drawer
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||