|
JHotDraw 7.0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractDrawing
org.jhotdraw.draw.QuadTreeDrawing
public class QuadTreeDrawing
QuadTreeDrawing uses a QuadTree2DDouble to improve responsiveness of drawings which contain many figures.
| Field Summary |
|---|
| Fields inherited from class org.jhotdraw.draw.AbstractDrawing |
|---|
listenerList |
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Constructor Summary | |
|---|---|
QuadTreeDrawing()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
basicAdd(int index,
Figure figure)
Reinserts a figure which was temporarily removed using basicRemove. |
void |
basicRemove(Figure figure)
Removes a figure temporarily from the drawing. |
void |
bringToFront(Figure figure)
Brings a figure to the front. |
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. |
void |
draw(java.awt.Graphics2D g,
java.util.Collection<Figure> c)
|
void |
figureAdded(FigureEvent e)
Sent when a figure was added to a drawing. |
void |
figureAreaInvalidated(FigureEvent e)
Sent when an area used by the figure needs to be repainted. |
void |
figureAttributeChanged(FigureEvent e)
Sent when an attribute of the figure has changed. |
void |
figureChanged(FigureEvent e)
Sent when the geometry (e.g. |
void |
figureRemoved(FigureEvent e)
Sent when a figure was removed from a drawing. |
void |
figureRequestRemove(FigureEvent e)
Sent when the figure requests to be removed from a drawing. |
Figure |
findFigure(java.awt.geom.Point2D.Double p)
Finds a top level Figure. |
Figure |
findFigureExcept(java.awt.geom.Point2D.Double p,
java.util.Collection 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 r)
Returns all figures that lie within or intersect the specified bounds. |
java.util.Collection<Figure> |
findFiguresWithin(java.awt.geom.Rectangle2D.Double r)
Returns all figures that lie within the specified bounds. |
java.util.Collection<Figure> |
getFigures()
Returns the figures of the drawing. |
java.util.Collection<Figure> |
getFigures(java.awt.geom.Rectangle2D.Double bounds)
|
java.util.List<Figure> |
getFiguresFrontToBack()
Returns an iterator to iterate in Z-order front to back over the figures. |
protected int |
indexOf(Figure figure)
|
void |
sendToBack(Figure figure)
Sends a figure to the back of the drawing. |
java.util.Collection<Figure> |
sort(java.util.Collection<Figure> c)
Implementation note: Sorting can not be done for orphaned figures. |
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent e)
We propagate all edit events from our figures to undoable edit listeners, which have registered with us. |
| Methods inherited from class org.jhotdraw.draw.AbstractDrawing |
|---|
add, addAll, addDrawingListener, addUndoableEditListener, basicAdd, basicAddAll, basicRemoveAll, clear, fireAreaInvalidated, fireFigureAdded, fireFigureRemoved, fireUndoableEditHappened, getFigureCount, getFontRenderContext, getLock, read, remove, removeAll, removeDrawingListener, removeUndoableEditListener, setFontRenderContext, write |
| 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 |
| Constructor Detail |
|---|
public QuadTreeDrawing()
| Method Detail |
|---|
protected int indexOf(Figure figure)
indexOf in class AbstractDrawing
public void basicAdd(int index,
Figure figure)
DrawingaddNotify message to the figure.
basicAdd in interface Drawingfigure - that is part of the drawing and should be removedDrawing.basicRemove(Figure)public void basicRemove(Figure figure)
Drawing
basicRemove in interface Drawingfigure - that is part of the drawing and should be removedDrawing.basicAdd(Figure)public void draw(java.awt.Graphics2D g)
Drawing
draw in interface Drawingpublic java.util.Collection<Figure> sort(java.util.Collection<Figure> c)
sort in interface Drawing
public void draw(java.awt.Graphics2D g,
java.util.Collection<Figure> c)
public void figureAreaInvalidated(FigureEvent e)
FigureListener
figureAreaInvalidated in interface FigureListenerpublic void figureChanged(FigureEvent e)
FigureListener
figureChanged in interface FigureListenerpublic void figureAdded(FigureEvent e)
FigureListener
figureAdded in interface FigureListenerpublic void figureRemoved(FigureEvent e)
FigureListener
figureRemoved in interface FigureListenerpublic void figureRequestRemove(FigureEvent e)
FigureListener
figureRequestRemove in interface FigureListenerpublic java.util.Collection<Figure> getFigures(java.awt.geom.Rectangle2D.Double bounds)
public java.util.Collection<Figure> getFigures()
Drawing
getFigures in interface Drawingpublic Figure findFigureInside(java.awt.geom.Point2D.Double p)
Drawing
findFigureInside in interface Drawingpublic java.util.List<Figure> getFiguresFrontToBack()
getFiguresFrontToBack in interface Drawingpublic Figure findFigure(java.awt.geom.Point2D.Double p)
Drawing
findFigure in interface Drawing
public Figure findFigureExcept(java.awt.geom.Point2D.Double p,
Figure ignore)
Drawing
findFigureExcept in interface Drawing
public Figure findFigureExcept(java.awt.geom.Point2D.Double p,
java.util.Collection ignore)
Drawing
findFigureExcept in interface Drawingpublic java.util.Collection<Figure> findFigures(java.awt.geom.Rectangle2D.Double r)
Drawing
findFigures in interface Drawingpublic java.util.Collection<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double r)
Drawing
findFiguresWithin in interface Drawingpublic void bringToFront(Figure figure)
Drawing
bringToFront in interface Drawingfigure - that is part of the drawingpublic void sendToBack(Figure figure)
Drawing
sendToBack in interface Drawingfigure - that is part of the drawingpublic void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
undoableEditHappened in interface javax.swing.event.UndoableEditListenerpublic void figureAttributeChanged(FigureEvent e)
FigureListener
figureAttributeChanged in interface FigureListenerpublic boolean contains(Figure f)
Drawing
contains in interface Drawing
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||