Class tred.Edge
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tred.Edge

java.lang.Object
   |
   +----tred.EditorObject
           |
           +----tred.Edge

public class Edge
extends EditorObject
Class Edge is the implementation for edges of the Class Graph.

Variable Index

 o fslot
 o tslot

Constructor Index

 o Edge(int, Slot, Slot)
This constructor initializes all the fields.
 o Edge(Slot, Slot)

Method Index

 o click()
This method is implemented to be overridden.
 o getBounds()
 o getFrom()
 o getTo()
 o inside(int, int)
This method is invoked by the GraphPanel in order to determine if this edge is "near enough" to position (x,y).
 o move(EditorObject, int, int)
Edge is not a movable object as items are but when edge is picked (and this method invoked) we toggle the traveled flag of this edge.
 o paint(Graphics)
Paint method for Edge.
 o toString()

Variables

 o fslot
  protected Slot fslot
 o tslot
  protected Slot tslot

Constructors

 o Edge
  public Edge(int id,
              Slot fslot,
              Slot tslot)
This constructor initializes all the fields. It also sets the label for this edge.
Parameters:
g - is the Graph which this edge belongs to.
id - is the id-number of this edge.
fslot - is the slot where this edge starts from.
tslot - is the slot where this edge ends to.
 o Edge
  public Edge(Slot fslot,
              Slot tslot)

Methods

 o getTo
  public Slot getTo()
 o getFrom
  public Slot getFrom()
 o getBounds
  public Rectangle getBounds()
Overrides:
getBounds in class EditorObject
 o move
  public void move(EditorObject obj,
                   int x,
                   int y)
Edge is not a movable object as items are but when edge is picked (and this method invoked) we toggle the traveled flag of this edge.
Overrides:
move in class EditorObject
 o click
  public void click()
This method is implemented to be overridden.
Overrides:
click in class EditorObject
 o inside
  public boolean inside(int x,
                        int y)
This method is invoked by the GraphPanel in order to determine if this edge is "near enough" to position (x,y).
Returns:
true if this edge is "near enought" (some two pixels) to point (x,y).
Overrides:
inside in class EditorObject
 o paint
  public boolean paint(Graphics g)
Paint method for Edge. Draws an solid line between fromSlot and toSlot. If traveled flag is set, the line is thicker.
Returns:
allways true.
Overrides:
paint in class EditorObject
 o toString
  public String toString()
Overrides:
toString in class EditorObject

All Packages  Class Hierarchy  This Package  Previous  Next  Index