Interface GraphDrawingPack.EdgeDrawingInterface
All Packages    This Package    Previous    Next

Interface GraphDrawingPack.EdgeDrawingInterface

public interface EdgeDrawingInterface
extends Object
EdgeDrawingInterface: all methods needed to draw edges on GraphCanvas. To change implementation of EdgeDrawingInterface, one would have to change instantion in GraphPack/Edge.java

EdgeinRect(double, double, double, double)
return true if edge e\'s midpoint is in the specified rectangle
drawEdge(GraphCanvas)
draw edge e on canvas
getShape()
return string name of edge shapee
midx()
return x-value of midpoint
midy()
return y-value of midpoint
ptInEdge(GraphCanvas, double, double)
return true if pt(x,y) is in active portion of the edge
setShape(String)
set type of edge shape
update()
when an edge\'s vertices have moved, or another edge is added, call update to recalculate the midpoint and curvature of the edge

drawEdge
  public abstract void drawEdge(GraphCanvas gc)
draw edge e on canvas

ptInEdge

  public abstract boolean ptInEdge(GraphCanvas gc,
                                   double x,
                                   double y)
return true if pt(x,y) is in active portion of the edge

EdgeinRect

  public abstract boolean EdgeinRect(double x,
                                     double y,
                                     double x2,
                                     double y2)
return true if edge e\'s midpoint is in the specified rectangle

update

  public abstract void update()
when an edge\'s vertices have moved, or another edge is added, call update to recalculate the midpoint and curvature of the edge

setShape

  public abstract void setShape(String t)
set type of edge shape

getShape

  public abstract String getShape()
return string name of edge shapee

midx

  public abstract int midx()
return x-value of midpoint

midy

  public abstract int midy()
return y-value of midpoint


All Packages    This Package    Previous    Next