org.tigris.gef.presentation
Class FigSpline

java.lang.Object
  extended by org.tigris.gef.presentation.Fig
      extended by org.tigris.gef.presentation.FigPoly
          extended by org.tigris.gef.presentation.FigSpline
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, PopupGenerator

public class FigSpline
extends FigPoly

See Also:
Serialized Form

Field Summary
protected  java.awt.Polygon _curve
           
protected  double _d_curve_length
           
protected  double _delta0
           
protected  double _delta1
           
protected  double _denom
           
protected  double _junc_t
           
protected  int _juncX
           
protected  int _juncY
           
protected  int _nknots
           
protected  int _pattern
           
protected  java.util.BitSet _style
           
protected  int _threshold
           
protected  int[] _xknots
           
protected  int[] _yknots
           
protected  int ARR_HEIGHT
           
protected  int ARR_WIDTH
           
protected  int SPLINE_THRESH
           
 
Fields inherited from class org.tigris.gef.presentation.FigPoly
_fixedHandles, _isComplete, _isSelfLoop, _npoints, _rectilinear, _xpoints, _ypoints, FUDGEFACTOR
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE
 
Constructor Summary
FigSpline()
           
FigSpline(java.awt.Color line_color)
           
FigSpline(java.awt.Color line_color, java.awt.Color fill_color)
           
FigSpline(int x, int y)
           
 
Method Summary
 void addPoint(int x, int y)
          Add a point to this polygon.
 void appendTwoPoints()
          Add two points at the end of the polygon.
 void cleanUp()
           
protected  void drawBezier(java.awt.Graphics g, int x1, int y1, int x2, int y2, int x3, int y3)
           
protected  void drawCurve(java.awt.Graphics g)
           
protected  void drawStraight(java.awt.Graphics g)
           
protected  void growIfNeeded()
          Increase the memory used to store polygon points, if needed.
 void insertPoint(int i, int x, int y)
          Inserts a point at index i.
 void moveVertex(Handle h, int x, int y, boolean ov)
          Move the point indicated by the given Handle object to the given location.
 void paint(java.awt.Graphics g)
          Paint the FigPoly on the given Graphics
 void prependTwoPoints()
          Add two points to the front of the list of points.
 void removePoint(int i)
          Removes the point at index i.
protected  void setCount()
           
protected  void setJunctionPoint(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y)
           
protected  void setSpline()
           
 void translate(int dx, int dy)
          Change the position of the object from were it is to were it is plus dx or dy.
 
Methods inherited from class org.tigris.gef.presentation.FigPoly
addPoint, calcBounds, canMoveVertex, clone, contains, countCornersContained, drawDashedPerimeter, findHandle, getClosestPoint, getFirstPoint, getFixedHandles, getGravityPoints, getLastPoint, getNumPoints, getPerimeterLength, getPoint, getPoints, getPointsList, getPolygon, getRectilinear, getXs, getYs, hit, intersectsPerimeter, isPerimeterClosed, isReshapable, isResizable, isRotatable, isSelfLoop, OK, setBounds, setEndPoints, setFixedHandles, setPoints, setPolygon, setRectilinear, setSelfLoop, stuffPointAlongPerimeter
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPropertyChangeListener, align, center, classNameAndBounds, connectionPoint, contains, contains, createDrag, damage, deleteFromModel, drawDashedLine, endTrans, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getBounds, getContext, getDashed, getDashed01, getDashedString, getEnclosedFigs, getEnclosingFig, getFillColor, getFilled, getFilled01, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLayer, getLineColor, getLineWidth, getLocation, getLocked, getMinimumSize, getOwner, getPopUpActions, getPreferredSize, getPrivateData, getResource, getSingle, getSize, getTipString, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getY, hasFillColor, hasLineColor, initAnnotations, intersects, isAnnotation, isCopyable, isCutable, isLowerRightResizable, isMovable, isSelected, isVisible, makeSelection, pointAlongPerimeter, postLoad, postSave, preSave, print, propertyChange, redraw, removeAnnotation, removeAnnotation, removeFromDiagram, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setCenter, setContext, setDashed, setDashedString, setEnclosingFig, setFillColor, setFilled, setGroup, setHandleBox, setHeight, setLayer, setLineColor, setLineWidth, setLocation, setLocation, setLocked, setMovable, setNumPoints, setOwner, setPoint, setPoint, setPoint, setPoint, setPoints, setPrivateData, setResizable, setResource, setSavingAllowed, setSingle, setSize, setSize, setVisible, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, translateAnnotations, unsetAnnotationOwner, updateAnnotationPositions, updateVisState, within
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_xknots

protected int[] _xknots

_yknots

protected int[] _yknots

_nknots

protected int _nknots

_curve

protected java.awt.Polygon _curve

_threshold

protected int _threshold

SPLINE_THRESH

protected int SPLINE_THRESH

ARR_WIDTH

protected int ARR_WIDTH

ARR_HEIGHT

protected int ARR_HEIGHT

_junc_t

protected double _junc_t

_delta0

protected double _delta0

_delta1

protected double _delta1

_denom

protected double _denom

_d_curve_length

protected double _d_curve_length

_juncX

protected int _juncX

_juncY

protected int _juncY

_pattern

protected int _pattern

_style

protected java.util.BitSet _style
Constructor Detail

FigSpline

public FigSpline()

FigSpline

public FigSpline(int x,
                 int y)

FigSpline

public FigSpline(java.awt.Color line_color)

FigSpline

public FigSpline(java.awt.Color line_color,
                 java.awt.Color fill_color)
Method Detail

addPoint

public void addPoint(int x,
                     int y)
Description copied from class: FigPoly
Add a point to this polygon. Fires PropertyChange with "bounds".

Overrides:
addPoint in class FigPoly

appendTwoPoints

public void appendTwoPoints()
Description copied from class: FigPoly
Add two points at the end of the polygon. Needed if the user drags a point just before a fixed handle.

Overrides:
appendTwoPoints in class FigPoly

cleanUp

public void cleanUp()
Overrides:
cleanUp in class FigPoly

drawBezier

protected void drawBezier(java.awt.Graphics g,
                          int x1,
                          int y1,
                          int x2,
                          int y2,
                          int x3,
                          int y3)

drawCurve

protected void drawCurve(java.awt.Graphics g)

drawStraight

protected void drawStraight(java.awt.Graphics g)

growIfNeeded

protected void growIfNeeded()
Description copied from class: FigPoly
Increase the memory used to store polygon points, if needed.

Overrides:
growIfNeeded in class FigPoly

insertPoint

public void insertPoint(int i,
                        int x,
                        int y)
Description copied from class: FigPoly
Inserts a point at index i. Needs-More-Work: this can mess up rectilinear polygons so that they have one non-rectilinear segment. Fires PropertyChange with "bounds".

Overrides:
insertPoint in class FigPoly

moveVertex

public void moveVertex(Handle h,
                       int x,
                       int y,
                       boolean ov)
Description copied from class: FigPoly
Move the point indicated by the given Handle object to the given location. Fixed handles cannot be moved, unless ov is set to true to override the fixed handle constaint. Fires PropertyChange with "bounds".

Overrides:
moveVertex in class FigPoly

paint

public void paint(java.awt.Graphics g)
Description copied from class: FigPoly
Paint the FigPoly on the given Graphics

Overrides:
paint in class FigPoly

prependTwoPoints

public void prependTwoPoints()
Description copied from class: FigPoly
Add two points to the front of the list of points. Needed to introduce new handles at the front of the polygon when the user drags a point just after a fixed handle.

Overrides:
prependTwoPoints in class FigPoly

removePoint

public void removePoint(int i)
Description copied from class: FigPoly
Removes the point at index i. Needs-More-Work: this can mess up rectilinear polygons so that they have one non-rectilinear segment. Fires PropertyChange with "bounds".

Overrides:
removePoint in class FigPoly

setCount

protected void setCount()

setJunctionPoint

protected void setJunctionPoint(int p1x,
                                int p1y,
                                int p2x,
                                int p2y,
                                int p3x,
                                int p3y)

setSpline

protected void setSpline()

translate

public void translate(int dx,
                      int dy)
Description copied from class: FigPoly
Change the position of the object from were it is to were it is plus dx or dy. Often called when an object is dragged. This could be very useful if local-coordinate systems are used because deltas need less transforming... maybe. Fires PropertyChange with "bounds".

Overrides:
translate in class FigPoly