Class GraphDrawingPack.GraphDrawing
All Packages This Package Previous Next
Class GraphDrawingPack.GraphDrawing
java.lang.Object
|
+----GraphDrawingPack.GraphDrawing
-
public final class
GraphDrawing
-
extends Object
-
implements GraphDrawingInterface
GraphDrawing: implements all methods for drawing the graph on
canvas. The GraphCanvas contains one GraphDrawing object, each
Vertex contains its own VertexDrawing object, and each Edge
contains its own EdgeDrawing object.
Currently, vertices are drawn as rectangles which expand in size
to contain the selected property (see VertexDrawing). Edges are
arcs between vertices (see EdgeDrawing and DirEdgeDrawing). Edges
are always drawn first so that the vertices cover the incoming
edges.
-
GraphDrawing(GraphCanvas)
-
-
EdgeinRect(EdgeList, double, double, double, double)
-
return true if edge e\'s midpoint is in the specified rectangle
-
VertexinRect(Vertex, double, double, double, double)
-
return true if this vertex is in rectangle specified
-
addAllInRectToHE(double, double, double, double)
-
highlight all edges within specified rectangle
-
addAllInRectToHV(double, double, double, double)
-
highlight all vertices within specified rectangle
-
addAllInRectToHV_E(double, double, double, double)
-
highlighted all vertices and edges within specified rectangle
-
drawAttachedEdges(Vertex)
-
draw all edges attached to Vertex v
-
drawE()
-
draw all edges in graph
-
drawEdge(Edge)
-
draw Edge
-
drawEdge(EdgeList)
-
-
drawEdge(Vertex, Vertex)
-
-
drawGraph()
-
draw all edges and vertices in graph
-
drawHE()
-
draw all highlighted edges in graph
-
drawHV()
-
draw all highlighted vertices in graph
-
drawHVtrans(int, int)
-
draw all highlighted vertices translated by specified xtrans, ytrans
-
drawV()
-
draw all vertices in graph
-
drawVertex(Vertex)
-
draw Vertex
-
drawvtrans(Vertex, int, int)
-
draw vertex v translated by specified xtrans, ytrans
-
ptInEdge(EdgeList, double, double)
-
return true if pt(x,y) is in active portion of the edge
-
ptInVertex(Vertex, double, double)
-
return true if pt(x,y) is in this vertex
-
ptOnEdge(double, double)
-
return the edge whoser active portion contains point (x,y)
-
ptOnVert(double, double)
-
return vertex which contains point (x,y)
GraphDrawing
public GraphDrawing(GraphCanvas _gc)
drawVertex
public void drawVertex(Vertex v)
-
draw Vertex
ptInVertex
public boolean ptInVertex(Vertex v,
double x,
double y)
-
return true if pt(x,y) is in this vertex
ptOnVert
public Vertex ptOnVert(double x,
double y)
-
return vertex which contains point (x,y)
VertexinRect
public boolean VertexinRect(Vertex v,
double x,
double y,
double x2,
double y2)
-
return true if this vertex is in rectangle specified
drawV
public void drawV()
-
draw all vertices in graph
drawHV
public void drawHV()
-
draw all highlighted vertices in graph
drawEdge
public void drawEdge(Edge e)
-
draw Edge
drawEdge
public void drawEdge(EdgeList e)
drawEdge
public void drawEdge(Vertex v1,
Vertex v2)
drawE
public void drawE()
-
draw all edges in graph
drawHE
public void drawHE()
-
draw all highlighted edges in graph
ptInEdge
public boolean ptInEdge(EdgeList e,
double x,
double y)
-
return true if pt(x,y) is in active portion of the edge
EdgeinRect
public boolean EdgeinRect(EdgeList e,
double x,
double y,
double x2,
double y2)
-
return true if edge e\'s midpoint is in the specified rectangle
ptOnEdge
public Edge ptOnEdge(double x,
double y)
-
return the edge whoser active portion contains point (x,y)
drawGraph
public void drawGraph()
-
draw all edges and vertices in graph
drawvtrans
public void drawvtrans(Vertex v,
int xtrans,
int ytrans)
-
draw vertex v translated by specified xtrans, ytrans
drawHVtrans
public void drawHVtrans(int xtrans,
int ytrans)
-
draw all highlighted vertices translated by specified xtrans, ytrans
drawAttachedEdges
public void drawAttachedEdges(Vertex v)
-
draw all edges attached to Vertex v
addAllInRectToHV
public void addAllInRectToHV(double x,
double y,
double x2,
double y2)
-
highlight all vertices within specified rectangle
addAllInRectToHE
public void addAllInRectToHE(double x,
double y,
double x2,
double y2)
-
highlight all edges within specified rectangle
addAllInRectToHV_E
public void addAllInRectToHV_E(double x,
double y,
double x2,
double y2)
-
highlighted all vertices and edges within specified rectangle
All Packages This Package Previous Next