|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractPaintable
|
+--com.rolemodelsoft.drawlet.basics.SimpleDrawing
This provides basic functionality necessary to provide a meaningful working version of a Drawing.
| Field Summary | |
protected java.awt.Color |
backgroundColor
The background color. |
protected boolean |
dynamicSize
Stores whether this drawing is to be sized dynamically or not. |
protected java.util.Vector |
figures
The figures which appear on the canvas. |
protected int |
height
The height of the drawing. |
protected java.util.Vector |
listeners
The property change listeners. |
protected int |
width
The width of the drawing. |
| Fields inherited from interface com.rolemodelsoft.drawlet.Drawing |
SIZE_PROPERTY,
STYLE_PROPERTY |
| Constructor Summary | |
SimpleDrawing()
Create a new instance of a Drawing |
|
SimpleDrawing(int width,
int height)
Create a new instance of a Drawing |
|
| Method Summary | |
void |
addFigure(Figure figure)
Add the figure to the contents of the canvas. |
void |
addFigureBehind(Figure figure,
Figure existingFigure)
Add the figure to the contents of the canvas, sticking it behind an existingFigure which is already there. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
protected void |
changedSize(java.awt.Dimension oldDimension)
Denote that size changed. |
protected java.awt.Color |
defaultBackgroundColor()
Answer the default color for this Drawing's background. |
protected boolean |
defaultDynamicSize()
Answer the default for whether this Drawing should be dynamically sized. |
protected java.util.Vector |
defaultFigures()
Answer the default Vector to contain this Drawing's figures. |
protected int |
defaultWidth()
Answer the default width for this Drawing. |
Figure |
figureAt(int x,
int y)
Answer the figure at a given point |
FigureEnumeration |
figures()
Answer a FigureEnumeration over the figures of the receiver. |
protected void |
firePropertyChange(java.beans.PropertyChangeEvent event)
Report a property update to any registered listeners. |
java.awt.Rectangle |
getBounds()
Returns the current rectangular area covered by the receiver. |
java.awt.Dimension |
getSize()
Returns the current size of the receiver. |
DrawingStyle |
getStyle()
Get the style defining how to paint on the canvas. |
boolean |
isDynamicSize()
Answers whether this Drawing is currently dynamically sized or not. |
void |
moveFigureBehind(Figure figure,
Figure existingFigure)
Move the figure behind an existingFigure if it is not already there. |
void |
moveFigureInFront(Figure figure,
Figure existingFigure)
Move the figure in front of an existingFigure if it is not already there. |
void |
moveFigureToBack(Figure figure)
Move the figure behind all other figures. |
void |
moveFigureToFront(Figure figure)
Move the figure in front of all other figures. |
Figure |
otherFigureAt(Figure excludedFigure,
int x,
int y)
Answer the figure at a given point excluding the identified figure |
void |
paint(java.awt.Graphics g)
Paints the component. |
protected void |
paintAll(java.awt.Graphics g)
Paints everything in the receiver. |
protected void |
paintBackground(java.awt.Graphics g)
Paints the background of the receiver. |
protected void |
paintCompletely(java.awt.Graphics g)
Paints everything in the receiver, ignoring the clipping region. |
void |
removeFigure(Figure figure)
Remove the figure. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
setDynamicSize(boolean dynamicSize)
Sets whether this Drawing is dynamically sized or not. |
void |
setSize(java.awt.Dimension d)
Sets the current size covered by this drawing. |
void |
setSize(int width,
int height)
Sets the current size covered by this drawing. |
void |
setStyle(DrawingStyle style)
Set the style defining how to paint on the canvas. |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractPaintable |
getBottom,
getHeight,
getLeft,
getRight,
getTop,
getWidth |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.util.Vector figures
protected int width
protected int height
protected transient java.util.Vector listeners
protected java.awt.Color backgroundColor
protected boolean dynamicSize
| Constructor Detail |
public SimpleDrawing()
public SimpleDrawing(int width,
int height)
| Method Detail |
public void addFigure(Figure figure)
figure - the figure to add
public void addFigureBehind(Figure figure,
Figure existingFigure)
figure - the figure to addexistingFigure - the figure to which the new figure should be behindpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be addedprotected void changedSize(java.awt.Dimension oldDimension)
oldDimension - the old dimensions.protected java.awt.Color defaultBackgroundColor()
protected boolean defaultDynamicSize()
protected java.util.Vector defaultFigures()
protected int defaultWidth()
public Figure figureAt(int x,
int y)
x - the x coordinatey - the y coordinatepublic FigureEnumeration figures()
protected void firePropertyChange(java.beans.PropertyChangeEvent event)
event - public java.awt.Rectangle getBounds()
public java.awt.Dimension getSize()
public DrawingStyle getStyle()
public boolean isDynamicSize()
public void moveFigureBehind(Figure figure,
Figure existingFigure)
figure - the figure to moveexistingFigure - the figure to which the new figure should be behind
public void moveFigureInFront(Figure figure,
Figure existingFigure)
figure - the figure to moveexistingFigure - the figure to which the new figure should be in frontpublic void moveFigureToBack(Figure figure)
figure - the figure to movepublic void moveFigureToFront(Figure figure)
figure - the figure to move
public Figure otherFigureAt(Figure excludedFigure,
int x,
int y)
figure - the figure to exclude from the searchx - the x coordinatey - the y coordinatepublic void paint(java.awt.Graphics g)
g - the specified Graphics windowprotected void paintAll(java.awt.Graphics g)
g - the specified Graphics windowprotected void paintBackground(java.awt.Graphics g)
g - the specified Graphics windowprotected void paintCompletely(java.awt.Graphics g)
g - the specified Graphics windowpublic void removeFigure(Figure figure)
figure - the figure to removepublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be removed.public void setDynamicSize(boolean dynamicSize)
dynamicSize - a boolean specifying this drawing's new
dynamic size state.
public void setSize(int width,
int height)
width - an integer representing the new width.height - an integer representing the new height.public void setSize(java.awt.Dimension d)
d - a Dimension representing the new size.public void setStyle(DrawingStyle style)
style - the specified DrawingStyle
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||