uk.ac.starlink.diva
Class DrawFigureFactory

java.lang.Object
  extended by uk.ac.starlink.diva.DrawFigureFactory

public class DrawFigureFactory
extends Object

This class creates and enumerates the possible instance of Figures that can be created on an instance of Draw for use with a DrawActions instance.

Version:
$Id$
Author:
Peter W. Draper

Field Summary
static int CURVE
           
static int ELLIPSE
           
static int FREEHAND
           
static int LINE
           
static int NUM_FIGURES
          Number of figure types supported
static int POLYGON
           
static int POLYLINE
           
static int RECTANGLE
           
static String[] SHORTNAMES
          Simple names for the various figures
static int TEXT
           
static int XRANGE
           
 
Method Summary
 DrawFigure create(FigureProps props)
          Create a DrawFigure using the specified properties to initialise it.
 DrawFigure create(int type, FigureProps props)
          Create a Figure of the given type using the specified properties to initialise it.
 DrawFigure createCurve(double x1, double y1, Interpolator interpolator, Paint outline, double thickness, AlphaComposite composite)
          Create a curve DrawFigure using the given parameters
 DrawFigure createCurve(FigureProps props)
          Create a curve DrawFigure using the given properties
 DrawFigure createEllipse(double x, double y, double width, double height, Paint outline, Paint fill, double thickness, AlphaComposite composite)
          Create an ellipse DrawFigure using the given parameters
 DrawFigure createEllipse(FigureProps props)
          Create an ellipse DrawFigure using the given properties
 DrawFigure createFreehand(double[] x, double[] y, Paint outline, double thickness, AlphaComposite composite)
          Create a freehand DrawFigure using the given parameters
 DrawFigure createFreehand(double x, double y, Paint outline, double thickness, AlphaComposite composite)
          Create a freehand DrawFigure using the given parameters
 DrawFigure createFreehand(FigureProps props)
          Create a freehand DrawFigure using the given properties
 DrawFigure createLine(double x1, double y1, double x2, double y2)
          Create a line DrawFigure using the given parameters
 DrawFigure createLine(double x1, double y1, double x2, double y2, Paint outline, double thickness, AlphaComposite composite)
          Create a line DrawFigure using the given parameters
 DrawFigure createLine(FigureProps props)
          Create a line DrawFigure using the given properties
 DrawFigure createPolygon(double[] x, double[] y, Paint fill, Paint outline, double thickness, AlphaComposite composite)
          Create a polygon DrawFigure using the given parameters
 DrawFigure createPolygon(double x, double y, Paint fill, Paint outline, double thickness, AlphaComposite composite)
          Create a polygon DrawFigure using the given parameters
 DrawFigure createPolygon(FigureProps props)
          Create a polygon DrawFigure using the given properties
 DrawFigure createPolyline(double[] x, double[] y, Paint outline, double thickness, AlphaComposite composite)
          Create a polyline DrawFigure using the given parameters
 DrawFigure createPolyline(double x, double y, Paint outline, double thickness, AlphaComposite composite)
          Create a polyline DrawFigure using the given parameters
 DrawFigure createPolyline(FigureProps props)
          Create a polyline DrawFigure using the given properties
 DrawFigure createRectangle(double x, double y, double width, double height, Paint outline, Paint fill, double thickness, AlphaComposite composite)
          Create a line DrawFigure using the given parameters
 DrawFigure createRectangle(FigureProps props)
          Create a rectangle DrawFigure using the given properties
 DrawFigure createText(double x, double y, double width, double height, String text, Paint fill, Font font, AlphaComposite composite)
          Create a text DrawFigure using the given parameters, width and height indicate that some "size" is required.
 DrawFigure createText(FigureProps props)
          Create a text DrawFigure using the given properties
 DrawFigure createXRange(double x, double y, double width, double height, Paint fill, Paint outline, double thickness, AlphaComposite composite)
          Create an XRangeFigure DrawFigure using the given parameters
 DrawFigure createXRange(FigureProps props)
          Create an XRangeFigure DrawFigure using the given properties
 FigureProps getFigureProps(DrawFigure figure)
          Create a FigureProps instance that describes the given DrawFigure.
static DrawFigureFactory getReference()
          Return reference to the only allowed instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE

public static final int LINE
See Also:
Constant Field Values

RECTANGLE

public static final int RECTANGLE
See Also:
Constant Field Values

ELLIPSE

public static final int ELLIPSE
See Also:
Constant Field Values

POLYLINE

public static final int POLYLINE
See Also:
Constant Field Values

POLYGON

public static final int POLYGON
See Also:
Constant Field Values

FREEHAND

public static final int FREEHAND
See Also:
Constant Field Values

TEXT

public static final int TEXT
See Also:
Constant Field Values

CURVE

public static final int CURVE
See Also:
Constant Field Values

XRANGE

public static final int XRANGE
See Also:
Constant Field Values

SHORTNAMES

public static final String[] SHORTNAMES
Simple names for the various figures


NUM_FIGURES

public static final int NUM_FIGURES
Number of figure types supported

Method Detail

getReference

public static DrawFigureFactory getReference()
Return reference to the only allowed instance of this class.

Returns:
reference to only instance of this class.

create

public DrawFigure create(int type,
                         FigureProps props)
Create a Figure of the given type using the specified properties to initialise it.


create

public DrawFigure create(FigureProps props)
Create a DrawFigure using the specified properties to initialise it.


createLine

public DrawFigure createLine(FigureProps props)
Create a line DrawFigure using the given properties


createLine

public DrawFigure createLine(double x1,
                             double y1,
                             double x2,
                             double y2,
                             Paint outline,
                             double thickness,
                             AlphaComposite composite)
Create a line DrawFigure using the given parameters


createLine

public DrawFigure createLine(double x1,
                             double y1,
                             double x2,
                             double y2)
Create a line DrawFigure using the given parameters


createRectangle

public DrawFigure createRectangle(FigureProps props)
Create a rectangle DrawFigure using the given properties


createRectangle

public DrawFigure createRectangle(double x,
                                  double y,
                                  double width,
                                  double height,
                                  Paint outline,
                                  Paint fill,
                                  double thickness,
                                  AlphaComposite composite)
Create a line DrawFigure using the given parameters


createEllipse

public DrawFigure createEllipse(FigureProps props)
Create an ellipse DrawFigure using the given properties


createEllipse

public DrawFigure createEllipse(double x,
                                double y,
                                double width,
                                double height,
                                Paint outline,
                                Paint fill,
                                double thickness,
                                AlphaComposite composite)
Create an ellipse DrawFigure using the given parameters


createPolyline

public DrawFigure createPolyline(FigureProps props)
Create a polyline DrawFigure using the given properties


createPolyline

public DrawFigure createPolyline(double x,
                                 double y,
                                 Paint outline,
                                 double thickness,
                                 AlphaComposite composite)
Create a polyline DrawFigure using the given parameters


createPolyline

public DrawFigure createPolyline(double[] x,
                                 double[] y,
                                 Paint outline,
                                 double thickness,
                                 AlphaComposite composite)
Create a polyline DrawFigure using the given parameters


createPolygon

public DrawFigure createPolygon(FigureProps props)
Create a polygon DrawFigure using the given properties


createPolygon

public DrawFigure createPolygon(double x,
                                double y,
                                Paint fill,
                                Paint outline,
                                double thickness,
                                AlphaComposite composite)
Create a polygon DrawFigure using the given parameters


createPolygon

public DrawFigure createPolygon(double[] x,
                                double[] y,
                                Paint fill,
                                Paint outline,
                                double thickness,
                                AlphaComposite composite)
Create a polygon DrawFigure using the given parameters


createFreehand

public DrawFigure createFreehand(FigureProps props)
Create a freehand DrawFigure using the given properties


createFreehand

public DrawFigure createFreehand(double x,
                                 double y,
                                 Paint outline,
                                 double thickness,
                                 AlphaComposite composite)
Create a freehand DrawFigure using the given parameters


createFreehand

public DrawFigure createFreehand(double[] x,
                                 double[] y,
                                 Paint outline,
                                 double thickness,
                                 AlphaComposite composite)
Create a freehand DrawFigure using the given parameters


createText

public DrawFigure createText(FigureProps props)
Create a text DrawFigure using the given properties


createText

public DrawFigure createText(double x,
                             double y,
                             double width,
                             double height,
                             String text,
                             Paint fill,
                             Font font,
                             AlphaComposite composite)
Create a text DrawFigure using the given parameters, width and height indicate that some "size" is required.


createCurve

public DrawFigure createCurve(FigureProps props)
Create a curve DrawFigure using the given properties


createCurve

public DrawFigure createCurve(double x1,
                              double y1,
                              Interpolator interpolator,
                              Paint outline,
                              double thickness,
                              AlphaComposite composite)
Create a curve DrawFigure using the given parameters


createXRange

public DrawFigure createXRange(FigureProps props)
Create an XRangeFigure DrawFigure using the given properties


createXRange

public DrawFigure createXRange(double x,
                               double y,
                               double width,
                               double height,
                               Paint fill,
                               Paint outline,
                               double thickness,
                               AlphaComposite composite)
Create an XRangeFigure DrawFigure using the given parameters


getFigureProps

public FigureProps getFigureProps(DrawFigure figure)
Create a FigureProps instance that describes the given DrawFigure.



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