V - The vertex typeE - The edge typepublic class Drawing<V extends Vertex,E extends Edge<V>>
extends java.lang.Object
| Constructor and Description |
|---|
Drawing()
Creates a drawing with empty vertex and edge mappings
|
Drawing(java.util.Map<V,java.awt.geom.Point2D> vertexMappings,
java.util.Map<E,java.util.List<java.awt.geom.Point2D>> edgeMappings)
Creates a drawing with the provided edge and vertex mappings
|
| Modifier and Type | Method and Description |
|---|---|
int |
findBottom()
Finds the position of the bottom-most vertex
|
int |
findLeftmostPosition()
Finds the position of the left-most vertex
|
int |
findMiddle()
Calculates the y value of the center of the drawing
|
int |
findTop()
Finds the position of the topmost vertex
|
int[] |
getBounds()
Calculates bounds of the drawing
|
java.util.Map<E,java.util.List<java.awt.geom.Point2D>> |
getEdgeMappings() |
int |
getReursiveLinkDistance() |
java.util.Map<V,java.awt.geom.Point2D> |
getVertexMappings() |
void |
moveBy(int x,
int y)
Moves all vertices horizontally and vertically
|
void |
moveByIncludingEdges(int x,
int y)
Moves the whole drawing horizontally and vertically
|
void |
positionEdges(java.util.List<E> edges)
Once positions of vertices are calculated, this method
sets positions of edges (their nodes).
|
void |
separate(int minXDistance,
int minYDistance)
Moves vertices of the drawing in order to increase the distances between them
|
void |
setEdgeMappings(java.util.Map<E,java.util.List<java.awt.geom.Point2D>> edgeMappings) |
void |
setEdgePosition(E e,
java.util.List<java.awt.geom.Point2D> nodes)
Add an edge with positions of its nodes to the mapping
|
void |
setReursiveLinkDistance(int reursiveLinkDistance) |
void |
setVertexMappings(java.util.Map<V,java.awt.geom.Point2D> vertexMappings) |
void |
setVertexPosition(V v,
java.awt.geom.Point2D pos)
Add a vertex with its position to the mapping
|
java.lang.String |
toString() |
public Drawing()
public Drawing(java.util.Map<V,java.awt.geom.Point2D> vertexMappings, java.util.Map<E,java.util.List<java.awt.geom.Point2D>> edgeMappings)
vertexMappings - Map consisting of vertices and their positionsedgeMappings - Map consisting of edges and their positionspublic void positionEdges(java.util.List<E> edges)
edges - Edges to be positionedpublic void separate(int minXDistance,
int minYDistance)
minXDistance - Minimum horizontal distance between two verticesminYDistance - Minimum vertical distance between two verticespublic int findTop()
public int findBottom()
public int findMiddle()
public int findLeftmostPosition()
public int[] getBounds()
public void moveBy(int x,
int y)
x - Horizontal move lengthy - Vertical move lengthpublic void moveByIncludingEdges(int x,
int y)
x - Horizontal move lengthy - Vertical move lengthpublic void setVertexPosition(V v, java.awt.geom.Point2D pos)
v - Vertexpos - Positionpublic void setEdgePosition(E e, java.util.List<java.awt.geom.Point2D> nodes)
e - Edgenodes - Positions of nodespublic java.util.Map<V,java.awt.geom.Point2D> getVertexMappings()
public void setVertexMappings(java.util.Map<V,java.awt.geom.Point2D> vertexMappings)
vertexMappings - Vertices-positions mapping to setpublic java.util.Map<E,java.util.List<java.awt.geom.Point2D>> getEdgeMappings()
public void setEdgeMappings(java.util.Map<E,java.util.List<java.awt.geom.Point2D>> edgeMappings)
edgeMappings - Edges-positions of their nodes mapping to setpublic void setReursiveLinkDistance(int reursiveLinkDistance)
reursiveLinkDistance - Distance between recursive links to setpublic int getReursiveLinkDistance()
public java.lang.String toString()
toString in class java.lang.Object