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.
-
fslot
-
-
tslot
-
-
Edge(int, Slot, Slot)
-
This constructor initializes all the fields.
-
Edge(Slot, Slot)
-
-
click()
-
This method is implemented to be overridden.
-
getBounds()
-
-
getFrom()
-
-
getTo()
-
-
inside(int, int)
- This method is invoked by the GraphPanel in order to determine if
this edge is "near enough" to position (x,y).
-
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.
-
paint(Graphics)
-
Paint method for Edge.
-
toString()
-
fslot
protected Slot fslot
tslot
protected Slot tslot
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.
Edge
public Edge(Slot fslot,
Slot tslot)
getTo
public Slot getTo()
getFrom
public Slot getFrom()
getBounds
public Rectangle getBounds()
- Overrides:
- getBounds in class EditorObject
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
click
public void click()
- This method is implemented to be overridden.
- Overrides:
- click in class EditorObject
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
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
toString
public String toString()
- Overrides:
- toString in class EditorObject
All Packages Class Hierarchy This Package Previous Next Index