org.jhotdraw.standard
Interface TextHolder

All Known Implementing Classes:
TextAreaFigure, TextFigure

public interface TextHolder

The interface of a figure that has some editable text contents.

Version:
<$CURRENT_VERSION$>
See Also:
Figure

Method Summary
 boolean acceptsTyping()
          Tests whether the figure accepts typing.
 void connect(Figure connectedFigure)
          Connects a text holder to another figure.
 void disconnect(Figure disconnectFigure)
          Disconnects a text holder from a connect figure.
 java.awt.Font getFont()
          Gets the font.
 Figure getRepresentingFigure()
          Usually, a TextHolders is implemented by a Figure subclass.
 java.lang.String getText()
          Gets the text shown by the text figure.
 int overlayColumns()
          Gets the number of columns to be overlaid when the figure is edited.
 void setText(java.lang.String newText)
          Sets the text shown by the text figure.
 java.awt.Rectangle textDisplayBox()
           
 

Method Detail

textDisplayBox

public java.awt.Rectangle textDisplayBox()

getText

public java.lang.String getText()
Gets the text shown by the text figure.


setText

public void setText(java.lang.String newText)
Sets the text shown by the text figure.


acceptsTyping

public boolean acceptsTyping()
Tests whether the figure accepts typing.


overlayColumns

public int overlayColumns()
Gets the number of columns to be overlaid when the figure is edited.


connect

public void connect(Figure connectedFigure)
Connects a text holder to another figure.


disconnect

public void disconnect(Figure disconnectFigure)
Disconnects a text holder from a connect figure.


getFont

public java.awt.Font getFont()
Gets the font.


getRepresentingFigure

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.

Returns:
figure responsible for representing the content of this TextHolder