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

Variable Index

 o arrowLength
Arrow head length
 o arrowWidth
Arrow head width
 o defaultEdgeClassName
Default edge representation class name.
 o drawShape
The actual shape used for drawing.
 o LINE
Indicator for line
 o shape
Defines the drawing style of the node; its value is set when the class object is created
 o SPLINE
Indicator for spline (bezier)
 o totalPoints
Total number of specified points.

Constructor Index

 o DrawEdge()
This constructor creates an uninitialized DrawEdge with a default set of attributes that it will observe (in its role as an Observer)

Method Index

 o createPeer(DrawPane)
Creates the drawing peer specific for this object and the specified pane.
 o getEdgePolygon()
Returns the polygon enclosing the edge.
 o getEndArrow()
Gets the polygon representing the arrow at the tail-end of the edge.
 o getLineStyle()
Get the line style value of the edge.
 o getLineWidth()
Get the line width value of the edge.
 o getStartArrow()
Gets the polygon representing the arrow at the head-end of the edge.
 o pointsChanged(Point, Point, LineVector)
Checks if the current edge co-ordinates are different from those supplied.
 o positionString()
Constructs a position string representation of the edge points.
 o setBounds()
This method to be called when the bounding box needs to be calculated.
 o setPoints(Point, Point, LineVector)
Sets the points describing the edge.
 o update(Observable, Object)
This method is called whenever an observed Attribute is changed.

Variables

 o arrowLength
 public static final int arrowLength
Arrow head length

 o arrowWidth
 public static final int arrowWidth
Arrow head width

 o defaultEdgeClassName
 public static final String defaultEdgeClassName
Default edge representation class name.

 o SPLINE
 protected static final int SPLINE
Indicator for spline (bezier)

 o LINE
 protected static final int LINE
Indicator for line

 o shape
 protected int shape
Defines the drawing style of the node; its value is set when the class object is created

 o totalPoints
 protected int totalPoints
Total number of specified points.

 o 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.

Constructors

 o 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

Methods

 o 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
 o getEdgePolygon
 public Polygon getEdgePolygon()
Returns the polygon enclosing the edge.

Returns:
the edge polygon.
 o 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.
 o 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.
 o 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
 o 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
 o 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
 o 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
 o 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
 o getLineWidth
 public int getLineWidth()
Get the line width value of the edge.

Returns:
the line width
 o 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