JHotDraw 7.0.6

org.jhotdraw.draw
Interface Drawing

All Superinterfaces:
DOMStorable, java.io.Serializable
All Known Implementing Classes:
AbstractDrawing, DefaultDrawing, QuadTreeDrawing, SVGDrawing

public interface Drawing
extends java.io.Serializable, DOMStorable

Drawing is a container for figures.

Drawing sends out DrawingChanged events to DrawingChangeListeners whenever a part of its area was invalidated.


Method Summary
 void add(Figure figure)
          Adds a figure to the drawing.
 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 basicAdd(int index, 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 basicRemove(Figure figure)
          Removes a figure temporarily from the drawing.
 void basicRemoveAll(java.util.Collection<Figure> figures)
          Removes the specified figures temporarily from the drawing.
 void bringToFront(Figure figure)
          Brings a figure to the front.
 void clear()
          Removes all figures from the drawing.
 boolean contains(Figure f)
          Returns true if this drawing contains the specified figure.
 void draw(java.awt.Graphics2D g)
          Draws all the figures from back to front.
 Figure findFigure(java.awt.geom.Point2D.Double p)
          Finds a top level Figure.
 Figure findFigureExcept(java.awt.geom.Point2D.Double p, java.util.Collection<Figure> ignore)
          Finds a top level Figure.
 Figure findFigureExcept(java.awt.geom.Point2D.Double p, Figure ignore)
          Finds a top level Figure.
 Figure findFigureInside(java.awt.geom.Point2D.Double p)
          Finds a figure but descends into a figure's children.
 java.util.Collection<Figure> findFigures(java.awt.geom.Rectangle2D.Double bounds)
          Returns all figures that lie within or intersect the specified bounds.
 java.util.Collection<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
          Returns all figures that lie within the specified bounds.
 void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
          Notify all listenerList that have registered interest for notification on this event type.
 int getFigureCount()
          Returns the number of figures in this drawing.
 java.util.Collection<Figure> getFigures()
          Returns the figures of the drawing.
 java.util.List<Figure> getFiguresFrontToBack()
          Returns a list of the figures in Z-Order from front to back.
 java.awt.font.FontRenderContext getFontRenderContext()
          Returns the font render context used to do text leyout and text drawing.
 java.lang.Object getLock()
          Returns the lock object on which all threads acting in Figures in this drawing synchronize to prevent race conditions.
 void remove(Figure figure)
          Removes a figure from the drawing.
 void removeAll(java.util.Collection<Figure> figures)
          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 sendToBack(Figure figure)
          Sends a figure to the back of the drawing.
 void setFontRenderContext(java.awt.font.FontRenderContext frc)
          Sets the font render context used to do text leyout and text drawing.
 java.util.Collection<Figure> sort(java.util.Collection<Figure> figures)
          Returns a copy of the provided collection which is sorted in z order from back to front.
 
Methods inherited from interface org.jhotdraw.xml.DOMStorable
read, write
 

Method Detail

clear

void clear()
Removes all figures from the drawing.


add

void add(Figure figure)
Adds a figure to the drawing. The drawing sends an addNotify message to the figure after it has been added.

Parameters:
figure - to be added to the drawing

addAll

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

Parameters:
figures - to be added to the drawing

remove

void remove(Figure figure)
Removes a figure from the drawing. The drawing sends a removeNotify message to the figure before it is removed.

Parameters:
figure - that is part of the drawing and should be removed

removeAll

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

Parameters:
figures - A collection of figures which are part of the drawing and should be removed

basicRemove

void basicRemove(Figure figure)
Removes a figure temporarily from the drawing. The drawing sends no removeNotify message to the figure.

Parameters:
figure - that is part of the drawing and should be removed
See Also:
basicAdd(Figure)

basicRemoveAll

void basicRemoveAll(java.util.Collection<Figure> figures)
Removes the specified figures temporarily from the drawing. The drawing sends no removeNotify message to the figures.

Parameters:
figures - A collection of figures which are part of the drawing and should be removed
See Also:
basicAddAll(Collection)

basicAdd

void basicAdd(Figure figure)
Reinserts a figure which was temporarily removed using basicRemove. The drawing sends no addNotify message to the figure.

Parameters:
figure - that is part of the drawing and should be removed
See Also:
basicRemove(Figure)

basicAdd

void basicAdd(int index,
              Figure figure)
Reinserts a figure which was temporarily removed using basicRemove. The drawing sends no addNotify message to the figure.

Parameters:
figure - that is part of the drawing and should be removed
See Also:
basicRemove(Figure)

basicAddAll

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

Parameters:
figures - A collection of figures which are part of the drawing and should be reinserted.
See Also:
basicRemoveAll(Collection)

draw

void draw(java.awt.Graphics2D g)
Draws all the figures from back to front.


findFigures

java.util.Collection<Figure> findFigures(java.awt.geom.Rectangle2D.Double bounds)
Returns all figures that lie within or intersect the specified bounds. The figures are returned in Z-order from back to front.


findFiguresWithin

java.util.Collection<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
Returns all figures that lie within the specified bounds. The figures are returned in Z-order from back to front.


getFigures

java.util.Collection<Figure> getFigures()
Returns the figures of the drawing.

Returns:
A Collection of Figure's.

getFigureCount

int getFigureCount()
Returns the number of figures in this drawing.


findFigure

Figure findFigure(java.awt.geom.Point2D.Double p)
Finds a top level Figure. Use this call for hit detection that should not descend into the figure's children.


findFigureExcept

Figure findFigureExcept(java.awt.geom.Point2D.Double p,
                        Figure ignore)
Finds a top level Figure. Use this call for hit detection that should not descend into the figure's children.


findFigureExcept

Figure findFigureExcept(java.awt.geom.Point2D.Double p,
                        java.util.Collection<Figure> ignore)
Finds a top level Figure. Use this call for hit detection that should not descend into the figure's children.


contains

boolean contains(Figure f)
Returns true if this drawing contains the specified figure.


getFiguresFrontToBack

java.util.List<Figure> getFiguresFrontToBack()
Returns a list of the figures in Z-Order from front to back.


findFigureInside

Figure findFigureInside(java.awt.geom.Point2D.Double p)
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.


sendToBack

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

Parameters:
figure - that is part of the drawing

bringToFront

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

Parameters:
figure - that is part of the drawing

sort

java.util.Collection<Figure> sort(java.util.Collection<Figure> figures)
Returns a copy of the provided collection which is sorted in z order from back to front.


addDrawingListener

void addDrawingListener(DrawingListener listener)
Adds a listener for this drawing.


removeDrawingListener

void removeDrawingListener(DrawingListener listener)
Removes a listener from this drawing.


addUndoableEditListener

void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Adds a listener for undooable edit events.


removeUndoableEditListener

void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Removes a listener for undoable edit events.


fireUndoableEditHappened

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


getFontRenderContext

java.awt.font.FontRenderContext getFontRenderContext()
Returns the font render context used to do text leyout and text drawing.


setFontRenderContext

void setFontRenderContext(java.awt.font.FontRenderContext frc)
Sets the font render context used to do text leyout and text drawing.


getLock

java.lang.Object getLock()
Returns the lock object on which all threads acting in Figures in this drawing synchronize to prevent race conditions.


Copyright 1996-2006 © JHotDraw.org