uk.ac.starlink.diva
Class DrawRectangleFigure
java.lang.Object
diva.canvas.AbstractFigure
diva.canvas.toolbox.BasicFigure
uk.ac.starlink.diva.DrawBasicFigure
uk.ac.starlink.diva.DrawRectangleFigure
- All Implemented Interfaces:
- CanvasComponent, Figure, ShapedFigure, VisibleComponent, UserObjectContainer, DrawFigure
public class DrawRectangleFigure
- extends DrawBasicFigure
A figure that displays as a rectangle. This is a convenience class
for creating rectangles. It inherits from DrawBasicFigure, and so
contains a single Rectangle2D as its shape. It provides a useful
set of constructors.
Changed by Peter W. Draper to inherit from DrawBasicFigure so we
can use it on Draw
implementations.
- Version:
- $Revision$, $Id$
- Author:
- John Reekie, Peter W. Draper
- See Also:
Draw
Constructor Summary |
DrawRectangleFigure(double x,
double y,
double width,
double height)
Create a new rectangle with the given origin and size, a
unit-width continuous stroke and no paint pattern. |
DrawRectangleFigure(double x,
double y,
double width,
double height,
float lineWidth)
Create a new rectangle with the given origin, size, and
outline width. |
DrawRectangleFigure(double x,
double y,
double width,
double height,
Paint fill)
Create a new rectangle with the given origin, size, and
fill paint. |
DrawRectangleFigure(double x,
double y,
double width,
double height,
Paint fill,
Paint outline,
float lineWidth,
AlphaComposite composite)
Create a new rectangle with the given origin, size, fill, and
outline width. |
DrawRectangleFigure(Rectangle2D rect)
Create a new rectangle with the given rectangle shape, a
unit-width continuous stroke and no paint pattern. |
Method Summary |
void |
translate(double x,
double y)
Translate the rectangle the given distance |
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 diva.canvas.Figure |
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipText |
DrawRectangleFigure
public DrawRectangleFigure(Rectangle2D rect)
- Create a new rectangle with the given rectangle shape, a
unit-width continuous stroke and no paint pattern.
DrawRectangleFigure
public DrawRectangleFigure(double x,
double y,
double width,
double height)
- Create a new rectangle with the given origin and size, a
unit-width continuous stroke and no paint pattern.
DrawRectangleFigure
public DrawRectangleFigure(double x,
double y,
double width,
double height,
Paint fill)
- Create a new rectangle with the given origin, size, and
fill paint. It has no outline.
DrawRectangleFigure
public DrawRectangleFigure(double x,
double y,
double width,
double height,
float lineWidth)
- Create a new rectangle with the given origin, size, and
outline width. It has no fill.
DrawRectangleFigure
public DrawRectangleFigure(double x,
double y,
double width,
double height,
Paint fill,
Paint outline,
float lineWidth,
AlphaComposite composite)
- Create a new rectangle with the given origin, size, fill, and
outline width.
translate
public void translate(double x,
double y)
- Translate the rectangle the given distance
- Specified by:
translate
in interface Figure
- Overrides:
translate
in class DrawBasicFigure
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.