JHotDraw 6.0b1

org.jhotdraw.figures
Class NullFigure

java.lang.Object
  extended by org.jhotdraw.standard.AbstractFigure
      extended by org.jhotdraw.figures.NullFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Figure, Storable

public class NullFigure
extends AbstractFigure

See Also:
Serialized Form

Constructor Summary
NullFigure()
           
 
Method Summary
 void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)
          Changes the display box of a figure.
protected  void basicMoveBy(int dx, int dy)
          Moves the figure.
 java.lang.Object clone()
          Returns a Clone of this figure
 FigureEnumeration decompose()
          Decomposes a figure into its parts.
 java.awt.Rectangle displayBox()
          Gets the display box of a figure
 void draw(java.awt.Graphics g)
          Draws the figure.
 FigureEnumeration figures()
          Returns an Enumeration of the figures contained in this figure
 Figure findFigureInside(int x, int y)
          Returns the figure that contains the given point.
 java.lang.Object getAttribute(FigureAttributeConstant attributeConstant)
          Returns the named attribute or null if a a figure doesn't have an attribute.
 java.lang.Object getAttribute(java.lang.String name)
          Deprecated. use getAttribute(FigureAttributeConstant) instead
 HandleEnumeration handles()
          Returns the handles used to manipulate the figure.
 boolean includes(Figure figure)
          Checks whether the given figure is contained in this figure.
 void invalidate()
          Invalidates the figure.
 boolean isEmpty()
          Checks if the Figure should be considered as empty.
 void release()
          Releases a figure's resources.
 void setAttribute(FigureAttributeConstant attributeConstant, java.lang.Object value)
          Sets the named attribute to the new value
 void setAttribute(java.lang.String name, java.lang.Object value)
          Deprecated. use setAttribute(FigureAttributeConstant, Object) instead
 
Methods inherited from class org.jhotdraw.standard.AbstractFigure
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, displayBox, displayBox, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, invalidateRectangle, listener, moveBy, read, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullFigure

public NullFigure()
Method Detail

basicMoveBy

protected void basicMoveBy(int dx,
                           int dy)
Moves the figure. This is the method that subclassers override. Clients usually call displayBox.

Specified by:
basicMoveBy in class AbstractFigure
See Also:
AbstractFigure.moveBy(int, int)

basicDisplayBox

public void basicDisplayBox(java.awt.Point origin,
                            java.awt.Point corner)
Changes the display box of a figure. This method is always implemented in figure subclasses. It only changes the displaybox and does not announce any changes. It is usually not called by the client. Clients typically call displayBox to change the display box.

Specified by:
basicDisplayBox in interface Figure
Specified by:
basicDisplayBox in class AbstractFigure
Parameters:
origin - the new origin
corner - the new corner
See Also:
displayBox()

displayBox

public java.awt.Rectangle displayBox()
Gets the display box of a figure

Specified by:
displayBox in interface Figure
Specified by:
displayBox in class AbstractFigure
See Also:
basicDisplayBox(java.awt.Point, java.awt.Point)

draw

public void draw(java.awt.Graphics g)
Draws the figure.

Parameters:
g - the Graphics to draw into

handles

public HandleEnumeration handles()
Returns the handles used to manipulate the figure. Handles is a Factory Method for creating handle objects.

Specified by:
handles in interface Figure
Specified by:
handles in class AbstractFigure
Returns:
an type-safe iterator of handles
See Also:
Handle

isEmpty

public boolean isEmpty()
Checks if the Figure should be considered as empty.

Specified by:
isEmpty in interface Figure
Overrides:
isEmpty in class AbstractFigure
See Also:
Figure.isEmpty()

figures

public FigureEnumeration figures()
Returns an Enumeration of the figures contained in this figure

Specified by:
figures in interface Figure
Overrides:
figures in class AbstractFigure
See Also:
CompositeFigure

findFigureInside

public Figure findFigureInside(int x,
                               int y)
Returns the figure that contains the given point.

Specified by:
findFigureInside in interface Figure
Overrides:
findFigureInside in class AbstractFigure
See Also:
AbstractFigure.containsPoint(int, int)

clone

public java.lang.Object clone()
Returns a Clone of this figure

Specified by:
clone in interface Figure
Overrides:
clone in class AbstractFigure
See Also:
Figure.clone()

includes

public boolean includes(Figure figure)
Checks whether the given figure is contained in this figure.

Specified by:
includes in interface Figure
Overrides:
includes in class AbstractFigure

decompose

public FigureEnumeration decompose()
Decomposes a figure into its parts. A figure is considered as a part of itself.

Specified by:
decompose in interface Figure
Overrides:
decompose in class AbstractFigure
Returns:
an Enumeration with itself as the only element.

release

public void release()
Releases a figure's resources. Release is called when a figure is removed from a drawing. Informs the listeners that the figure is removed by calling figureRemoved.

Specified by:
release in interface Figure
Overrides:
release in class AbstractFigure
See Also:
Figure.release()

invalidate

public void invalidate()
Invalidates the figure. This method informs its listeners that its current display box is invalid and should be refreshed.

Specified by:
invalidate in interface Figure
Overrides:
invalidate in class AbstractFigure

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Deprecated. use getAttribute(FigureAttributeConstant) instead

Returns the named attribute or null if a a figure doesn't have an attribute. All figures support the attribute names FillColor and FrameColor

Specified by:
getAttribute in interface Figure
Overrides:
getAttribute in class AbstractFigure

getAttribute

public java.lang.Object getAttribute(FigureAttributeConstant attributeConstant)
Returns the named attribute or null if a a figure doesn't have an attribute. All figures support the attribute names FillColor and FrameColor

Specified by:
getAttribute in interface Figure
Overrides:
getAttribute in class AbstractFigure

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Deprecated. use setAttribute(FigureAttributeConstant, Object) instead

Sets the named attribute to the new value

Specified by:
setAttribute in interface Figure
Overrides:
setAttribute in class AbstractFigure

setAttribute

public void setAttribute(FigureAttributeConstant attributeConstant,
                         java.lang.Object value)
Sets the named attribute to the new value

Specified by:
setAttribute in interface Figure
Overrides:
setAttribute in class AbstractFigure

JHotDraw 6.0b1