uk.ac.starlink.diva
Class DrawFreehandFigure

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.DrawFreehandFigure
All Implemented Interfaces:
CanvasComponent, Figure, ShapedFigure, VisibleComponent, UserObjectContainer, DrawFigure

public class DrawFreehandFigure
extends DrawPathFigure

A figure that displays a polyline that can have its vertices moved, intended for use as a freehand (i.e. many vertices) figure, same as Polyline figure but can be identified as needing different treatment.

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

Field Summary
protected  Polyline2D.Double polyline
          The Polyline that we're using.
 
Fields inherited from class uk.ac.starlink.diva.DrawPathFigure
listeners, transformFreely
 
Constructor Summary
DrawFreehandFigure(double x, double y, Paint fill)
          Create a new polyline with the given origin and colour.
DrawFreehandFigure(double x, double y, Paint fill, float lineWidth, AlphaComposite composite)
          Create a new rectangle with the given origin, colour and linewidth.
DrawFreehandFigure(Polyline2D poly)
          Create a new polyline using the given polyline shape.
DrawFreehandFigure(Polyline2D poly, Paint fill, float lineWidth, AlphaComposite composite)
          Create a new polyline using the given polyline shape, colour and linewidth.
 
Method Summary
 Polyline2D.Double createFreehand(double x, double y)
          Create a polyline and position it at the origin.
 
Methods inherited from class uk.ac.starlink.diva.DrawPathFigure
addListener, fireChanged, fireCreated, fireRemoved, getFillPaint, isTransformFreely, removeListener, setFillPaint, setTransformFreely, setVisible, transform, translate
 
Methods inherited from class diva.canvas.toolbox.PathFigure
getBounds, getComposite, getDashArray, getLineWidth, getShape, getStroke, getStrokePaint, hit, paint, setComposite, setDashArray, setLineWidth, setShape, 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, setShape, setStrokePaint
 
Methods inherited from interface diva.canvas.Figure
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, 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

polyline

protected Polyline2D.Double polyline
The Polyline that we're using.

Constructor Detail

DrawFreehandFigure

public DrawFreehandFigure(Polyline2D poly)
Create a new polyline using the given polyline shape. This has unit-width continuous stroke and no paint pattern.


DrawFreehandFigure

public DrawFreehandFigure(Polyline2D poly,
                          Paint fill,
                          float lineWidth,
                          AlphaComposite composite)
Create a new polyline using the given polyline shape, colour and linewidth.


DrawFreehandFigure

public DrawFreehandFigure(double x,
                          double y,
                          Paint fill)
Create a new polyline with the given origin and colour.


DrawFreehandFigure

public DrawFreehandFigure(double x,
                          double y,
                          Paint fill,
                          float lineWidth,
                          AlphaComposite composite)
Create a new rectangle with the given origin, colour and linewidth.

Method Detail

createFreehand

public Polyline2D.Double createFreehand(double x,
                                        double y)
Create a polyline and position it at the origin.



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