JHotDraw 6.0b1

Class NumberTextFigure

  extended by org.jhotdraw.standard.AbstractFigure
      extended by org.jhotdraw.figures.AttributeFigure
          extended by org.jhotdraw.figures.TextFigure
              extended by org.jhotdraw.figures.NumberTextFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Figure, FigureChangeListener, TextHolder, Storable

public class NumberTextFigure
extends TextFigure

A TextFigure specialized to edit numbers.

See Also:
Serialized Form

Constructor Summary
Method Summary
 Figure getRepresentingFigure()
          Usually, a TextHolders is implemented by a Figure subclass.
 int getValue()
          Gets the numerical value of the contained text.
 int overlayColumns()
          Gets the number of columns to be used by the text overlay.
 void setValue(int value)
          Sets the numberical value of the contained text.
Methods inherited from class org.jhotdraw.figures.TextFigure
acceptsTyping, basicDisplayBox, basicMoveBy, changed, connect, createCurrentFont, disconnect, displayBox, drawBackground, drawFrame, figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate, getAttribute, getAttribute, getFont, getLocator, getObservedFigure, getText, getTextHolder, handles, markDirty, moveBy, read, readOnly, release, setAttribute, setAttribute, setCurrentFontName, setCurrentFontSize, setCurrentFontStyle, setFont, setLocator, setObservedFigure, setReadOnly, setText, textDisplayBox, textExtent, updateLocation, write
Methods inherited from class org.jhotdraw.figures.AttributeFigure
draw, getDefaultAttribute, getDefaultAttribute, getFillColor, getFrameColor, initDefaultAttribute, setDefaultAttribute
Methods inherited from class org.jhotdraw.standard.AbstractFigure
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getZValue, includes, invalidate, invalidateRectangle, isEmpty, listener, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public NumberTextFigure()
Method Detail


public int overlayColumns()
Gets the number of columns to be used by the text overlay.

Specified by:
overlayColumns in interface TextHolder
overlayColumns in class TextFigure
See Also:


public int getValue()
Gets the numerical value of the contained text. return the value or 0 in the case of an illegal number format.


public void setValue(int value)
Sets the numberical value of the contained text.


public Figure getRepresentingFigure()
Usually, a TextHolders is implemented by a Figure subclass. To avoid casting a TextHolder to a Figure this method can be used for polymorphism (in this case, let the (same) object appear to be of another type). Note, that the figure returned is not the figure to which the TextHolder is (and its representing figure) connected.

Specified by:
getRepresentingFigure in interface TextHolder
getRepresentingFigure in class TextFigure
figure responsible for representing the content of this TextHolder
See Also:

JHotDraw 6.0b1