All Packages Class Hierarchy This Package Previous Next Index
Interface CH.ifa.draw.framework.Drawing
- public interface interface Drawing
- extends Storable, FigureChangeListener, Serializable
Drawing is a container for figures.
Drawing sends out DrawingChanged events to DrawingChangeListeners
whenever a part of its area was invalidated.
Design Patterns
Observer
The Observer pattern is used to decouple the Drawing from its views and
to enable multiple views.
- See Also:
- Figure, DrawingView, FigureChangeListener
-
add(Figure)
- Adds a figure and sets its container to refer
to this drawing.
-
addAll(Vector)
- Adds a vector of figures.
-
addDrawingChangeListener(DrawingChangeListener)
- Adds a listener for this drawing.
-
bringToFront(Figure)
- Brings a figure to the front.
-
draw(Graphics)
- Draws all the figures back to front.
-
drawingChangeListeners()
- Gets the listeners of a drawing.
-
figureInvalidated(FigureChangeEvent)
- Invalidates a rectangle and merges it with the
existing damaged area.
-
figureRequestRemove(FigureChangeEvent)
- Handles a removeFrfigureRequestRemove request that
is passed up the figure container hierarchy.
-
figureRequestUpdate(FigureChangeEvent)
- Forces an update of the drawing change listeners.
-
figures()
- Returns an enumeration to iterate in
Z-order back to front over the figures.
-
figuresReverse()
- Returns an enumeration to iterate in
Z-order front to back over the figures.
-
findFigure(int, int)
- Finds a top level Figure.
-
findFigure(Rectangle)
- Finds a top level Figure that intersects the given rectangle.
-
findFigure(Rectangle, Figure)
- Finds a top level Figure that intersects the given rectangle.
-
findFigureInside(int, int)
- Finds a figure but descends into a figure's
children.
-
findFigureInsideWithout(int, int, Figure)
- Finds a figure but descends into a figure's
children.
-
findFigureWithout(int, int, Figure)
- Finds a top level Figure, but supresses the passed
in figure.
-
lock()
- Acquires the drawing lock.
-
orphan(Figure)
- Removes a figure from the figure list, but
doesn't release it.
-
orphanAll(Vector)
- Removes a vector of figures from the figure's list
without releasing the figures.
-
release()
- Releases the drawing and its contained figures.
-
remove(Figure)
- Removes the figure from the drawing and releases it.
-
removeAll(Vector)
- Removes a vector of figures .
-
removeDrawingChangeListener(DrawingChangeListener)
- Removes a listener from this drawing.
-
replace(Figure, Figure)
- Replaces a figure in the drawing without
removing it from the drawing.
-
sendToBack(Figure)
- Sends a figure to the back of the drawing.
-
unlock()
- Releases the drawing lock.
release
public abstract void release()
- Releases the drawing and its contained figures.
figures
public abstract FigureEnumeration figures()
- Returns an enumeration to iterate in
Z-order back to front over the figures.
figuresReverse
public abstract FigureEnumeration figuresReverse()
- Returns an enumeration to iterate in
Z-order front to back over the figures.
findFigure
public abstract Figure findFigure(int x,
int y)
- Finds a top level Figure. Use this call for hit detection that
should not descend into the figure's children.
findFigure
public abstract Figure findFigure(Rectangle r)
- Finds a top level Figure that intersects the given rectangle.
findFigureWithout
public abstract Figure findFigureWithout(int x,
int y,
Figure without)
- Finds a top level Figure, but supresses the passed
in figure. Use this method to ignore a figure
that is temporarily inserted into the drawing.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- without - the figure to be ignored during
the find.
findFigure
public abstract Figure findFigure(Rectangle r,
Figure without)
- Finds a top level Figure that intersects the given rectangle.
It supresses the passed
in figure. Use this method to ignore a figure
that is temporarily inserted into the drawing.
findFigureInside
public abstract Figure findFigureInside(int x,
int y)
- Finds a figure but descends into a figure's
children. Use this method to implement click-through
hit detection, that is, you want to detect the inner most
figure containing the given point.
findFigureInsideWithout
public abstract Figure findFigureInsideWithout(int x,
int y,
Figure without)
- Finds a figure but descends into a figure's
children. It supresses the passed
in figure. Use this method to ignore a figure
that is temporarily inserted into the drawing.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- without - the figure to be ignored during
the find.
addDrawingChangeListener
public abstract void addDrawingChangeListener(DrawingChangeListener listener)
- Adds a listener for this drawing.
removeDrawingChangeListener
public abstract void removeDrawingChangeListener(DrawingChangeListener listener)
- Removes a listener from this drawing.
drawingChangeListeners
public abstract Enumeration drawingChangeListeners()
- Gets the listeners of a drawing.
add
public abstract Figure add(Figure figure)
- Adds a figure and sets its container to refer
to this drawing.
- Returns:
- the figure that was inserted.
addAll
public abstract void addAll(Vector newFigures)
- Adds a vector of figures.
remove
public abstract Figure remove(Figure figure)
- Removes the figure from the drawing and releases it.
orphan
public abstract Figure orphan(Figure figure)
- Removes a figure from the figure list, but
doesn't release it. Use this method to temporarily
manipulate a figure outside of the drawing.
orphanAll
public abstract void orphanAll(Vector newFigures)
- Removes a vector of figures from the figure's list
without releasing the figures.
- See Also:
- orphan
removeAll
public abstract void removeAll(Vector figures)
- Removes a vector of figures .
- See Also:
- remove
replace
public abstract void replace(Figure figure,
Figure replacement)
- Replaces a figure in the drawing without
removing it from the drawing.
sendToBack
public abstract void sendToBack(Figure figure)
- Sends a figure to the back of the drawing.
bringToFront
public abstract void bringToFront(Figure figure)
- Brings a figure to the front.
draw
public abstract void draw(Graphics g)
- Draws all the figures back to front.
figureInvalidated
public abstract void figureInvalidated(FigureChangeEvent e)
- Invalidates a rectangle and merges it with the
existing damaged area.
figureRequestUpdate
public abstract void figureRequestUpdate(FigureChangeEvent e)
- Forces an update of the drawing change listeners.
figureRequestRemove
public abstract void figureRequestRemove(FigureChangeEvent e)
- Handles a removeFrfigureRequestRemove request that
is passed up the figure container hierarchy.
- See Also:
- FigureChangeListener
lock
public abstract void lock()
- Acquires the drawing lock.
unlock
public abstract void unlock()
- Releases the drawing lock.
All Packages Class Hierarchy This Package Previous Next Index