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

 o Observer
The Observer pattern is used to decouple the Drawing from its views and to enable multiple views.


See Also:
Figure, DrawingView, FigureChangeListener

Method Index

 o add(Figure)
Adds a figure and sets its container to refer to this drawing.
 o addAll(Vector)
Adds a vector of figures.
 o addDrawingChangeListener(DrawingChangeListener)
Adds a listener for this drawing.
 o bringToFront(Figure)
Brings a figure to the front.
 o draw(Graphics)
Draws all the figures back to front.
 o drawingChangeListeners()
Gets the listeners of a drawing.
 o figureInvalidated(FigureChangeEvent)
Invalidates a rectangle and merges it with the existing damaged area.
 o figureRequestRemove(FigureChangeEvent)
Handles a removeFrfigureRequestRemove request that is passed up the figure container hierarchy.
 o figureRequestUpdate(FigureChangeEvent)
Forces an update of the drawing change listeners.
 o figures()
Returns an enumeration to iterate in Z-order back to front over the figures.
 o figuresReverse()
Returns an enumeration to iterate in Z-order front to back over the figures.
 o findFigure(int, int)
Finds a top level Figure.
 o findFigure(Rectangle)
Finds a top level Figure that intersects the given rectangle.
 o findFigure(Rectangle, Figure)
Finds a top level Figure that intersects the given rectangle.
 o findFigureInside(int, int)
Finds a figure but descends into a figure's children.
 o findFigureInsideWithout(int, int, Figure)
Finds a figure but descends into a figure's children.
 o findFigureWithout(int, int, Figure)
Finds a top level Figure, but supresses the passed in figure.
 o lock()
Acquires the drawing lock.
 o orphan(Figure)
Removes a figure from the figure list, but doesn't release it.
 o orphanAll(Vector)
Removes a vector of figures from the figure's list without releasing the figures.
 o release()
Releases the drawing and its contained figures.
 o remove(Figure)
Removes the figure from the drawing and releases it.
 o removeAll(Vector)
Removes a vector of figures .
 o removeDrawingChangeListener(DrawingChangeListener)
Removes a listener from this drawing.
 o replace(Figure, Figure)
Replaces a figure in the drawing without removing it from the drawing.
 o sendToBack(Figure)
Sends a figure to the back of the drawing.
 o unlock()
Releases the drawing lock.

Methods

 o release
 public abstract void release()
Releases the drawing and its contained figures.

 o figures
 public abstract FigureEnumeration figures()
Returns an enumeration to iterate in Z-order back to front over the figures.

 o figuresReverse
 public abstract FigureEnumeration figuresReverse()
Returns an enumeration to iterate in Z-order front to back over the figures.

 o 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.

 o findFigure
 public abstract Figure findFigure(Rectangle r)
Finds a top level Figure that intersects the given rectangle.

 o 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.
 o 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.

 o 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.

 o 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.
 o addDrawingChangeListener
 public abstract void addDrawingChangeListener(DrawingChangeListener listener)
Adds a listener for this drawing.

 o removeDrawingChangeListener
 public abstract void removeDrawingChangeListener(DrawingChangeListener listener)
Removes a listener from this drawing.

 o drawingChangeListeners
 public abstract Enumeration drawingChangeListeners()
Gets the listeners of a drawing.

 o 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.
 o addAll
 public abstract void addAll(Vector newFigures)
Adds a vector of figures.

 o remove
 public abstract Figure remove(Figure figure)
Removes the figure from the drawing and releases it.

 o 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.

 o orphanAll
 public abstract void orphanAll(Vector newFigures)
Removes a vector of figures from the figure's list without releasing the figures.

See Also:
orphan
 o removeAll
 public abstract void removeAll(Vector figures)
Removes a vector of figures .

See Also:
remove
 o replace
 public abstract void replace(Figure figure,
                              Figure replacement)
Replaces a figure in the drawing without removing it from the drawing.

 o sendToBack
 public abstract void sendToBack(Figure figure)
Sends a figure to the back of the drawing.

 o bringToFront
 public abstract void bringToFront(Figure figure)
Brings a figure to the front.

 o draw
 public abstract void draw(Graphics g)
Draws all the figures back to front.

 o figureInvalidated
 public abstract void figureInvalidated(FigureChangeEvent e)
Invalidates a rectangle and merges it with the existing damaged area.

 o figureRequestUpdate
 public abstract void figureRequestUpdate(FigureChangeEvent e)
Forces an update of the drawing change listeners.

 o figureRequestRemove
 public abstract void figureRequestRemove(FigureChangeEvent e)
Handles a removeFrfigureRequestRemove request that is passed up the figure container hierarchy.

See Also:
FigureChangeListener
 o lock
 public abstract void lock()
Acquires the drawing lock.

 o unlock
 public abstract void unlock()
Releases the drawing lock.


All Packages  Class Hierarchy  This Package  Previous  Next  Index