com.rolemodelsoft.drawlet
Interface Drawing

All Known Implementing Classes:
SimpleDrawing

public interface Drawing
extends SequenceOfFigures, Paintable

This interface defines a generic Drawing which holds a SequenceOfFigures which can be painted and potentially manipulated. It is expected that this will be the fundamental unit to store and retrieve diagrams, pictures, etc.


Field Summary
static java.lang.String SIZE_PROPERTY
          The size property selector
static java.lang.String STYLE_PROPERTY
          The style property selector
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener.
 java.awt.Dimension getSize()
          Returns the size of this drawing.
 DrawingStyle getStyle()
          Answer the style which defines how to paint on the canvas.
 boolean isDynamicSize()
          Returns whether this drawing is sized dynamically or statically.
 void paint(java.awt.Graphics g)
          Paints all of the parts of the drawing.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove the specified PropertyChangeListener.
 void setDynamicSize(boolean dynamicSize)
          Sets whether this drawing is sized dynamically or statically.
 void setSize(java.awt.Dimension d)
          Resizes the receiver to the specified dimension.
 void setSize(int width, int height)
          Sets the size of this drawing.
 void setStyle(DrawingStyle style)
          Set the style defining how to paint the receiver.
 
Methods inherited from interface com.rolemodelsoft.drawlet.SequenceOfFigures
addFigure, addFigureBehind, figureAt, figures, moveFigureBehind, moveFigureInFront, moveFigureToBack, moveFigureToFront, otherFigureAt, removeFigure
 
Methods inherited from interface com.rolemodelsoft.drawlet.Paintable
getBottom, getBounds, getHeight, getLeft, getRight, getTop, getWidth
 

Field Detail

SIZE_PROPERTY

public static final java.lang.String SIZE_PROPERTY
The size property selector

STYLE_PROPERTY

public static final java.lang.String STYLE_PROPERTY
The style property selector
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener.
Parameters:
listener - the listener to add.

getSize

public java.awt.Dimension getSize()
Returns the size of this drawing.
Specified by:
getSize in interface Paintable
Returns:
a Dimension representing the size of this drawing.

getStyle

public DrawingStyle getStyle()
Answer the style which defines how to paint on the canvas.
Returns:
the DrawingStyle which defines how to paint on the canvas

isDynamicSize

public boolean isDynamicSize()
Returns whether this drawing is sized dynamically or statically.

paint

public void paint(java.awt.Graphics g)
Paints all of the parts of the drawing.
Specified by:
paint in interface Paintable
Parameters:
g - the specified Graphics window

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove the specified PropertyChangeListener.
Parameters:
listener - the listener to remove.

setDynamicSize

public void setDynamicSize(boolean dynamicSize)
Sets whether this drawing is sized dynamically or statically.
Parameters:
dynamicSize - boolean specifying the dynamicSize state the drawing is to have.

setSize

public void setSize(int width,
                    int height)
Sets the size of this drawing.
Parameters:
width - the width the drawing should be set to.
height - the height the drawing should be set to.

setSize

public void setSize(java.awt.Dimension d)
Resizes the receiver to the specified dimension.
Parameters:
d - the new dimension

setStyle

public void setStyle(DrawingStyle style)
Set the style defining how to paint the receiver.
Parameters:
style - the specified DrawingStyle