|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsamples.preview_new_graphdraw.VisEdge
public class VisEdge
This implements an edge between two points. Any subclasses--whether for straight edges or curved--must implement (at least) getBack(), getFront(), getSquareDistance(), and getEdge().
| Field Summary | |
|---|---|
protected VisVertex |
mBack
|
protected Edge |
mEdge
|
protected VisVertex |
mFront
|
| Constructor Summary | |
|---|---|
VisEdge(Edge e,
VisVertex v1,
VisVertex v2)
|
|
| Method Summary | |
|---|---|
VisEdge |
copy(VisVertex front,
VisVertex back)
Creates a new VisEdge from the specified
VisVertex instances and this instance's
Edge. |
Coordinates |
getBack()
Returns the location of the first endpoint of the Edge which
this VisEdge represents. |
Edge |
getEdge()
Returns the Edge which this VisEdge
represents. |
Coordinates |
getFront()
Returns the location of the second endpoint of the Edge which
this VisEdge represents. |
double |
getSquareDistance(double x,
double y)
Returns the squared distance from this edge to the point (x,y). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Edge mEdge
protected VisVertex mFront
protected VisVertex mBack
| Constructor Detail |
|---|
public VisEdge(Edge e,
VisVertex v1,
VisVertex v2)
| Method Detail |
|---|
public double getSquareDistance(double x,
double y)
(x,y).
The default implementation takes care of a distance from a straight edge to a point;
more complex edges should have corresponding functions.
public Edge getEdge()
Edge which this VisEdge
represents.
public Coordinates getFront()
Edge which
this VisEdge represents.
public Coordinates getBack()
Edge which
this VisEdge represents.
public VisEdge copy(VisVertex front,
VisVertex back)
VisEdge from the specified
VisVertex instances and this instance's
Edge.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||