Class GraphCanvas

Class GraphCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----GraphCanvas

class GraphCanvas
extends Canvas

coord

GraphCanvas(GraphInterface, Coordinates)

EdgeinRect(EdgeList, double, double, double, double)
VertexinRect(Vertex, double, double, double, double)
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
clearAll()
drawAnyRect(int, int, int, int)
drawGraph()
draw all edges and vertices in graph
drawHV()
draw all highlighted vertices in graph
drawVertex(Vertex)
drawVxorTrans(Vertex, int, int)
draw vertex v translated by xtrans and ytrans, painted in xor mode note - draws v as if it were highlighted, but without border
keyDown(Event, int)
load(Frame, BetterTextArea)
minimumSize()
mouseDown(Event, int, int)
mouseDrag(Event, int, int)
mouseUp(Event, int, int)
paint(Graphics)
perr(String)
preferredSize()
ptInEdge(EdgeList, double, double)
ptInVertex(Vertex, double, double)
ptOnEdge(double, double)
return edge which contains point (x,y)
ptOnVert(double, double)
return vertex which contains point (x,y)
save(Frame, BetterTextArea)

coord
  public Coordinates coord

GraphCanvas
  public GraphCanvas(GraphInterface _g,
                     Coordinates _coord)

paint
  public void paint(Graphics gr)
clearAll
  public void clearAll()
minimumSize
  public Dimension minimumSize()
preferredSize
  public Dimension preferredSize()
keyDown
  public boolean keyDown(Event evt,
                         int key)
mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
perr
  public void perr(String s)
drawAnyRect
  public void drawAnyRect(int x1,
                          int y1,
                          int x2,
                          int y2)
drawVertex
  public void drawVertex(Vertex v)
drawVxorTrans
  public void drawVxorTrans(Vertex v,
                            int xtrans,
                            int ytrans)
draw vertex v translated by xtrans and ytrans, painted in xor mode note - draws v as if it were highlighted, but without border

drawGraph

  public void drawGraph()
draw all edges and vertices in graph

drawHV

  public void drawHV()
draw all highlighted vertices in graph

ptInVertex

  public boolean ptInVertex(Vertex v,
                            double x,
                            double y)
VertexinRect
  public boolean VertexinRect(Vertex v,
                              double x,
                              double y,
                              double x2,
                              double y2)
ptInEdge
  public boolean ptInEdge(EdgeList e,
                          double x,
                          double y)
EdgeinRect
  public boolean EdgeinRect(EdgeList e,
                            double x,
                            double y,
                            double x2,
                            double y2)
ptOnVert
  public Vertex ptOnVert(double x,
                         double y)
return vertex which contains point (x,y)

ptOnEdge

  public Edge ptOnEdge(double x,
                       double y)
return edge which contains point (x,y)

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

load

  public void load(Frame f,
                   BetterTextArea text)
save
  public void save(Frame f,
                   BetterTextArea text)