JHotDraw 6.0b1

org.jhotdraw.standard
Interface TextHolder

All Known Implementing Classes:
HTMLTextAreaFigure, NodeFigure, NodeFigure, NumberTextFigure, TextAreaFigure, TextFigure

public interface TextHolder

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

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

java.awt.Rectangle textDisplayBox()

getText

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


setText

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


acceptsTyping

boolean acceptsTyping()
Tests whether the figure accepts typing.


overlayColumns

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


connect

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


disconnect

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


getFont

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


getRepresentingFigure

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

JHotDraw 6.0b1