JHotDraw 7.0.6

org.jhotdraw.draw
Class AbstractDrawing

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractDrawing
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Drawing, DOMStorable
Direct Known Subclasses:
DefaultDrawing, QuadTreeDrawing

public abstract class AbstractDrawing
extends AbstractBean
implements Drawing

AbstractDrawing.

See Also:
Serialized Form

Field Summary
protected  javax.swing.event.EventListenerList listenerList
           
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
AbstractDrawing()
          Creates a new instance.
 
Method Summary
 void add(Figure figure)
          Calls basicAdd and then calls figure.addNotify and firesFigureAdded.
 void addAll(java.util.Collection<Figure> figures)
          Adds a collection of figures to the drawing.
 void addDrawingListener(DrawingListener listener)
          Adds a listener for this drawing.
 void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Adds a listener for undooable edit events.
 void basicAdd(Figure figure)
          Reinserts a figure which was temporarily removed using basicRemove.
 void basicAddAll(java.util.Collection<Figure> figures)
          Reinssets the specified figures which were temporarily basicRemoveed from the drawing.
 void basicRemoveAll(java.util.Collection<Figure> toBeOrphaned)
          Removes the specified figures temporarily from the drawing.
 void clear()
          Removes all figures.
protected  void fireAreaInvalidated(java.awt.geom.Rectangle2D.Double dirtyRegion)
          Notify all listenerList that have registered interest for notification on this event type.
protected  void fireFigureAdded(Figure f)
          Notify all listenerList that have registered interest for notification on this event type.
protected  void fireFigureRemoved(Figure f)
          Notify all listenerList that have registered interest for notification on this event type.
 void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
          Notify all listenerList that have registered interest for notification on this event type.
 int getFigureCount()
          Gets the number of figures.
 java.awt.font.FontRenderContext getFontRenderContext()
          Returns the font render context used to do text leyout and text drawing.
 java.lang.Object getLock()
          The drawing view synchronizes on the lock when drawing a drawing.
protected abstract  int indexOf(Figure figure)
           
 void read(DOMInput in)
           
 void remove(Figure figure)
          Calls basicRemove and then calls figure.addNotify and firesFigureAdded.
 void removeAll(java.util.Collection<Figure> toBeRemoved)
          Removes the specified figures from the drawing.
 void removeDrawingListener(DrawingListener listener)
          Removes a listener from this drawing.
 void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Removes a listener for undoable edit events.
 void setFontRenderContext(java.awt.font.FontRenderContext frc)
          Sets the font render context used to do text leyout and text drawing.
 void write(DOMOutput out)
           
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.draw.Drawing
basicAdd, basicRemove, bringToFront, contains, draw, findFigure, findFigureExcept, findFigureExcept, findFigureInside, findFigures, findFiguresWithin, getFigures, getFiguresFrontToBack, sendToBack, sort
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
Constructor Detail

AbstractDrawing

public AbstractDrawing()
Creates a new instance.

Method Detail

addDrawingListener

public void addDrawingListener(DrawingListener listener)
Description copied from interface: Drawing
Adds a listener for this drawing.

Specified by:
addDrawingListener in interface Drawing

removeDrawingListener

public void removeDrawingListener(DrawingListener listener)
Description copied from interface: Drawing
Removes a listener from this drawing.

Specified by:
removeDrawingListener in interface Drawing

addUndoableEditListener

public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Description copied from interface: Drawing
Adds a listener for undooable edit events.

Specified by:
addUndoableEditListener in interface Drawing

removeUndoableEditListener

public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Description copied from interface: Drawing
Removes a listener for undoable edit events.

Specified by:
removeUndoableEditListener in interface Drawing

addAll

public void addAll(java.util.Collection<Figure> figures)
Description copied from interface: Drawing
Adds a collection of figures to the drawing. The drawing sends an addNotify message to each figure after it has been added.

Specified by:
addAll in interface Drawing
Parameters:
figures - to be added to the drawing

clear

public void clear()
Removes all figures.

Specified by:
clear in interface Drawing

getFigureCount

public int getFigureCount()
Gets the number of figures.

Specified by:
getFigureCount in interface Drawing

removeAll

public void removeAll(java.util.Collection<Figure> toBeRemoved)
Description copied from interface: Drawing
Removes the specified figures from the drawing. The drawing sends a removeNotify message to each figure before it is removed.

Specified by:
removeAll in interface Drawing
Parameters:
toBeRemoved - A collection of figures which are part of the drawing and should be removed

basicAddAll

public void basicAddAll(java.util.Collection<Figure> figures)
Description copied from interface: Drawing
Reinssets the specified figures which were temporarily basicRemoveed from the drawing. The drawing sends no addNotify message to the figures.

Specified by:
basicAddAll in interface Drawing
Parameters:
figures - A collection of figures which are part of the drawing and should be reinserted.
See Also:
Drawing.basicRemoveAll(Collection)

basicRemoveAll

public void basicRemoveAll(java.util.Collection<Figure> toBeOrphaned)
Description copied from interface: Drawing
Removes the specified figures temporarily from the drawing. The drawing sends no removeNotify message to the figures.

Specified by:
basicRemoveAll in interface Drawing
Parameters:
toBeOrphaned - A collection of figures which are part of the drawing and should be removed
See Also:
Drawing.basicAddAll(Collection)

add

public final void add(Figure figure)
Calls basicAdd and then calls figure.addNotify and firesFigureAdded.

Specified by:
add in interface Drawing
Parameters:
figure - to be added to the drawing

basicAdd

public void basicAdd(Figure figure)
Description copied from interface: Drawing
Reinserts a figure which was temporarily removed using basicRemove. The drawing sends no addNotify message to the figure.

Specified by:
basicAdd in interface Drawing
Parameters:
figure - that is part of the drawing and should be removed
See Also:
Drawing.basicRemove(Figure)

remove

public final void remove(Figure figure)
Calls basicRemove and then calls figure.addNotify and firesFigureAdded.

Specified by:
remove in interface Drawing
Parameters:
figure - that is part of the drawing and should be removed

indexOf

protected abstract int indexOf(Figure figure)

fireAreaInvalidated

protected void fireAreaInvalidated(java.awt.geom.Rectangle2D.Double dirtyRegion)
Notify all listenerList that have registered interest for notification on this event type.


fireUndoableEditHappened

public void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
Notify all listenerList that have registered interest for notification on this event type.

Specified by:
fireUndoableEditHappened in interface Drawing

fireFigureAdded

protected void fireFigureAdded(Figure f)
Notify all listenerList that have registered interest for notification on this event type.


fireFigureRemoved

protected void fireFigureRemoved(Figure f)
Notify all listenerList that have registered interest for notification on this event type.


getFontRenderContext

public java.awt.font.FontRenderContext getFontRenderContext()
Description copied from interface: Drawing
Returns the font render context used to do text leyout and text drawing.

Specified by:
getFontRenderContext in interface Drawing

setFontRenderContext

public void setFontRenderContext(java.awt.font.FontRenderContext frc)
Description copied from interface: Drawing
Sets the font render context used to do text leyout and text drawing.

Specified by:
setFontRenderContext in interface Drawing

read

public void read(DOMInput in)
          throws java.io.IOException
Specified by:
read in interface DOMStorable
Throws:
java.io.IOException

write

public void write(DOMOutput out)
           throws java.io.IOException
Specified by:
write in interface DOMStorable
Throws:
java.io.IOException

getLock

public java.lang.Object getLock()
The drawing view synchronizes on the lock when drawing a drawing.

Specified by:
getLock in interface Drawing

Copyright 1996-2006 © JHotDraw.org