public class TreeLayout<V,E> extends Object implements Layout<V,E>
Modifier and Type | Field and Description |
---|---|
protected Set<V> |
alreadyDone |
protected Map<V,Integer> |
basePositions |
static int |
DEFAULT_DISTX
The default horizontal vertex spacing.
|
static int |
DEFAULT_DISTY
The default vertical vertex spacing.
|
protected int |
distX
The horizontal vertex spacing.
|
protected int |
distY
The vertical vertex spacing.
|
protected Forest<V,E> |
graph |
protected Map<V,Point2D> |
locations |
protected Point |
m_currentPoint |
protected Dimension |
size |
Constructor and Description |
---|
TreeLayout(Forest<V,E> g)
Creates an instance for the specified graph with default X and Y distances.
|
TreeLayout(Forest<V,E> g,
int distx)
Creates an instance for the specified graph and X distance with
default Y distance.
|
TreeLayout(Forest<V,E> g,
int distx,
int disty)
Creates an instance for the specified graph, X distance, and Y distance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildTree() |
protected void |
buildTree(V v,
int x) |
Point2D |
getCenter()
Returns the center of this layout's area.
|
Graph<V,E> |
getGraph()
Returns the full graph (the one that was passed in at
construction time) that this Layout refers to.
|
Dimension |
getSize()
Returns the current size of the visualization's space.
|
void |
initialize()
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isLocked(V v)
Returns
true if the position of vertex v
is locked. |
void |
lock(V v,
boolean state)
Sets a flag which fixes this vertex in place.
|
void |
reset() |
protected void |
setCurrentPositionFor(V vertex) |
void |
setGraph(Graph<V,E> graph)
setter for graph
|
void |
setInitializer(org.apache.commons.collections4.Transformer<V,Point2D> initializer)
provides initial locations for all vertices.
|
void |
setLocation(V v,
Point2D location)
set the location of a vertex
|
void |
setSize(Dimension size)
This method is not supported by this class.
|
Point2D |
transform(V v) |
protected Dimension size
public static int DEFAULT_DISTX
public static int DEFAULT_DISTY
protected int distX
DEFAULT_XDIST
.protected int distY
DEFAULT_YDIST
.protected transient Point m_currentPoint
public TreeLayout(Forest<V,E> g)
public TreeLayout(Forest<V,E> g, int distx)
protected void buildTree()
protected void buildTree(V v, int x)
public void setSize(Dimension size)
protected void setCurrentPositionFor(V vertex)
public Graph<V,E> getGraph()
Layout
public Dimension getSize()
Layout
public void initialize()
Layout
initialize
in interface Layout<V,E>
public boolean isLocked(V v)
Layout
true
if the position of vertex v
is locked.public void lock(V v, boolean state)
Layout
public void setGraph(Graph<V,E> graph)
Layout
public void setInitializer(org.apache.commons.collections4.Transformer<V,Point2D> initializer)
Layout
setInitializer
in interface Layout<V,E>
public Point2D getCenter()
public void setLocation(V v, Point2D location)
Layout
setLocation
in interface Layout<V,E>
Copyright © 2014. All rights reserved.