uk.ac.starlink.diva
Class InterpolatedCurveManipulator

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.AbstractFigureContainer
          extended by diva.canvas.FigureDecorator
              extended by diva.canvas.interactor.Manipulator
                  extended by uk.ac.starlink.diva.InterpolatedCurveManipulator
All Implemented Interfaces:
CanvasComponent, Figure, FigureContainer, FigureSet, VisibleComponent, UserObjectContainer

public class InterpolatedCurveManipulator
extends Manipulator

A manipulator for InterpolatedCurveFigure figures. This attaches handles to the vertices of the curve and allows them to be moved, the corresponding InterpolatedCurveFigure should then re-draw itself with a new interpolation.

Version:
$Id$
Author:
Peter W. Draper

Field Summary
protected  InterpolatedCurveFigure curve
          The InterpolatedCurveFigure.
protected  InterpolatedCurve2D curve2d
          The InterpolatedCurve2D.
 
Constructor Summary
InterpolatedCurveManipulator()
          Construct a new manipulator that uses rectangular grab-handles.
InterpolatedCurveManipulator(GrabHandleFactory f)
          Construct a new manipulator using the given grab-handle factory.
 
Method Summary
 FigureDecorator newInstance(Figure f)
          Create a new instance of this manipulator.
protected  void orderVertices()
          Make the X vertex coordinates monotonic and re-order the Vertex instances as appropriate.
 void paint(Graphics2D g2d)
          Paint the manipulator.
 void refresh()
          Refresh the underlying InterpolatedCurveFigure.
 void setChild(Figure f)
          Set the child figure.
 
Methods inherited from class diva.canvas.interactor.Manipulator
addGrabHandle, clearGrabHandles, getBounds, getGrabHandleFactory, getHandleInteractor, isRepainting, pick, relocateGrabHandles, removeGrabHandle, repaint, repaint, repaintAlready, setGrabHandleFactory, setHandleFilter, setHandleInteractor, setRepainting
 
Methods inherited from class diva.canvas.FigureDecorator
add, contains, figures, figuresFromBack, figuresFromFront, getChild, getContainer, getDecoratedFigure, getFigureCount, getShape, hit, remove, replaceChild, transform
 
Methods inherited from class diva.canvas.AbstractFigureContainer
decorate, pick, translate, undecorate
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, setInteractor, setParent, setToolTipText, 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.VisibleComponent
isVisible, paint, setVisible
 
Methods inherited from interface diva.canvas.CanvasComponent
getParent, getTransformContext
 

Field Detail

curve

protected InterpolatedCurveFigure curve
The InterpolatedCurveFigure.


curve2d

protected InterpolatedCurve2D curve2d
The InterpolatedCurve2D.

Constructor Detail

InterpolatedCurveManipulator

public InterpolatedCurveManipulator()
Construct a new manipulator that uses rectangular grab-handles.


InterpolatedCurveManipulator

public InterpolatedCurveManipulator(GrabHandleFactory f)
Construct a new manipulator using the given grab-handle factory.

Method Detail

newInstance

public FigureDecorator newInstance(Figure f)
Create a new instance of this manipulator. The new instance will have the same grab handle, and interactor for grab-handles, as this one.

Specified by:
newInstance in class FigureDecorator

refresh

public void refresh()
Refresh the underlying InterpolatedCurveFigure.

Specified by:
refresh in class Manipulator

paint

public void paint(Graphics2D g2d)
Description copied from class: Manipulator
Paint the manipulator. This default implementation first paints the child figure, and then paints each of the grab-handles.

Specified by:
paint in interface VisibleComponent
Overrides:
paint in class Manipulator

setChild

public void setChild(Figure f)
Set the child figure. If we have any grab-handles, lose them and create new ones.

Overrides:
setChild in class FigureDecorator

orderVertices

protected void orderVertices()
Make the X vertex coordinates monotonic and re-order the Vertex instances as appropriate.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.