uk.ac.starlink.diva
Class DrawPolygonFigure

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

public class DrawPolygonFigure
extends DrawBasicFigure

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

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

Field Summary
protected  Polygon2D.Double polygon
          The Polygon that we're using.
 
Fields inherited from class uk.ac.starlink.diva.DrawBasicFigure
listeners, transformFreely
 
Constructor Summary
DrawPolygonFigure(double x, double y, Paint fill, float lineWidth)
          Create a new polyline with the given origin, colour and linewidth.
DrawPolygonFigure(double x, double y, Paint fill, Paint outline, float lineWidth, AlphaComposite composite)
          Create a new polygon with the given origin and colour.
DrawPolygonFigure(Polygon2D poly)
          Create a new polygon using the given polygon shape.
DrawPolygonFigure(Polygon2D poly, Paint fill, Paint outline, float lineWidth, AlphaComposite composite)
          Create a new polygon using the given polygon shape, colour, fill and linewidth.
 
Method Summary
 Polygon2D.Double createPolygon(double x, double y)
          Create a polygon and position it at the origin.
 
Methods inherited from class uk.ac.starlink.diva.DrawBasicFigure
addListener, fireChanged, fireCreated, fireRemoved, isTransformFreely, removeListener, setTransformFreely, setVisible, transform, translate
 
Methods inherited from class diva.canvas.toolbox.BasicFigure
getBounds, getComposite, getDashArray, getFillPaint, getLineWidth, getShape, getStrokePaint, hit, paint, setComposite, setDashArray, setFillPaint, 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, getFillPaint, getLineWidth, getStrokePaint, setComposite, setFillPaint, 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

polygon

protected Polygon2D.Double polygon
The Polygon that we're using.

Constructor Detail

DrawPolygonFigure

public DrawPolygonFigure(Polygon2D poly)
Create a new polygon using the given polygon shape. This has unit-width continuous stroke and no paint pattern.


DrawPolygonFigure

public DrawPolygonFigure(Polygon2D poly,
                         Paint fill,
                         Paint outline,
                         float lineWidth,
                         AlphaComposite composite)
Create a new polygon using the given polygon shape, colour, fill and linewidth.


DrawPolygonFigure

public DrawPolygonFigure(double x,
                         double y,
                         Paint fill,
                         Paint outline,
                         float lineWidth,
                         AlphaComposite composite)
Create a new polygon with the given origin and colour.


DrawPolygonFigure

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

Method Detail

createPolygon

public Polygon2D.Double createPolygon(double x,
                                      double y)
Create a polygon and position it at the origin.



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