public class TreeLayout<V,E> extends java.lang.Object implements Layout<V,E>
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<V> |
alreadyDone |
protected java.util.Map<V,java.lang.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 java.util.Map<V,java.awt.geom.Point2D> |
locations |
protected java.awt.Point |
m_currentPoint |
protected java.awt.Dimension |
size |
Constructor and Description |
---|
TreeLayout()
Creates an instance which does not initialize the vertex locations.
|
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.
|
TreeLayout(int distx)
Creates an instance which does not initialize the vertex locations.
|
TreeLayout(int distx,
int disty)
Creates an instance which does not initialize the vertex locations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildTree() |
protected void |
buildTree(V v,
int x) |
java.awt.geom.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.
|
java.awt.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.collections15.Transformer<V,java.awt.geom.Point2D> initializer)
provides initial locations for all vertices.
|
void |
setLocation(V v,
java.awt.geom.Point2D location)
set the location of a vertex
|
void |
setSize(java.awt.Dimension size)
This method is not supported by this class.
|
java.awt.geom.Point2D |
transform(V v) |
protected java.awt.Dimension size
protected java.util.Map<V,java.lang.Integer> basePositions
protected java.util.Map<V,java.awt.geom.Point2D> locations
protected transient java.util.Set<V> alreadyDone
public static int DEFAULT_DISTX
public static int DEFAULT_DISTY
protected int distX
DEFAULT_XDIST
.protected int distY
DEFAULT_YDIST
.protected transient java.awt.Point m_currentPoint
public TreeLayout()
public TreeLayout(Forest<V,E> g)
public TreeLayout(int distx)
public TreeLayout(Forest<V,E> g, int distx)
public TreeLayout(int distx, int disty)
protected void buildTree()
protected void buildTree(V v, int x)
public void setSize(java.awt.Dimension size)
protected void setCurrentPositionFor(V vertex)
public Graph<V,E> getGraph()
Layout
public java.awt.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.collections15.Transformer<V,java.awt.geom.Point2D> initializer)
Layout
setInitializer
in interface Layout<V,E>
public java.awt.geom.Point2D getCenter()
public void setLocation(V v, java.awt.geom.Point2D location)
Layout
setLocation
in interface Layout<V,E>
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence