org.jhotdraw.draw.text
Class FloatingTextField
- java.lang.Object
-
- org.jhotdraw.draw.text.FloatingTextField
-
public class FloatingTextField extends java.lang.ObjectA floating text field that is used to edit aTextHolderFigure.FloatingTextFieldrequires a two step initialization: In a first step the overlay is created and in a second step it can be positioned.
Design PatternsFramework
The text creation and editing tools and theTextHolderFigureinterface 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 Summary
Constructors Constructor and Description FloatingTextField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddActionListener(java.awt.event.ActionListener listener)Adds an action listenervoidcreateOverlay(DrawingView view, TextHolderFigure figure)Creates the overlay for the given Container using a specific font.voidendOverlay()Removes the overlay.java.awt.InsetsgetInsets()java.awt.DimensiongetPreferredSize(int cols)Gets the preferred size of the overlay.java.lang.StringgetText()Gets the text contents of the overlay.voidremoveActionListener(java.awt.event.ActionListener listener)Remove an action listenervoidrequestFocus()
-
-
-
Method Detail
-
requestFocus
public void requestFocus()
-
createOverlay
public void createOverlay(DrawingView view, TextHolderFigure figure)
Creates the overlay for the given Container using a specific font.
-
getInsets
public java.awt.Insets getInsets()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener listener)
Adds an action listener
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
Remove an action listener
-
getText
public java.lang.String getText()
Gets the text contents of the overlay.
-
getPreferredSize
public java.awt.Dimension getPreferredSize(int cols)
Gets the preferred size of the overlay.
-
endOverlay
public void endOverlay()
Removes the overlay.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG