All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.DrawEdge
java.lang.Object
|
+----att.grappa.DrawObject
|
+----att.grappa.DrawEdge
- public class DrawEdge
- extends DrawObject
This class provides the basis for the drawing of edges.
Extensions of this class and its subclasses allow the drawing of edges
to be customized.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
arrowLength
- Arrow head length
-
arrowWidth
- Arrow head width
-
defaultEdgeClassName
- Default edge representation class name.
-
drawShape
- The actual shape used for drawing.
-
LINE
- Indicator for line
-
shape
- Defines the drawing style of the node; its
value is set when the class object is created
-
SPLINE
- Indicator for spline (bezier)
-
totalPoints
- Total number of specified points.
-
DrawEdge()
- This constructor creates an uninitialized
DrawEdge
with a default
set of attributes that it will observe (in its role as an Observer)
-
createPeer(DrawPane)
- Creates the drawing peer specific for this object and the specified pane.
-
getEdgePolygon()
- Returns the polygon enclosing the edge.
-
getEndArrow()
- Gets the polygon representing the arrow at the tail-end of the edge.
-
getLineStyle()
- Get the line style value of the edge.
-
getLineWidth()
- Get the line width value of the edge.
-
getStartArrow()
- Gets the polygon representing the arrow at the head-end of the edge.
-
pointsChanged(Point, Point, LineVector)
- Checks if the current edge co-ordinates are different from those supplied.
-
positionString()
- Constructs a position string representation of the edge points.
-
setBounds()
- This method to be called when the bounding box needs to be calculated.
-
setPoints(Point, Point, LineVector)
- Sets the points describing the edge.
-
update(Observable, Object)
- This method is called whenever an observed Attribute is changed.
arrowLength
public static final int arrowLength
- Arrow head length
arrowWidth
public static final int arrowWidth
- Arrow head width
defaultEdgeClassName
public static final String defaultEdgeClassName
- Default edge representation class name.
SPLINE
protected static final int SPLINE
- Indicator for spline (bezier)
LINE
protected static final int LINE
- Indicator for line
shape
protected int shape
- Defines the drawing style of the node; its
value is set when the class object is created
totalPoints
protected int totalPoints
- Total number of specified points.
drawShape
protected int drawShape
- The actual shape used for drawing.
This value may differ from
shape
since
setBounds()
may alter the value of
drawShape
from that
of shape
to use based on the number
of supplied points.
DrawEdge
public DrawEdge()
- This constructor creates an uninitialized
DrawEdge
with a default
set of attributes that it will observe (in its role as an Observer)
- See Also:
- Observer
setBounds
public Rectangle setBounds()
- This method to be called when the bounding box needs to be calculated.
- Returns:
- a rectangle representing the bounding box of the object in its
original co-ordinates
- Overrides:
- setBounds in class DrawObject
getEdgePolygon
public Polygon getEdgePolygon()
- Returns the polygon enclosing the edge.
- Returns:
- the edge polygon.
getStartArrow
public Polygon getStartArrow()
- Gets the polygon representing the arrow at the head-end of the edge.
- Returns:
- the outline of the head-end arrow or null.
getEndArrow
public Polygon getEndArrow()
- Gets the polygon representing the arrow at the tail-end of the edge.
- Returns:
- the outline of the tail-end arrow or null.
pointsChanged
public boolean pointsChanged(Point oldSPoint,
Point oldEPoint,
LineVector oldPoints)
- Checks if the current edge co-ordinates are different from those supplied.
- Parameters:
- oldSPoint - the head-end point to compare
- oldEPoint - the tail-end point to compare
- oldPoints - the control points to compare
- Returns:
- true if the points are different, false otherwise
setPoints
public void setPoints(Point newSPoint,
Point newEPoint,
LineVector newPoints)
- Sets the points describing the edge.
- Parameters:
- newSPoint - the new head-end point
- newEPoint - the new tail-end point
- newPoints - the new control points
positionString
public String positionString()
- Constructs a position string representation of the edge points.
- Returns:
- a position string representation of the edge points suitable
for the value of the "pos" attribute
update
public void update(Observable obs,
Object arg)
- This method is called whenever an observed Attribute is changed.
It is required by the
Observer
interface.
- Parameters:
- obs - the observable object that has been updated
- arg - when not null, it indicates that
obs
need no longer be
observed and in its place arg
should be observed.
- Overrides:
- update in class DrawObject
createPeer
public void createPeer(DrawPane pane)
- Creates the drawing peer specific for this object and the specified pane.
- Parameters:
- pane - the
DrawPane
upon which the object will be drawn.
- Overrides:
- createPeer in class DrawObject
getLineWidth
public int getLineWidth()
- Get the line width value of the edge.
- Returns:
- the line width
getLineStyle
public int getLineStyle()
- Get the line style value of the edge.
- Returns:
- the style width
All Packages Class Hierarchy This Package Previous Next Index