All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.DrawEdgePeer
java.lang.Object
|
+----att.grappa.DrawObjectPeer
|
+----att.grappa.DrawEdgePeer
- public class DrawEdgePeer
- extends DrawObjectPeer
This class provides the basis for actually drawing edge elements on a pane.
Extensions of this class and its subclasses allow for the specific drawing
requirements of a particular edge element. For each DrawEdge
instance and target DrawPane
instance, there is one
DrawEdgePeer
instance.
The size and position of the object are possibly scaled and translated from
the values originally supplied through the element attributes as
a consequence of the characteristics of the DrawPane
.
Certainly the y-axis is flipped to account for the origin at the upper-left
as used by the AWT versus the origin to the lower-left as used by the graph.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
bbox
-
-
endArrow
-
-
lineSize
-
-
polyline
-
-
startArrow
-
-
DrawEdgePeer(DrawEdge, DrawPane)
- Creates a
DrawEdgePeer
related to the supplied DrawEdge
and DrawPane
.
-
draw(Graphics, GraphicContext)
- Draws the edge using the specified graphics information.
-
getBounds()
- Gets the bounds of this peer in terms of the
DrawPane
coordinates.
-
getDrawEdge()
- Get the
DrawEdge
object associated with this peer
-
inPeer(int, int)
- Checks if the supplied co-ordinates are in the specific shape of
this peer.
-
setupPeer(boolean)
- Setup this peer.
polyline
protected Polygon polyline
startArrow
protected Polygon startArrow
endArrow
protected Polygon endArrow
bbox
protected Rectangle bbox
lineSize
protected int lineSize
DrawEdgePeer
public DrawEdgePeer(DrawEdge drawEdge,
DrawPane pane)
- Creates a
DrawEdgePeer
related to the supplied DrawEdge
and DrawPane
.
- Parameters:
- drawEdge - the source object for this peer object
- pane - the pane to use when drawing this peer
inPeer
public boolean inPeer(int x,
int y)
- Checks if the supplied co-ordinates are in the specific shape of
this peer.
- Parameters:
- x - the x co-ordinate to check
- y - the y co-ordinate to check
- Returns:
- true if the co-ordinates lie inside the peer or on its boundary,
false otherwise.
- Overrides:
- inPeer in class DrawObjectPeer
getBounds
public Rectangle getBounds()
- Gets the bounds of this peer in terms of the
DrawPane
coordinates.
- Returns:
- the bounding box of this object
- Overrides:
- getBounds in class DrawObjectPeer
setupPeer
public void setupPeer(boolean setupTextToo)
- Setup this peer.
The setup does the actual co-ordinate mappings from what is available
in the
DrawEdge
object to the DrawPane
co-ordinates.
- Parameters:
- setupTextToo - indicates if text peer should be setup as well
- Overrides:
- setupPeer in class DrawObjectPeer
getDrawEdge
public DrawEdge getDrawEdge()
- Get the
DrawEdge
object associated with this peer
- Returns:
- the associated
DrawEdge
object
draw
public void draw(Graphics gr,
GraphicContext context)
- Draws the edge using the specified graphics information.
- Parameters:
- gr - the AWT graphic context to use for drawing
- context - the Grappa context to use for drawing
- Overrides:
- draw in class DrawObjectPeer
All Packages Class Hierarchy This Package Previous Next Index