|
|||||||||
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(java.util.Vector newFigures)
Adds a vector of figures. |
void |
addDrawingChangeListener(DrawingChangeListener listener)
Adds a listener for this drawing. |
void |
bringToFront(Figure figure)
Brings a figure to the front. |
void |
draw(java.awt.Graphics g)
Draws all the figures back to front. |
java.util.Enumeration |
drawingChangeListeners()
Gets the listeners of a drawing. |
void |
figureInvalidated(FigureChangeEvent e)
Invalidates a rectangle and merges it with the existing damaged area. |
void |
figureRequestRemove(FigureChangeEvent e)
Handles a removeFrfigureRequestRemove request that is passed up the figure container hierarchy. |
void |
figureRequestUpdate(FigureChangeEvent e)
Forces an update of the drawing change listeners. |
FigureEnumeration |
figures()
Returns an enumeration to iterate in Z-order back to front over the figures. |
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. |
void |
lock()
Acquires the drawing lock. |
Figure |
orphan(Figure figure)
Removes a figure from the figure list, but doesn't release it. |
void |
orphanAll(java.util.Vector newFigures)
Removes a vector of figures from the figure's list without releasing the figures. |
void |
release()
Releases the drawing and its contained figures. |
Figure |
remove(Figure figure)
Removes the figure from the drawing and releases it. |
void |
removeAll(java.util.Vector figures)
Removes a vector of figures . |
void |
removeDrawingChangeListener(DrawingChangeListener listener)
Removes a listener from this drawing. |
void |
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 |
unlock()
Releases the drawing lock. |
Methods inherited from interface CH.ifa.draw.util.Storable |
---|
read, write |
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener |
---|
figureChanged, figureRemoved |
Method Detail |
---|
void release()
FigureEnumeration figures()
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.void addDrawingChangeListener(DrawingChangeListener listener)
void removeDrawingChangeListener(DrawingChangeListener listener)
java.util.Enumeration drawingChangeListeners()
Figure add(Figure figure)
void addAll(java.util.Vector newFigures)
Figure remove(Figure figure)
Figure orphan(Figure figure)
void orphanAll(java.util.Vector newFigures)
orphan(CH.ifa.draw.framework.Figure)
void removeAll(java.util.Vector figures)
remove(CH.ifa.draw.framework.Figure)
void replace(Figure figure, Figure replacement)
void sendToBack(Figure figure)
void bringToFront(Figure figure)
void draw(java.awt.Graphics g)
void figureInvalidated(FigureChangeEvent e)
figureInvalidated
in interface FigureChangeListener
void figureRequestUpdate(FigureChangeEvent e)
figureRequestUpdate
in interface FigureChangeListener
void figureRequestRemove(FigureChangeEvent e)
figureRequestRemove
in interface FigureChangeListener
FigureChangeListener
void lock()
void unlock()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |