|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.toolbox.BasicFigure
jsky.image.graphics.ImageFigure
public class ImageFigure
Represents a figure or drawing in an image overlay. For now, this is just a simple subclass of the Diva BasicFigure class. See the Diva documentation and examples for more information.
| Field Summary | |
|---|---|
protected java.lang.Object |
clientData
An arbitrary object to store with the figure for later reference |
protected CanvasFigureListenerManager |
listenerManager
Manages a list of listeners for figure events |
protected java.util.LinkedList |
slaves
Optional linked list of slave figures, which should be moved with this figure. |
| Fields inherited from interface jsky.graphics.CanvasFigure |
|---|
DESELECTED, MOVED, RESIZED, SELECTED |
| Constructor Summary | |
|---|---|
ImageFigure(java.awt.Shape shape,
java.awt.Paint fill,
java.awt.Paint outline,
float lineWidth,
diva.canvas.interactor.Interactor interactor)
Create an image figure with the given shape, fill, outline and line width. |
|
| Method Summary | |
|---|---|
void |
addCanvasFigureListener(CanvasFigureListener listener)
Add a listener for events on the canvas figure |
void |
addSlave(CanvasFigure fig)
Add a slave figure. |
void |
fireCanvasFigureEvent(int eventType)
Fire an event on the canvas figure. |
java.awt.geom.Rectangle2D |
getBoundsWithoutLabel()
Return the bounds of this figure, ignoring the label, if there is one. |
java.lang.Object |
getClientData()
Return the client data object, or null if none was set |
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this shape is hit by the given rectangle (Override parent class version, since the 25-sep-00 version only hits the outline). |
boolean |
isSelected()
Return true if the figure is selected. |
void |
removeCanvasFigureListener(CanvasFigureListener listener)
Remove a listener for events on the canvas figure |
void |
setClientData(java.lang.Object o)
Store an arbitrary object with the figure for later reference |
void |
setVisible(boolean flag)
Set the visibility flag of this object. |
void |
translate(double x,
double y)
Translate the figure by the given distance. |
| Methods inherited from class diva.canvas.toolbox.BasicFigure |
|---|
getBounds, getComposite, getDashArray, getFillPaint, getLineWidth, getShape, getStrokePaint, paint, setComposite, setDashArray, setFillPaint, setLineWidth, setShape, setStroke, setStrokePaint, transform |
| 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 jsky.graphics.CanvasFigure |
|---|
getBounds, isVisible |
| Methods inherited from interface diva.canvas.Figure |
|---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, intersects, setInteractor, setParent, setToolTipText |
| Methods inherited from interface diva.canvas.VisibleComponent |
|---|
isVisible, paint |
| Methods inherited from interface diva.canvas.CanvasComponent |
|---|
getTransformContext, repaint, repaint |
| Methods inherited from interface diva.util.UserObjectContainer |
|---|
getUserObject, setUserObject |
| Field Detail |
|---|
protected java.lang.Object clientData
protected CanvasFigureListenerManager listenerManager
protected java.util.LinkedList slaves
| Constructor Detail |
|---|
public ImageFigure(java.awt.Shape shape,
java.awt.Paint fill,
java.awt.Paint outline,
float lineWidth,
diva.canvas.interactor.Interactor interactor)
shape - the shape to drawfill - the paint to use to fill the shapeoutline - the paint to use for the outlinelineWidth - the width of the shape lines in pixelsinteractor - determines the behavior of the figure (may be null)| Method Detail |
|---|
public void setClientData(java.lang.Object o)
setClientData in interface CanvasFigurepublic java.lang.Object getClientData()
getClientData in interface CanvasFigurepublic java.awt.geom.Rectangle2D getBoundsWithoutLabel()
getBoundsWithoutLabel in interface CanvasFigurepublic boolean hit(java.awt.geom.Rectangle2D r)
hit in interface diva.canvas.Figurehit in class diva.canvas.toolbox.BasicFigurepublic void setVisible(boolean flag)
setVisible in interface diva.canvas.VisibleComponentsetVisible in interface CanvasFiguresetVisible in class diva.canvas.AbstractFigurepublic boolean isSelected()
isSelected in interface CanvasFigurepublic void addCanvasFigureListener(CanvasFigureListener listener)
addCanvasFigureListener in interface CanvasFigurepublic void removeCanvasFigureListener(CanvasFigureListener listener)
removeCanvasFigureListener in interface CanvasFigurepublic void fireCanvasFigureEvent(int eventType)
fireCanvasFigureEvent in interface CanvasFigureeventType - one of the CanvasFigure constants: SELECTED, DESELECTED, RESIZED, MOVEDpublic void addSlave(CanvasFigure fig)
addSlave in interface CanvasFigure
public void translate(double x,
double y)
translate in interface diva.canvas.Figuretranslate in class diva.canvas.toolbox.BasicFigure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||