uk.ac.starlink.diva
Class DrawLineFigure
java.lang.Object
diva.canvas.AbstractFigure
diva.canvas.toolbox.PathFigure
uk.ac.starlink.diva.DrawPathFigure
uk.ac.starlink.diva.DrawLineFigure
- All Implemented Interfaces:
- CanvasComponent, Figure, ShapedFigure, VisibleComponent, UserObjectContainer, DrawFigure
public class DrawLineFigure
- extends DrawPathFigure
A figure that displays as a line. This is a convenience class
so that a line can be distinguished from other figure types on a
Draw
implementation.
- Version:
- $Id$
- Author:
- Peter W. Draper
Constructor Summary |
DrawLineFigure(double x1,
double y1,
double x2,
double y2)
Create a new instance with the given end points, a
unit-width continuous stroke and no paint pattern. |
DrawLineFigure(double x1,
double y1,
double x2,
double y2,
Paint fill,
float lineWidth,
AlphaComposite composite)
Create a new instance with the given end points, fill, and
outline width. |
DrawLineFigure(Line2D line)
Create a new instance with unit-width continuous stroke and no
paint pattern. |
Method Summary |
void |
translate(double x,
double y)
Translate the line by the given distance |
Methods inherited from class uk.ac.starlink.diva.DrawPathFigure |
addListener, fireChanged, fireCreated, fireRemoved, getFillPaint, isTransformFreely, removeListener, setFillPaint, setTransformFreely, setVisible, transform |
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 diva.canvas.Figure |
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipText |
DrawLineFigure
public DrawLineFigure(Line2D line)
- Create a new instance with unit-width continuous stroke and no
paint pattern.
DrawLineFigure
public DrawLineFigure(double x1,
double y1,
double x2,
double y2)
- Create a new instance with the given end points, a
unit-width continuous stroke and no paint pattern.
DrawLineFigure
public DrawLineFigure(double x1,
double y1,
double x2,
double y2,
Paint fill,
float lineWidth,
AlphaComposite composite)
- Create a new instance with the given end points, fill, and
outline width.
translate
public void translate(double x,
double y)
- Translate the line by the given distance
- Specified by:
translate
in interface Figure
- Overrides:
translate
in class DrawPathFigure
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.