diva.compat.canvas
Class PaintedFigure

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.compat.canvas.PaintedFigure
All Implemented Interfaces:
CanvasComponent, Figure, VisibleComponent, UserObjectContainer

public class PaintedFigure
extends AbstractFigure

Note: use of this class is no longer recommended for new development.

A PaintedFigure is contains an arbitrary set of PaintedObjects in a list. This figure can be used for constructing more complex figures than classes such as BasicFigure. It contains a transform that is used for scaling the contained painted objects. (Note that, if using this class to construct a figure from an external source, the initial transform should operate on the coordinates only.)

Version:
$Revision: 1.2 $
Author:
John Reekie, Nick Zamora

Constructor Summary
PaintedFigure()
          Create a new blank figure.
PaintedFigure(PaintedList objects)
          Create a new figure that paints itself using the given PaintedList.
 
Method Summary
 void add(PaintedObject po)
          Add a new painted object to the objects displayed by this figure.
 Rectangle2D getBounds()
          Get the bounding box of this figure.
 Composite getComposite()
          Get the color composition operator of this figure.
 Point2D getOrigin()
          Return the origin, which is the point relative to which all of the contained objects are drawn.
 PaintedList getPaintedList()
          Get the painted list of painted objects of this figure.
 Shape getShape()
          Get the shape of this figure.
 void paint(Graphics2D g)
          Paint the figure.
 void setComposite(Composite c)
          Set the color composition operator of this figure.
 void transform(AffineTransform at)
          Transform the figure with the supplied transform.
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaintedFigure

public PaintedFigure()
Create a new blank figure.


PaintedFigure

public PaintedFigure(PaintedList objects)
Create a new figure that paints itself using the given PaintedList.

Method Detail

add

public void add(PaintedObject po)
Add a new painted object to the objects displayed by this figure.


getPaintedList

public PaintedList getPaintedList()
Get the painted list of painted objects of this figure.


getBounds

public Rectangle2D getBounds()
Get the bounding box of this figure.

Specified by:
getBounds in interface Figure
Overrides:
getBounds in class AbstractFigure

getOrigin

public Point2D getOrigin()
Return the origin, which is the point relative to which all of the contained objects are drawn.

Specified by:
getOrigin in interface Figure
Overrides:
getOrigin in class AbstractFigure
Returns:
The origin.
See Also:
AbstractFigure.getBounds()

getShape

public Shape getShape()
Get the shape of this figure. This is the same as the bounding box.

Specified by:
getShape in interface Figure
Specified by:
getShape in class AbstractFigure

getComposite

public Composite getComposite()
Get the color composition operator of this figure.


paint

public void paint(Graphics2D g)
Paint the figure.

Specified by:
paint in interface VisibleComponent
Specified by:
paint in class AbstractFigure

setComposite

public void setComposite(Composite c)
Set the color composition operator of this figure. If the composite is set to null, then the composite will not be changed when the figure is painted. By default, the composite is set to opaque.


transform

public void transform(AffineTransform at)
Transform the figure with the supplied transform. This can be used to perform arbitrary translation, scaling, shearing, and rotation operations.

Specified by:
transform in interface Figure
Specified by:
transform in class AbstractFigure


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