All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.DrawSubgraphPeer
java.lang.Object
|
+----att.grappa.DrawObjectPeer
|
+----att.grappa.DrawSubgraphPeer
- public class DrawSubgraphPeer
- extends DrawObjectPeer
This class provides the basis for actually drawing subgraph elements on a pane.
For each DrawSubgraph
instance and target DrawPane
instance, there is one
DrawSubgraphPeer
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
-
DrawSubgraphPeer(DrawSubgraph, DrawPane)
- Create an instance of a
DrawSubgraphPeer
related to the supplied DrawSubgraph
and DrawPane
.
-
draw(Graphics, GraphicContext)
- Draws the subgraph using the specified graphics information.
-
getBounds()
- Gets the bounds of this peer in terms of the
DrawPane
coordinates.
-
inPeer(int, int)
- Checks if the supplied co-ordinates are in the specific shape of
this peer.
-
setupPeer(boolean)
- Setup this peer.
DrawSubgraphPeer
public DrawSubgraphPeer(DrawSubgraph drawSubgraph,
DrawPane pane)
- Create an instance of a
DrawSubgraphPeer
related to the supplied DrawSubgraph
and DrawPane
.
- Parameters:
- drawSubgraph - 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 the peer
- 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
DrawNode
object to the DrawPane
co-ordinates.
- Parameters:
- setupTextToo - indicates if text peer should be setup as well
- Overrides:
- setupPeer in class DrawObjectPeer
draw
public void draw(Graphics gr,
GraphicContext context)
- Draws the subgraph using the specified graphics information.
- Parameters:
- gr - the AWT graphics context to use for drawing, if the value
is null, then the off-screen canvas
Graphics
is used.
- context - the graphic context to use when drawing.
If the context is null, the object's context is used.
- Overrides:
- draw in class DrawObjectPeer
All Packages Class Hierarchy This Package Previous Next Index