uk.ac.starlink.diva
Class InterpolatedCurveFigure

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.toolbox.PathFigure
          extended by uk.ac.starlink.diva.DrawPathFigure
              extended by uk.ac.starlink.diva.InterpolatedCurveFigure
All Implemented Interfaces:
CanvasComponent, Figure, ShapedFigure, VisibleComponent, UserObjectContainer, DrawFigure

public class InterpolatedCurveFigure
extends DrawPathFigure

A figure that displays a InterpolatedCurve that can have its vertices moved.

Version:
$Id$
Author:
Peter W. Draper
See Also:
DrawPathFigure

Field Summary
protected  InterpolatedCurve2D curve
          The InterpolatedCurve that we're using.
 
Fields inherited from class uk.ac.starlink.diva.DrawPathFigure
listeners, transformFreely
 
Constructor Summary
InterpolatedCurveFigure(InterpolatedCurve2D curve)
          Copy constructor.
InterpolatedCurveFigure(InterpolatedCurve2D curve, Paint outline, float lineWidth, AlphaComposite composite)
          Copy constructor, but using the given shape, colour, linewidth and composite.
InterpolatedCurveFigure(Interpolator interpolator, double x, double y, Paint outline)
          Create a new instance with the given origin and colour.
InterpolatedCurveFigure(Interpolator interpolator, double x, double y, Paint outline, float lineWidth, AlphaComposite composite)
          Create a new instance with the given origin, colour and linewidth.
 
Method Summary
 InterpolatedCurve2D createInterpolatedCurve(Interpolator interpolator, double x, double y)
          Create an instance and position it at the origin.
 boolean hit(Rectangle2D r)
          Test if this figure intersects the given rectangle.
 void setShape(Shape shape)
          Set the shape of this figure.
 void transform(AffineTransform at)
          Transform the figure with the supplied transform.
 void translate(double x, double y)
          Translate the figure with by the given distance.
 
Methods inherited from class uk.ac.starlink.diva.DrawPathFigure
addListener, fireChanged, fireCreated, fireRemoved, getFillPaint, isTransformFreely, removeListener, setFillPaint, setTransformFreely, setVisible
 
Methods inherited from class diva.canvas.toolbox.PathFigure
getBounds, getComposite, getDashArray, getLineWidth, getShape, getStroke, getStrokePaint, paint, setComposite, setDashArray, setLineWidth, setStroke, setStrokePaint
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.diva.DrawFigure
getComposite, getLineWidth, getStrokePaint, setComposite, setLineWidth, setStrokePaint
 
Methods inherited from interface diva.canvas.Figure
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, intersects, setInteractor, setParent, setToolTipText
 
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, paint
 
Methods inherited from interface diva.canvas.CanvasComponent
getTransformContext, repaint, repaint
 
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
 

Field Detail

curve

protected InterpolatedCurve2D curve
The InterpolatedCurve that we're using.

Constructor Detail

InterpolatedCurveFigure

public InterpolatedCurveFigure(InterpolatedCurve2D curve)
Copy constructor. This has unit-width continuous stroke and no paint pattern.


InterpolatedCurveFigure

public InterpolatedCurveFigure(InterpolatedCurve2D curve,
                               Paint outline,
                               float lineWidth,
                               AlphaComposite composite)
Copy constructor, but using the given shape, colour, linewidth and composite.


InterpolatedCurveFigure

public InterpolatedCurveFigure(Interpolator interpolator,
                               double x,
                               double y,
                               Paint outline)
Create a new instance with the given origin and colour.


InterpolatedCurveFigure

public InterpolatedCurveFigure(Interpolator interpolator,
                               double x,
                               double y,
                               Paint outline,
                               float lineWidth,
                               AlphaComposite composite)
Create a new instance with the given origin, colour and linewidth.

Method Detail

createInterpolatedCurve

public InterpolatedCurve2D createInterpolatedCurve(Interpolator interpolator,
                                                   double x,
                                                   double y)
Create an instance and position it at the origin.


transform

public void transform(AffineTransform at)
Description copied from class: DrawPathFigure
Transform the figure with the supplied transform.

Specified by:
transform in interface Figure
Overrides:
transform in class DrawPathFigure

translate

public void translate(double x,
                      double y)
Description copied from class: DrawPathFigure
Translate the figure with by the given distance.

Specified by:
translate in interface Figure
Overrides:
translate in class DrawPathFigure

hit

public boolean hit(Rectangle2D r)
Description copied from class: PathFigure
Test if this figure intersects the given rectangle. If the figure is not visible, always return false.

Specified by:
hit in interface Figure
Overrides:
hit in class PathFigure

setShape

public void setShape(Shape shape)
Description copied from class: PathFigure
Set the shape of this figure.

Specified by:
setShape in interface ShapedFigure
Specified by:
setShape in interface DrawFigure
Overrides:
setShape in class PathFigure


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