|
JHotDraw 7.0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Drawing
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 |
add(int index,
Figure figure)
Adds a figure to the drawing. |
void |
addAll(java.util.Collection<Figure> figures)
Adds a collection of figures to the drawing. |
void |
addAll(int index,
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(int index,
java.util.Collection<Figure> figures)
Reinserts the specified figures which were temporarily removed 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 |
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. |
void |
fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
Notify all listenerList that have registered interest for notification on this event type. |
Dimension2DDouble |
getCanvasSize()
Gets the canvas size of this drawing. |
int |
getFigureCount()
Returns the number of figures in this drawing. |
java.util.List<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.util.List<InputFormat> |
getInputFormats()
Gets input formats for the Drawing in order of preferred formats. |
java.lang.Object |
getLock()
Returns the lock object on which all threads acting in Figures in this drawing synchronize to prevent race conditions. |
java.util.List<OutputFormat> |
getOutputFormats()
Gets output formats for the Drawing in order of preferred formats. |
int |
indexOf(Figure figure)
Returns the index of the specified figure. |
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 |
setCanvasSize(Dimension2DDouble canvasSize)
Sets the canvas size for this drawing. |
void |
setFontRenderContext(java.awt.font.FontRenderContext frc)
Sets the font render context used to do text leyout and text drawing. |
void |
setInputFormats(java.util.List<InputFormat> formats)
Sets input formats for the Drawing in order of preferred formats. |
void |
setOutputFormats(java.util.List<OutputFormat> formats)
Sets output formats for the Drawing in order of preferred formats. |
java.util.List<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 |
---|
void clear()
void add(Figure figure)
addNotify
message to the figure
after it has been added.
figure
- to be added to the drawingFigure.addNotify(org.jhotdraw.draw.Drawing)
void add(int index, Figure figure)
addNotify
message to the figure
after it has been added.
index
- The z-index of the figure.figure
- to be added to the drawingFigure.addNotify(org.jhotdraw.draw.Drawing)
void addAll(java.util.Collection<Figure> figures)
addNotify
message to each figure
after it has been added.
figures
- to be added to the drawingFigure.addNotify(org.jhotdraw.draw.Drawing)
void addAll(int index, java.util.Collection<Figure> figures)
addNotify
message to each figure
after it has been added.
index
- The z-index of the figure.figures
- to be added to the drawingFigure.addNotify(org.jhotdraw.draw.Drawing)
void remove(Figure figure)
removeNotify
message to the figure
before it is removed.
figure
- that is part of the drawing and should be removedFigure.removeNotify(org.jhotdraw.draw.Drawing)
void removeAll(java.util.Collection<Figure> figures)
removeNotify
message to each figure
before it is removed.
figures
- A collection of figures which are part of the drawing
and should be removedFigure.removeNotify(org.jhotdraw.draw.Drawing)
void basicRemove(Figure figure)
figure
- that is part of the drawing and should be removed#basicAdd(Figure
void basicRemoveAll(java.util.Collection<Figure> figures)
figures
- A collection of figures which are part of the drawing
and should be removedbasicAddAll(int, Collection)
void basicAdd(Figure figure)
This is a convenience method for calling
basicAdd(getFigureCount(), figure)
.
index
- The z-index of the figure.figure
- that is part of the drawing and should be removedbasicRemove(Figure)
void basicAdd(int index, Figure figure)
figure
- that is part of the drawing and should be removedbasicRemove(Figure)
int indexOf(Figure figure)
void basicAddAll(int index, java.util.Collection<Figure> figures)
index
- The insertion index.figures
- A collection of figures which are part of the drawing
and should be reinserted.basicRemoveAll(Collection)
void draw(java.awt.Graphics2D g)
java.util.List<Figure> findFigures(java.awt.geom.Rectangle2D.Double bounds)
java.util.List<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
java.util.List<Figure> getFigures()
int getFigureCount()
Figure findFigure(java.awt.geom.Point2D.Double p)
Figure findFigureExcept(java.awt.geom.Point2D.Double p, Figure ignore)
Figure findFigureExcept(java.awt.geom.Point2D.Double p, java.util.Collection<Figure> ignore)
Figure findFigureBehind(java.awt.geom.Point2D.Double p, Figure figure)
Figure findFigureBehind(java.awt.geom.Point2D.Double p, java.util.Collection<Figure> figures)
boolean contains(Figure f)
java.util.List<Figure> getFiguresFrontToBack()
Figure findFigureInside(java.awt.geom.Point2D.Double p)
void sendToBack(Figure figure)
figure
- that is part of the drawingvoid bringToFront(Figure figure)
figure
- that is part of the drawingjava.util.List<Figure> sort(java.util.Collection<Figure> figures)
void addDrawingListener(DrawingListener listener)
void removeDrawingListener(DrawingListener listener)
void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
java.awt.font.FontRenderContext getFontRenderContext()
void setFontRenderContext(java.awt.font.FontRenderContext frc)
java.lang.Object getLock()
void setInputFormats(java.util.List<InputFormat> formats)
The input formats are used for loading the Drawing from a file and for pasting Figures from the clipboard into the Drawing.
java.util.List<InputFormat> getInputFormats()
void setOutputFormats(java.util.List<OutputFormat> formats)
The output formats are used for saving the Drawing into a file and for cutting and copying Figures from the Drawing into the clipboard.
java.util.List<OutputFormat> getOutputFormats()
void setCanvasSize(Dimension2DDouble canvasSize)
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.
canvasSize
- The canvas size, or null.Dimension2DDouble getCanvasSize()
|
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 |