|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Drawing
Drawing is a container for figures.
Drawing sends out DrawingChanged events to DrawingChangeListeners whenever a part of its area was invalidated.
Observer
The Observer pattern is used to decouple the Drawing from its views and
to enable multiple views.
Figure
,
DrawingView
,
FigureChangeListener
Method Summary | |
---|---|
Figure |
add(Figure figure)
Adds a figure and sets its container to refer to this drawing. |
void |
addAll(FigureEnumeration fe)
Adds a FigureEnumeration of figures. |
void |
addAll(java.util.List newFigures)
Deprecated. use addAll(FigureEnumeration) instead |
void |
addDrawingChangeListener(DrawingChangeListener listener)
Adds a listener for this drawing. |
void |
bringToFront(Figure figure)
Brings a figure to the front. |
boolean |
containsFigure(Figure figure)
Check whether a given figure is a (direct) child figure of this CompositeFigure. |
void |
draw(java.awt.Graphics g)
Draws all the figures back to front. |
void |
draw(java.awt.Graphics g,
FigureEnumeration fe)
Draws only the given figures. |
java.util.Iterator |
drawingChangeListeners()
Gets the listeners of a drawing. |
FigureEnumeration |
figures()
Returns an enumeration to iterate in Z-order back to front over the figures. |
FigureEnumeration |
figures(java.awt.Rectangle viewRectangle)
Returns an enumeration to iterate in Z-order back to front over the figures that lie within the absolute bounds. |
FigureEnumeration |
figuresReverse()
Returns an enumeration to iterate in Z-order front to back over the figures. |
Figure |
findFigure(int x,
int y)
Finds a top level Figure. |
Figure |
findFigure(java.awt.Rectangle r)
Finds a top level Figure that intersects the given rectangle. |
Figure |
findFigure(java.awt.Rectangle r,
Figure without)
Finds a top level Figure that intersects the given rectangle. |
Figure |
findFigureInside(int x,
int y)
Finds a figure but descends into a figure's children. |
Figure |
findFigureInsideWithout(int x,
int y,
Figure without)
Finds a figure but descends into a figure's children. |
Figure |
findFigureWithout(int x,
int y,
Figure without)
Finds a top level Figure, but supresses the passed in figure. |
Figure |
getFigureFromLayer(int layerNr)
Gets the figure from a certain layer. |
int |
getLayer(Figure figure)
Gets the layer for a certain figure (first occurrence). |
java.lang.String |
getTitle()
|
boolean |
includes(Figure figure)
Checks if the composite figure has the argument as one of its children. |
void |
init(java.awt.Rectangle viewRectangle)
Used to optimize rendering. |
void |
lock()
Acquires the drawing lock. |
Figure |
orphan(Figure figure)
Removes a figure from the figure list, but doesn't release it. |
void |
orphanAll(FigureEnumeration fe)
Removes a FigureEnumeration of figures from the figure's list without releasing the figures. |
void |
orphanAll(java.util.List orphanFigures)
Deprecated. use orphanAll(FigureEnumeration) instead |
void |
release()
Releases the drawing and its contained figures. |
Figure |
remove(Figure figure)
Removes the figure from the drawing and releases it. |
void |
removeAll(FigureEnumeration fe)
Removes a FigureEnumeration of figures. |
void |
removeAll(java.util.List figures)
Deprecated. use removeAll(FigureEnumeration) instead |
void |
removeDrawingChangeListener(DrawingChangeListener listener)
Removes a listener from this drawing. |
Figure |
replace(Figure figure,
Figure replacement)
Replaces a figure in the drawing without removing it from the drawing. |
void |
sendToBack(Figure figure)
Sends a figure to the back of the drawing. |
void |
sendToLayer(Figure figure,
int layerNr)
Sends a figure to a certain layer within a drawing. |
void |
setTitle(java.lang.String name)
|
void |
unlock()
Releases the drawing lock. |
Methods inherited from interface org.jhotdraw.util.Storable |
---|
read, write |
Methods inherited from interface org.jhotdraw.framework.FigureChangeListener |
---|
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate |
Method Detail |
---|
void release()
FigureEnumeration figures()
FigureEnumeration figures(java.awt.Rectangle viewRectangle)
FigureEnumeration figuresReverse()
Figure findFigure(int x, int y)
Figure findFigure(java.awt.Rectangle r)
Figure findFigureWithout(int x, int y, Figure without)
x
- the x coordinatey
- the y coordinatewithout
- the figure to be ignored during
the find.Figure findFigure(java.awt.Rectangle r, Figure without)
Figure findFigureInside(int x, int y)
Figure findFigureInsideWithout(int x, int y, Figure without)
x
- the x coordinatey
- the y coordinatewithout
- the figure to be ignored during
the find.boolean includes(Figure figure)
figure
- figure to be searched in all descendants
boolean containsFigure(Figure figure)
figure
- figure to be searched in all direct descendents
void addDrawingChangeListener(DrawingChangeListener listener)
void removeDrawingChangeListener(DrawingChangeListener listener)
java.util.Iterator drawingChangeListeners()
Figure add(Figure figure)
figure
- to be added to the drawing
void addAll(java.util.List newFigures)
void addAll(FigureEnumeration fe)
fe
- (unused) enumeration containing all figures to be addedadd(org.jhotdraw.framework.Figure)
Figure remove(Figure figure)
figure
- that is part of the drawing and should be removed
Figure orphan(Figure figure)
figure
- that is part of the drawing and should be addedvoid orphanAll(java.util.List orphanFigures)
orphan(org.jhotdraw.framework.Figure)
void orphanAll(FigureEnumeration fe)
orphan(org.jhotdraw.framework.Figure)
void removeAll(java.util.List figures)
remove(org.jhotdraw.framework.Figure)
void removeAll(FigureEnumeration fe)
remove(org.jhotdraw.framework.Figure)
Figure replace(Figure figure, Figure replacement)
figure
- figure to be replacedreplacement
- figure that should replace the specified figure
void sendToBack(Figure figure)
figure
- that is part of the drawingvoid bringToFront(Figure figure)
figure
- that is part of the drawingvoid sendToLayer(Figure figure, int layerNr)
figure
- figure to be sent to a certain layerlayerNr
- target layer of the figureint getLayer(Figure figure)
figure
- figure to be queried for its layering place
sendToLayer(org.jhotdraw.framework.Figure, int)
Figure getFigureFromLayer(int layerNr)
layerNr
- number of the layer which figure should be returned
sendToLayer(org.jhotdraw.framework.Figure, int)
void draw(java.awt.Graphics g)
void draw(java.awt.Graphics g, FigureEnumeration fe)
void lock()
void unlock()
void init(java.awt.Rectangle viewRectangle)
java.lang.String getTitle()
void setTitle(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |