Search this API

y.layout.hierarchic
Interface Drawer

All Known Implementing Classes:
AbstractDrawer, AlignmentDrawer, LinearSegmentsDrawer, MedianDrawerWrapper, MedianLinearSegmentDrawer, NodeLabelSpaceDrawer, PendularDrawer, PolylineDrawer, SimplexDrawer, TreeDrawer

public interface Drawer

This interface implements the drawing phase of the hierarchic layout algorithm (i.e., the assignment of nodes' coordinates).

The assignment of coordinates to the nodes is performed according to the defined range.

 

Field Summary
static java.lang.Object NODE_BORDER_BOTTOM
          A DataProvider key for defining an overlap-free border to the bottom side of the associated node.
static java.lang.Object NODE_BORDER_LEFT
          A DataProvider key for defining an overlap-free border to the left side of the associated node.
static java.lang.Object NODE_BORDER_RIGHT
          A DataProvider key for defining an overlap-free border to the right side of the associated node.
static java.lang.Object NODE_BORDER_TOP
          A DataProvider key for defining an overlap-free border to the top side of the associated node.
static java.lang.Object NODE_DISTANCE
          A DataProvider key for specifying the minimum distance between the right border of the node and the left border of its right-hand side neighbor in the layer.
 
Method Summary
 void assignCoordinates(LayoutGraph graph, NodeList[] layerLists, DataProvider layerID)
          Assigns the coordinates to the nodes of the given graph.
 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 (e.g. multi-edges) of the same layer.
 void setMinimalNodeDistance(double d)
          Specifies the minimum distance between two nodes of the same layer.
 

Field Detail

NODE_BORDER_LEFT

static final java.lang.Object NODE_BORDER_LEFT
A DataProvider key for defining an overlap-free border to the left side of the associated node.

 
Drawer implementations may ignore the data provided.

NODE_BORDER_RIGHT

static final java.lang.Object NODE_BORDER_RIGHT
A DataProvider key for defining an overlap-free border to the right side of the associated node.

 
Drawer implementations may ignore the data provided.

NODE_BORDER_TOP

static final java.lang.Object NODE_BORDER_TOP
A DataProvider key for defining an overlap-free border to the top side of the associated node.

 
Drawer implementations may ignore the data provided.

NODE_BORDER_BOTTOM

static final java.lang.Object NODE_BORDER_BOTTOM
A DataProvider key for defining an overlap-free border to the bottom side of the associated node.

 
Drawer implementations may ignore the data provided.

NODE_DISTANCE

static final java.lang.Object NODE_DISTANCE
A DataProvider key for specifying the minimum distance between the right border of the node and the left border of its right-hand side neighbor in the layer.

 
Drawer implementations may ignore the data provided.
Method Detail

assignCoordinates

void assignCoordinates(LayoutGraph graph,
                       NodeList[] layerLists,
                       DataProvider layerID)
Assigns the coordinates to the nodes of the given graph.

Parameters:
graph - the graph
layerLists - the array of NodeLists each of which contains nodes that belong to the same layer
layerID - the DataProvider that returns the zero-based index of the layer to which each node belongs

setDummyMap

void setDummyMap(NodeMap dummyMap)
Specifies a NodeMap instance for identifying the dummy nodes from the real ones.

Parameters:
dummyMap - the NodeMap that returns the original edge for each dummy node or null for real nodes

setMinimalNodeDistance

void setMinimalNodeDistance(double d)
Specifies the minimum distance between two nodes of the same layer.

Parameters:
d - the minimum distance between two nodes of the same layer
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative
Sample Graphs:

Node distance 10

Node distance 100

setMinimalEdgeDistance

void setMinimalEdgeDistance(double d)
Specifies the minimum distance between two edges that span the same layer.

Parameters:
d - the minimum distance between two edges
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative
Sample Graphs:

Edge distance 10

Edge distance 100

setMinimalMultiEdgeDistance

void setMinimalMultiEdgeDistance(double d)
Specifies the minimum distance between two edges sharing source/target (e.g. multi-edges) of the same layer.

Parameters:
d - the minimum distance between between two edges sharing source/target
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative
Sample Graphs:

Multi-edge distance 10

Multi-edge distance 200

setMinimalLayerDistance

void setMinimalLayerDistance(double d)
Specifies the minimum distance between two layers.

Parameters:
d - the minimum distance between two layers
Throws:
java.lang.IllegalArgumentException - if the minimum distance is negative
Sample Graphs:

Layer distance 40

Layer distance 100

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.