jsky.graphics
Interface CanvasFigure

All Known Subinterfaces:
CanvasFigureGroup
All Known Implementing Classes:
ImageFigure, ImageFigureGroup, ImageLabel, LabeledImageFigure

public interface CanvasFigure

This defines an abstract interface for figures drawn on a canvas.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Field Summary
static int DESELECTED
          Indicates that the figure was deselected
static int MOVED
          Indicates that the figure was dragged
static int RESIZED
          Indicates that the figure was resized
static int SELECTED
          Indicates that the figure was selected
 
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 getBounds()
          Return the bounds of this 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 isSelected()
          Return true if the figure is selected.
 boolean isVisible()
          Test the visibility flag of this object.
 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.
 

Field Detail

SELECTED

static final int SELECTED
Indicates that the figure was selected

See Also:
Constant Field Values

DESELECTED

static final int DESELECTED
Indicates that the figure was deselected

See Also:
Constant Field Values

RESIZED

static final int RESIZED
Indicates that the figure was resized

See Also:
Constant Field Values

MOVED

static final int MOVED
Indicates that the figure was dragged

See Also:
Constant Field Values
Method Detail

setClientData

void setClientData(java.lang.Object o)
Store an arbitrary object with the figure for later reference


getClientData

java.lang.Object getClientData()
Return the client data object, or null if none was set


isSelected

boolean isSelected()
Return true if the figure is selected.


isVisible

boolean isVisible()
Test the visibility flag of this object.


getBounds

java.awt.geom.Rectangle2D getBounds()
Return the bounds of this figure


getBoundsWithoutLabel

java.awt.geom.Rectangle2D getBoundsWithoutLabel()
Return the bounds of this figure, ignoring the label, if there is one.


setVisible

void setVisible(boolean flag)
Set the visibility flag of this object.


addCanvasFigureListener

void addCanvasFigureListener(CanvasFigureListener listener)
Add a listener for events on the canvas figure


removeCanvasFigureListener

void removeCanvasFigureListener(CanvasFigureListener listener)
Remove a listener for events on the canvas figure


fireCanvasFigureEvent

void fireCanvasFigureEvent(int eventType)
Fire an event on the canvas figure.

Parameters:
eventType - one of SELECTED, DESELECTED, RESIZED, MOVED

addSlave

void addSlave(CanvasFigure fig)
Add a slave figure. When this figure is moved, the slaves will also move.