|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.toolbox.IconFigure
public class IconFigure
An IconFigure is a figure that contains a main background figure, a PaintedObject to decorate that figure, a label, and an arbitrary number of attached Terminal objects.
Field Summary | |
---|---|
private Figure |
_background
The background figure |
private java.awt.Composite |
_composite
The composite of this icon and all its stuff |
private PaintedObject |
_graphic
The "graphic" object |
private LabelFigure |
_label
The icon's label |
private java.util.ArrayList |
_sites
The sites to which the terminals attach |
private java.util.ArrayList |
_terminals
The terminals of this icon |
private java.awt.geom.AffineTransform |
_transform
The transform that is applied to the background and the graphic |
Constructor Summary | |
---|---|
IconFigure(Figure f)
Create a new icon figure using the given figure as the "background" figure. |
|
IconFigure(Figure f,
PaintedObject g)
Create a new icon figure using the given figure as the "background" figure and the given Painted object as its "graphic." |
|
IconFigure(Figure f,
PaintedObject g,
java.lang.String label)
Create a new icon figure using the given figure as the "background" figure, the given Painted object as its "graphic," and the given string as a displayed label. |
|
IconFigure(Figure f,
java.lang.String label)
Create a new icon figure using the given figure as the "background" figure and with the given label. |
Method Summary | |
---|---|
void |
addTerminal(Terminal t,
int side,
double offset)
Add the given terminal, on the given side and with the given offset, to the icon. |
Figure |
getBackground()
Get the background figure of the icon. |
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of this icon, including the terminals. |
java.awt.Composite |
getComposite()
Get the composite of this icon, or null if it doesn't have one. |
PaintedObject |
getGraphic()
Get the painted object that is drawn over the top of the icon as its "graphic." |
java.awt.Shape |
getShape()
Get the shape of this figure. |
Terminal |
getTerminal(int index)
Get the terminal at the given index |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if this figure intersects the given rectangle. |
void |
paint(java.awt.Graphics2D g)
Paint the icon. |
void |
setComposite(java.awt.Composite c)
Set the color composition operator of this figure. |
void |
setLabel(java.lang.String s)
Set the label of this figure. |
java.util.Iterator |
terminals()
Get an iterator over the terminals of this figure. |
void |
transform(java.awt.geom.AffineTransform at)
Transform the figure with the supplied transform. |
void |
translate(double x,
double y)
Translate the figure the given distance. |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, hit, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.awt.Composite _composite
private Figure _background
private java.awt.geom.AffineTransform _transform
private PaintedObject _graphic
private java.util.ArrayList _terminals
private java.util.ArrayList _sites
private LabelFigure _label
Constructor Detail |
---|
public IconFigure(Figure f)
public IconFigure(Figure f, PaintedObject g)
public IconFigure(Figure f, java.lang.String label)
public IconFigure(Figure f, PaintedObject g, java.lang.String label)
Method Detail |
---|
public void addTerminal(Terminal t, int side, double offset)
public Figure getBackground()
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Figure
getBounds
in class AbstractFigure
public PaintedObject getGraphic()
public java.awt.Composite getComposite()
public java.awt.Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public Terminal getTerminal(int index)
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
intersects
in class AbstractFigure
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
public void setComposite(java.awt.Composite c)
public void setLabel(java.lang.String s)
public java.util.Iterator terminals()
public void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |