public class FloatingTextField
extends java.lang.Object
TextHolderFigure
.
FloatingTextField
requires a two step initialization:
In a first step the overlay is created and in a
second step it can be positioned.
Framework
The text creation and editing tools and the TextHolderFigure
interface define together the contracts of a smaller framework inside of the
JHotDraw framework for structured drawing editors.
Contract: TextHolderFigure
, TextCreationTool
,
TextAreaCreationTool
,
TextEditingTool
,
TextAreaEditingTool
, FloatingTextField
,
FloatingTextArea
.
Constructor and Description |
---|
FloatingTextField() |
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an action listener
|
void |
createOverlay(DrawingView view,
TextHolderFigure figure)
Creates the overlay for the given Container using a
specific font.
|
void |
endOverlay()
Removes the overlay.
|
java.awt.Insets |
getInsets() |
java.awt.Dimension |
getPreferredSize(int cols)
Gets the preferred size of the overlay.
|
java.lang.String |
getText()
Gets the text contents of the overlay.
|
void |
removeActionListener(java.awt.event.ActionListener listener)
Remove an action listener
|
void |
requestFocus() |
protected void |
updateWidget() |
public void requestFocus()
public void createOverlay(DrawingView view, TextHolderFigure figure)
protected void updateWidget()
public java.awt.Insets getInsets()
public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
public java.lang.String getText()
public java.awt.Dimension getPreferredSize(int cols)
public void endOverlay()