CH.ifa.draw.standard
Class StandardDrawing

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by CH.ifa.draw.standard.CompositeFigure
          extended by CH.ifa.draw.standard.StandardDrawing
All Implemented Interfaces:
Drawing, Figure, FigureChangeListener, Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
BouncingDrawing

public class StandardDrawing
extends CompositeFigure
implements Drawing

The standard implementation of the Drawing interface.

See Also:
Drawing, Serialized Form

Field Summary
 
Fields inherited from class CH.ifa.draw.standard.CompositeFigure
fFigures
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
StandardDrawing()
          Constructs the Drawing.
 
Method Summary
 void addDrawingChangeListener(DrawingChangeListener listener)
          Adds a listener for this drawing.
 void basicDisplayBox(java.awt.Point p1, java.awt.Point p2)
          Sets the display box of a figure.
 java.awt.Rectangle displayBox()
          Gets the display box.
 java.util.Enumeration drawingChangeListeners()
          Adds a listener for this drawing.
 void figureInvalidated(FigureChangeEvent e)
          Invalidates a rectangle and merges it with the existing damaged area.
 void figureRequestRemove(FigureChangeEvent e)
          Handles a removeFromDrawing request that is passed up the figure container hierarchy.
 void figureRequestUpdate(FigureChangeEvent e)
          Forces an update
 java.util.Vector handles()
          Return's the figure's handles.
 void lock()
          Acquires the drawing lock.
 Figure remove(Figure figure)
          Removes the figure from the drawing and releases it.
 void removeDrawingChangeListener(DrawingChangeListener listener)
          Removes a listener from this drawing.
 void unlock()
          Releases the drawing lock.
 
Methods inherited from class CH.ifa.draw.standard.CompositeFigure
add, addAll, basicMoveBy, bringToFront, draw, figureAt, figureChanged, figureCount, figureRemoved, figures, figuresReverse, findFigure, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, includes, orphan, orphanAll, read, release, removeAll, removeAll, replace, sendToBack, write
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, getAttribute, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, size, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.Drawing
add, addAll, bringToFront, draw, figures, figuresReverse, findFigure, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, orphan, orphanAll, release, removeAll, replace, sendToBack
 
Methods inherited from interface CH.ifa.draw.util.Storable
read, write
 
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener
figureChanged, figureRemoved
 

Constructor Detail

StandardDrawing

public StandardDrawing()
Constructs the Drawing.

Method Detail

addDrawingChangeListener

public void addDrawingChangeListener(DrawingChangeListener listener)
Adds a listener for this drawing.

Specified by:
addDrawingChangeListener in interface Drawing

removeDrawingChangeListener

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

Specified by:
removeDrawingChangeListener in interface Drawing

drawingChangeListeners

public java.util.Enumeration drawingChangeListeners()
Adds a listener for this drawing.

Specified by:
drawingChangeListeners in interface Drawing

remove

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

Specified by:
remove in interface Drawing
Overrides:
remove in class CompositeFigure
See Also:
CompositeFigure.removeAll(java.util.Vector)

figureRequestRemove

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

Specified by:
figureRequestRemove in interface Drawing
Specified by:
figureRequestRemove in interface FigureChangeListener
Overrides:
figureRequestRemove in class CompositeFigure
See Also:
FigureChangeListener

figureInvalidated

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

Specified by:
figureInvalidated in interface Drawing
Specified by:
figureInvalidated in interface FigureChangeListener
Overrides:
figureInvalidated in class CompositeFigure
See Also:
FigureChangeListener

figureRequestUpdate

public void figureRequestUpdate(FigureChangeEvent e)
Forces an update

Specified by:
figureRequestUpdate in interface Drawing
Specified by:
figureRequestUpdate in interface FigureChangeListener
Overrides:
figureRequestUpdate in class CompositeFigure
See Also:
FigureChangeListener

handles

public java.util.Vector handles()
Return's the figure's handles. This is only used when a drawing is nested inside another drawing.

Specified by:
handles in interface Figure
Specified by:
handles in class AbstractFigure
Returns:
a Vector of handles
See Also:
Handle

displayBox

public java.awt.Rectangle displayBox()
Gets the display box. This is the union of all figures.

Specified by:
displayBox in interface Figure
Specified by:
displayBox in class AbstractFigure
See Also:
Figure.basicDisplayBox(java.awt.Point, java.awt.Point)

basicDisplayBox

public void basicDisplayBox(java.awt.Point p1,
                            java.awt.Point p2)
Description copied from class: AbstractFigure
Sets the display box of a figure. This is the method that subclassers override. Clients usually call displayBox.

Specified by:
basicDisplayBox in interface Figure
Specified by:
basicDisplayBox in class AbstractFigure
Parameters:
p1 - the new origin
p2 - the new corner
See Also:
AbstractFigure.displayBox(java.awt.Point, java.awt.Point)

lock

public void lock()
Acquires the drawing lock.

Specified by:
lock in interface Drawing

unlock

public void unlock()
Releases the drawing lock.

Specified by:
unlock in interface Drawing