| 
JHotDraw 7.1 | ||||||||
| 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.AbstractFigure
org.jhotdraw.draw.AbstractCompositeFigure
org.jhotdraw.draw.AbstractAttributedCompositeFigure
org.jhotdraw.draw.AbstractDrawing
org.jhotdraw.draw.DefaultDrawing
public class DefaultDrawing
DefaultDrawing to be used for drawings that contain only a few children.
 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 | 
|---|
| Nested classes/interfaces inherited from class org.jhotdraw.draw.AbstractCompositeFigure | 
|---|
AbstractCompositeFigure.EventHandler | 
| Field Summary | 
|---|
| Fields inherited from class org.jhotdraw.draw.AbstractCompositeFigure | 
|---|
cachedBounds, cachedDrawingArea, children, eventHandler, layouter | 
| Fields inherited from class org.jhotdraw.draw.AbstractFigure | 
|---|
changingDepth, listenerList | 
| Fields inherited from class org.jhotdraw.beans.AbstractBean | 
|---|
propertySupport | 
| Fields inherited from interface org.jhotdraw.draw.CompositeFigure | 
|---|
LAYOUT_INSETS | 
| Constructor Summary | |
|---|---|
DefaultDrawing()
Creates a new instance.  | 
|
| Method Summary | |
|---|---|
 void | 
bringToFront(Figure figure)
Brings a figure to the front.  | 
 DefaultDrawing | 
clone()
Returns a clone of the figure, with clones of all aggregated figures, such as chilrend and decorators.  | 
 void | 
draw(java.awt.Graphics2D g)
Draws the figure.  | 
 void | 
draw(java.awt.Graphics2D g,
     java.util.Collection<Figure> children)
 | 
protected  void | 
drawFill(java.awt.Graphics2D g)
This method is called by method draw() to draw the fill area of the figure.  | 
protected  void | 
drawStroke(java.awt.Graphics2D g)
This method is called by method draw() to draw the text of the figure .  | 
 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> children)
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)
Returns the figure that contains the given point.  | 
 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> | 
getFiguresFrontToBack()
Returns an iterator to iterate in Z-order front to back over the children.  | 
 int | 
indexOf(Figure figure)
Returns the index of the specified child.  | 
 void | 
sendToBack(Figure figure)
Sends a figure to the back of the composite figure.  | 
protected  void | 
setAttributeOnChildren(AttributeKey key,
                       java.lang.Object newValue)
 | 
 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 | 
|---|
addInputFormat, addOutputFormat, addUndoableEditListener, fireUndoableEditHappened, getDrawing, getFontRenderContext, getInputFormats, getLock, getOutputFormats, read, removeUndoableEditListener, setFontRenderContext, setInputFormats, setOutputFormats, write | 
| Methods inherited from class org.jhotdraw.draw.AbstractAttributedCompositeFigure | 
|---|
applyAttributesTo, drawChildren, drawFigure, drawText, getAttribute, getAttributeKey, getAttributes, getAttributesRestoreData, getFigureDrawBounds, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttribute, setAttributeEnabled, setAttributes, writeAttributes | 
| Methods inherited from class org.jhotdraw.beans.AbstractBean | 
|---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener | 
| Methods inherited from class java.lang.Object | 
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.jhotdraw.draw.Drawing | 
|---|
add, add, addAll, addAll, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, getChildCount, getChildren, remove, removeAll | 
| Methods inherited from interface org.jhotdraw.draw.CompositeFigure | 
|---|
addCompositeFigureListener, basicRemoveAllChildren, basicRemoveChild, contains, getChild, getLayouter, layout, removeAllChildren, removeChild, removeCompositeFigureListener, setLayouter | 
| Methods inherited from interface org.jhotdraw.draw.Figure | 
|---|
addFigureListener, addNotify, canConnect, changed, contains, createHandles, findCompatibleConnector, findConnector, getActions, getAttribute, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, restoreAttributesTo, restoreTransformTo, setAttribute, setBounds, transform, willChange | 
| Constructor Detail | 
|---|
public DefaultDrawing()
| Method Detail | 
|---|
public void draw(java.awt.Graphics2D g)
Figure
draw in interface Drawingdraw in interface Figuredraw in class AbstractCompositeFigureg - The Graphics2D to draw to.
public void draw(java.awt.Graphics2D g,
                 java.util.Collection<Figure> children)
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> children)
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 Figure findFigureInside(java.awt.geom.Point2D.Double p)
Figure
findFigureInside in interface DrawingfindFigureInside in interface FigurefindFigureInside in class AbstractCompositeFigurepublic java.util.List<Figure> getFiguresFrontToBack()
public void bringToFront(Figure figure)
Drawing
figure - that is part of the drawingpublic void sendToBack(Figure figure)
AbstractCompositeFigure
sendToBack in interface DrawingsendToBack in class AbstractCompositeFigurefigure - that is part of this composite figure
protected void setAttributeOnChildren(AttributeKey key,
                                      java.lang.Object newValue)
setAttributeOnChildren in class AbstractAttributedCompositeFigurepublic 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
public int indexOf(Figure figure)
CompositeFigure
 This is a convenience method for calling 
 getChildren().indexOf(index);.
indexOf in interface CompositeFigureindexOf in interface DrawingindexOf in class AbstractCompositeFigurepublic DefaultDrawing clone()
Figure
clone in interface Figureclone in class AbstractAttributedCompositeFigureprotected void drawFill(java.awt.Graphics2D g)
AbstractAttributedCompositeFigure
drawFill in class AbstractAttributedCompositeFigureprotected void drawStroke(java.awt.Graphics2D g)
AbstractAttributedCompositeFigure
drawStroke in class AbstractAttributedCompositeFigure
  | 
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 | ||||||||