JHotDraw 7.3.1

org.jhotdraw.draw
Class AbstractDrawing

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractCompositeFigure
              extended by org.jhotdraw.draw.AbstractAttributedCompositeFigure
                  extended by org.jhotdraw.draw.AbstractDrawing
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CompositeFigure, Drawing, Figure, DOMStorable
Direct Known Subclasses:
DefaultDrawing, QuadTreeDrawing

public abstract class AbstractDrawing
extends AbstractAttributedCompositeFigure
implements Drawing

This abstract class can be extended to implement a Drawing.

Version:
$Id: AbstractDrawing.java 550 2009-09-02 18:57:29Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

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
AbstractDrawing()
          Creates a new instance.
 
Method Summary
 void addInputFormat(InputFormat format)
          Adds an input format to the drawing.
 void addOutputFormat(OutputFormat format)
          Adds an output format to the drawing.
 void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Adds a listener for undooable edit events.
 AbstractDrawing clone()
          Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators.
 void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
          Notify all listenerList that have registered interest for notification on this event type.
 Drawing getDrawing()
           
 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()
          The drawing view synchronizes on the lock when drawing a drawing.
 java.util.List<OutputFormat> getOutputFormats()
          Gets output formats for the Drawing in order of preferred formats.
 void read(DOMInput in)
           
 void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Removes a listener for undoable edit events.
 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.
 void write(DOMOutput out)
           
 
Methods inherited from class org.jhotdraw.draw.AbstractAttributedCompositeFigure
applyAttributesTo, drawChildren, drawFigure, drawFill, drawStroke, drawText, get, getAttributeKey, getAttributes, getAttributesRestoreData, getFigureDrawBounds, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, set, setAttributeEnabled, setAttributeOnChildren, setAttributes, writeAttributes
 
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, contains, createEventHandler, createHandles, draw, findChild, findChildIndex, findFigureInside, fireFigureAdded, fireFigureRemoved, getBounds, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, invalidate, layout, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreTransformTo, sendToBack, setBounds, setLayouter, transform, validate, willChange
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, basicClone, canConnect, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, getActions, getChangingDepth, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isChanging, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setRemovable, setSelectable, setTransformable, setVisible, toString
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, 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, bringToFront, findFigure, findFigureBehind, findFigureBehind, findFigureExcept, findFigureExcept, findFigureInside, findFigures, findFiguresWithin, getFiguresFrontToBack, remove, removeAll, sendToBack, sort
 
Methods inherited from interface org.jhotdraw.draw.CompositeFigure
addCompositeFigureListener, basicRemoveAllChildren, basicRemoveChild, contains, getChild, getChildCount, getChildren, getLayouter, indexOf, layout, removeAllChildren, removeChild, removeCompositeFigureListener, setLayouter
 
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addNotify, canConnect, changed, contains, createHandles, draw, findCompatibleConnector, findConnector, get, getActions, 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, set, setBounds, transform, willChange
 

Constructor Detail

AbstractDrawing

public AbstractDrawing()
Creates a new instance.

Method Detail

addUndoableEditListener

public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Description copied from interface: Drawing
Adds a listener for undooable edit events.

Specified by:
addUndoableEditListener in interface Drawing

removeUndoableEditListener

public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Description copied from interface: Drawing
Removes a listener for undoable edit events.

Specified by:
removeUndoableEditListener in interface Drawing

fireUndoableEditHappened

public void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
Notify all listenerList that have registered interest for notification on this event type.

Specified by:
fireUndoableEditHappened in interface Drawing
Overrides:
fireUndoableEditHappened in class AbstractFigure

getFontRenderContext

public java.awt.font.FontRenderContext getFontRenderContext()
Description copied from interface: Drawing
Returns the font render context used to do text leyout and text drawing.

Specified by:
getFontRenderContext in interface Drawing
Overrides:
getFontRenderContext in class AbstractFigure

setFontRenderContext

public void setFontRenderContext(java.awt.font.FontRenderContext frc)
Description copied from interface: Drawing
Sets the font render context used to do text leyout and text drawing.

Specified by:
setFontRenderContext in interface Drawing

read

public void read(DOMInput in)
          throws java.io.IOException
Specified by:
read in interface DOMStorable
Overrides:
read in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

write

public void write(DOMOutput out)
           throws java.io.IOException
Specified by:
write in interface DOMStorable
Overrides:
write in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

getLock

public java.lang.Object getLock()
The drawing view synchronizes on the lock when drawing a drawing.

Specified by:
getLock in interface Drawing
Overrides:
getLock in class AbstractFigure

addInputFormat

public void addInputFormat(InputFormat format)
Description copied from interface: Drawing
Adds an input format to the drawing.

Specified by:
addInputFormat in interface Drawing

addOutputFormat

public void addOutputFormat(OutputFormat format)
Description copied from interface: Drawing
Adds an output format to the drawing.

Specified by:
addOutputFormat in interface Drawing

setOutputFormats

public void setOutputFormats(java.util.List<OutputFormat> formats)
Description copied from interface: Drawing
Sets output formats for the Drawing in order of preferred 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.

Specified by:
setOutputFormats in interface Drawing

setInputFormats

public void setInputFormats(java.util.List<InputFormat> formats)
Description copied from interface: Drawing
Sets input formats for the Drawing in order of preferred formats.

The input formats are used for loading the Drawing from a file and for pasting Figures from the clipboard into the Drawing.

Specified by:
setInputFormats in interface Drawing

getInputFormats

public java.util.List<InputFormat> getInputFormats()
Description copied from interface: Drawing
Gets input formats for the Drawing in order of preferred formats.

Specified by:
getInputFormats in interface Drawing

getOutputFormats

public java.util.List<OutputFormat> getOutputFormats()
Description copied from interface: Drawing
Gets output formats for the Drawing in order of preferred formats.

Specified by:
getOutputFormats in interface Drawing

getDrawing

public Drawing getDrawing()
Overrides:
getDrawing in class AbstractFigure

clone

public AbstractDrawing clone()
Description copied from interface: Figure
Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators. The cloned figure does not clone the list of FigureListeners from its original.

Specified by:
clone in interface Figure
Overrides:
clone in class AbstractAttributedCompositeFigure

Copyright 1996-2009 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.