fcmodeler.view
Class BezierEdgeFigure

java.lang.Object
  |
  +--diva.canvas.AbstractFigure
        |
        +--diva.canvas.connector.AbstractConnector
              |
              +--fcmodeler.view.AbstractEdgeFigure
                    |
                    +--fcmodeler.view.BezierEdgeFigure
All Implemented Interfaces:
diva.canvas.CanvasComponent, diva.canvas.connector.Connector, EdgeFigure, diva.canvas.Figure, PermanentFigure, diva.util.UserObjectContainer, diva.canvas.VisibleComponent

public class BezierEdgeFigure
extends AbstractEdgeFigure

An EdgeFigure implementation providing a Bezier curve line type. Clients should first create an instance of BezierEdgeFigure and then supply the Bezier control points via the setControlPoints method. This class uses the LineShape wrapper class to provide an appropriate line-based Shape object.

Since:
JDK1.3
Version:
$Revision: 1.3 $
Author:
Julie Dickerson , Zach Cox

Constructor Summary
BezierEdgeFigure(diva.canvas.Site tail, diva.canvas.Site head)
          Creates a new BezierEdgeFigure using the given sites.
 
Method Summary
 java.util.List getControlPoints()
          Returns the control points used for this BezierEdgeFigure.
 void route()
          Routes this edge between the tail and head nodes.
 void setControlPoints(java.util.List points)
          Sets the control points of this edge to the points in the specified List.
 void translate(double dx, double dy)
          Translates this edge by the specified x and y coordinates.
 
Methods inherited from class fcmodeler.view.AbstractEdgeFigure
getFigure, getHeadEnd, getPermanentFigure, getTailEnd, setHeadEnd, setTailEnd, usePermanents
 
Methods inherited from class diva.canvas.connector.AbstractConnector
getBounds, getHeadSite, getLineWidth, getPaintedShape, getShape, getStroke, getStrokePaint, getTailSite, headMoved, hit, paint, reroute, setDashArray, setHeadSite, setLineWidth, setStroke, setStrokePaint, setTailSite, tailMoved, transform
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getParent, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setUserObject, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface diva.canvas.connector.Connector
getHeadSite, getTailSite, headMoved, reroute, setHeadSite, setTailSite, tailMoved
 
Methods inherited from interface diva.canvas.Figure
contains, getBounds, getInteractor, getLayer, getShape, hit, intersects, setInteractor, setParent, transform
 
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, paint, setVisible
 
Methods inherited from interface diva.canvas.CanvasComponent
getParent, getTransformContext, repaint, repaint
 
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
 

Constructor Detail

BezierEdgeFigure

public BezierEdgeFigure(diva.canvas.Site tail,
                        diva.canvas.Site head)

Creates a new BezierEdgeFigure using the given sites. The control points are initialized to:

pt1 = tail point
 pt2 = (0,0)
 pt3 = (0,0)
 pt4 = head point
Parameters:
tail - the site on the tail node to connect to.
head - the site on the head node to connect to.
Method Detail

getControlPoints

public java.util.List getControlPoints()
Returns the control points used for this BezierEdgeFigure. The returned List is a copy of the original used in this object.
Returns:
the control points used for this BezierEdgeFigure.

route

public void route()
Routes this edge between the tail and head nodes.
Overrides:
route in class diva.canvas.connector.AbstractConnector

setControlPoints

public void setControlPoints(java.util.List points)
Sets the control points of this edge to the points in the specified List. The List should contain 3n+1 Point2D objects, where n is the number of Bezier curve sections.
Parameters:
points - the new control points for this BezierEdgeFigure.
Throws:
java.lang.IllegalArgumentException - if
points.size() < 4
or
points.size() % 3 != 1
.

translate

public void translate(double dx,
                      double dy)

Translates this edge by the specified x and y coordinates.

Currently just throws an UnsupportedOperationException, as this method never even seems to get called and edge translation is not yet well-defined.

Overrides:
translate in class diva.canvas.connector.AbstractConnector
Parameters:
dx - the x-distance to translate.
dy - the y-distance to translate.