|
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.DefaultDrawing
public class DefaultDrawing
DefaultDrawing to be used for drawings that contain only a few figures.
For larger drawings, QuadTreeDrawing
should be used.
FIXME - Maybe we should rename this class to SimpleDrawing or we should get rid of this class altogether.
Nested Class Summary | |
---|---|
protected class |
DefaultDrawing.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 | |
---|---|
DefaultDrawing()
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 DefaultDrawing.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> figures)
|
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<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.List<Figure> |
findFigures(java.awt.geom.Rectangle2D.Double bounds)
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> |
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)
Returns a copy of the provided collection which is sorted in z order from back to front. |
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 DefaultDrawing()
Method Detail |
---|
protected DefaultDrawing.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 void draw(java.awt.Graphics2D g, java.util.Collection<Figure> figures)
public java.util.List<Figure> sort(java.util.Collection<Figure> c)
Drawing
public Figure findFigure(java.awt.geom.Point2D.Double p)
Drawing
public Figure findFigureExcept(java.awt.geom.Point2D.Double p, Figure 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 Figure findFigureExcept(java.awt.geom.Point2D.Double p, java.util.Collection<Figure> ignore)
Drawing
public java.util.List<Figure> findFigures(java.awt.geom.Rectangle2D.Double bounds)
Drawing
public java.util.List<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
Drawing
public java.util.List<Figure> getFigures()
Drawing
public Figure findFigureInside(java.awt.geom.Point2D.Double p)
Drawing
public java.util.List<Figure> getFiguresFrontToBack()
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 |