|
JHotDraw 7.0.9 | ||||||||
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.
FIXME - Rename this class to DefaultDrawingView.
Nested Class Summary | |
---|---|
protected class |
QuadTreeDrawing.FigureHandler
Handles all figure events fired by Figures contained in the Drawing. |
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. |
protected QuadTreeDrawing.FigureHandler |
createFigureHandler()
|
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)
|
Figure |
findFigure(java.awt.geom.Point2D.Double p)
Finds a top level Figure. |
Figure |
findFigureBehind(java.awt.geom.Point2D.Double p,
java.util.Collection<Figure> figures)
Finds a top level Figure which is behind the specified Figures. |
Figure |
findFigureBehind(java.awt.geom.Point2D.Double p,
Figure figure)
Finds a top level Figure which is behind the specified 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.List<Figure> |
findFigures(java.awt.geom.Rectangle2D.Double r)
Returns all figures that lie within or intersect the specified bounds. |
java.util.List<Figure> |
findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
Returns all figures that lie within the specified bounds. |
Dimension2DDouble |
getCanvasSize()
Gets the canvas size of this drawing. |
java.util.List<Figure> |
getFigures()
Returns the figures of the drawing. |
java.util.List<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. |
int |
indexOf(Figure figure)
Returns the index of the specified figure. |
void |
sendToBack(Figure figure)
Sends a figure to the back of the drawing. |
void |
setCanvasSize(Dimension2DDouble newValue)
Sets the canvas size for this drawing. |
java.util.List<Figure> |
sort(java.util.Collection<Figure> c)
Implementation note: Sorting can not be done for orphaned figures. |
Methods inherited from class org.jhotdraw.draw.AbstractDrawing |
---|
add, add, addAll, addAll, addDrawingListener, addUndoableEditListener, basicAdd, basicAddAll, basicRemoveAll, clear, fireAreaInvalidated, fireFigureAdded, fireFigureRemoved, fireUndoableEditHappened, getFigureCount, getFontRenderContext, getInputFormats, getLock, getOutputFormats, read, remove, removeAll, removeDrawingListener, removeUndoableEditListener, setFontRenderContext, setInputFormats, setOutputFormats, 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 QuadTreeDrawing.FigureHandler createFigureHandler()
public int indexOf(Figure figure)
Drawing
public void basicAdd(int index, Figure figure)
Drawing
figure
- that is part of the drawing and should be removedDrawing.basicRemove(Figure)
public void basicRemove(Figure figure)
Drawing
figure
- that is part of the drawing and should be removed#basicAdd(Figure
public void draw(java.awt.Graphics2D g)
Drawing
public java.util.List<Figure> sort(java.util.Collection<Figure> c)
public void draw(java.awt.Graphics2D g, java.util.Collection<Figure> c)
public java.util.List<Figure> getFigures(java.awt.geom.Rectangle2D.Double bounds)
public java.util.List<Figure> getFigures()
Drawing
public Figure findFigureInside(java.awt.geom.Point2D.Double p)
Drawing
public java.util.List<Figure> getFiguresFrontToBack()
public Figure findFigure(java.awt.geom.Point2D.Double p)
Drawing
public Figure findFigureExcept(java.awt.geom.Point2D.Double p, Figure ignore)
Drawing
public Figure findFigureExcept(java.awt.geom.Point2D.Double p, java.util.Collection ignore)
Drawing
public Figure findFigureBehind(java.awt.geom.Point2D.Double p, Figure figure)
Drawing
public Figure findFigureBehind(java.awt.geom.Point2D.Double p, java.util.Collection<Figure> figures)
Drawing
public java.util.List<Figure> findFigures(java.awt.geom.Rectangle2D.Double r)
Drawing
public java.util.List<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
Drawing
public void bringToFront(Figure figure)
Drawing
figure
- that is part of the drawingpublic void sendToBack(Figure figure)
Drawing
figure
- that is part of the drawingpublic boolean contains(Figure f)
Drawing
public void setCanvasSize(Dimension2DDouble newValue)
Drawing
If canvasSize
is null, the size of the canvas
is expected to be adjusted dynamically to fit the drawing areas of all
figures contained in the drawing.
This is a bound property.
newValue
- The canvas size, or null.public Dimension2DDouble getCanvasSize()
Drawing
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |