org.jhotdraw.samples.javadraw
Class BouncingDrawing

java.lang.Object
  extended byorg.jhotdraw.standard.AbstractFigure
      extended byorg.jhotdraw.standard.CompositeFigure
          extended byorg.jhotdraw.standard.StandardDrawing
              extended byorg.jhotdraw.samples.javadraw.BouncingDrawing
All Implemented Interfaces:
Animatable, java.lang.Cloneable, Drawing, java.util.EventListener, Figure, FigureChangeListener, java.io.Serializable, Storable

public class BouncingDrawing
extends StandardDrawing
implements Animatable

Version:
<$CURRENT_VERSION$>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.standard.CompositeFigure
_nHighestZ, _nLowestZ, fFigures
 
Fields inherited from interface org.jhotdraw.framework.Figure
POPUP_MENU
 
Constructor Summary
BouncingDrawing()
           
 
Method Summary
 Figure add(Figure figure)
          Adds a figure and sets its container to refer to this drawing.
 void animationStep()
          Perform a step of the animation.
 Figure remove(Figure figure)
          Removes the figure from the drawing and releases it.
 Figure replace(Figure figure, Figure replacement)
          Replaces a figure in the drawing without removing it from the drawing.
 
Methods inherited from class org.jhotdraw.standard.StandardDrawing
addDrawingChangeListener, basicDisplayBox, displayBox, drawingChangeListeners, figureInvalidated, figureRequestUpdate, fireDrawingTitleChanged, getTitle, handles, lock, orphan, removeDrawingChangeListener, setTitle, unlock
 
Methods inherited from class org.jhotdraw.standard.CompositeFigure
addAll, addAll, basicMoveBy, bringToFront, containsFigure, draw, draw, figureAt, figureChanged, figureCount, figureRemoved, figureRequestRemove, figures, figures, figuresReverse, findFigure, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphanAll, orphanAll, read, release, removeAll, removeAll, removeAll, sendToBack, sendToLayer, write
 
Methods inherited from class org.jhotdraw.standard.AbstractFigure
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, getAttribute, getAttribute, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, invalidate, invalidateRectangle, isEmpty, listener, moveBy, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setAttribute, setAttribute, setZValue, size, visit, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.framework.Drawing
addAll, addAll, bringToFront, containsFigure, draw, draw, figures, figures, figuresReverse, findFigure, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphanAll, orphanAll, release, removeAll, removeAll, sendToBack, sendToLayer
 
Methods inherited from interface org.jhotdraw.util.Storable
read, write
 
Methods inherited from interface org.jhotdraw.framework.FigureChangeListener
figureChanged, figureRemoved, figureRequestRemove
 

Constructor Detail

BouncingDrawing

public BouncingDrawing()
Method Detail

add

public Figure add(Figure figure)
Description copied from interface: Drawing
Adds a figure and sets its container to refer to this drawing.

Specified by:
add in interface Drawing
Overrides:
add in class StandardDrawing

remove

public Figure remove(Figure figure)
Description copied from interface: Drawing
Removes the figure from the drawing and releases it.

Specified by:
remove in interface Drawing
Overrides:
remove in class CompositeFigure
Parameters:
figure - that is part of the drawing and should be removed
Returns:
the figure that has been removed (might be different from the figure specified)
See Also:
CompositeFigure.removeAll(java.util.List)

replace

public Figure replace(Figure figure,
                      Figure replacement)
Description copied from interface: Drawing
Replaces a figure in the drawing without removing it from the drawing. The figure to be replaced must be part of the drawing.

Specified by:
replace in interface Drawing
Overrides:
replace in class CompositeFigure
Parameters:
figure - figure to be replaced
replacement - figure that should replace the specified figure
Returns:
the figure that has been inserted (might be different from the figure specified)

animationStep

public void animationStep()
Description copied from interface: Animatable
Perform a step of the animation.

Specified by:
animationStep in interface Animatable