org.jhotdraw.draw.text
Class FloatingTextArea
- java.lang.Object
-
- org.jhotdraw.draw.text.FloatingTextArea
-
public class FloatingTextArea extends java.lang.ObjectA floating text area that is used to edit aTextHolderFigure.
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 FloatingTextArea()Constructor for the FloatingTextArea object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcreateOverlay(DrawingView view)Creates the overlay within the given container.voidcreateOverlay(DrawingView view, TextHolderFigure figure)Creates the overlay for the given Container using a specific font.voidendOverlay()Removes the overlay.java.awt.DimensiongetPreferredSize(int cols)Gets the preferred size of the overlay.java.lang.StringgetText()Gets the text contents of the overlay.voidrequestFocus()voidsetBounds(java.awt.geom.Rectangle2D.Double r, java.lang.String text)Positions and sizes the overlay.
-
-
-
Constructor Detail
-
FloatingTextArea
public FloatingTextArea()
Constructor for the FloatingTextArea object
-
-
Method Detail
-
createOverlay
public void createOverlay(DrawingView view)
Creates the overlay within the given container.- Parameters:
view- the DrawingView
-
requestFocus
public void requestFocus()
-
createOverlay
public void createOverlay(DrawingView view, @Nullable TextHolderFigure figure)
Creates the overlay for the given Container using a specific font.- Parameters:
view- the DrawingViewfigure- the figure holding the text
-
setBounds
public void setBounds(java.awt.geom.Rectangle2D.Double r, java.lang.String text)Positions and sizes the overlay.- Parameters:
r- the bounding Rectangle2D.Double for the overlaytext- the text to edit
-
getText
public java.lang.String getText()
Gets the text contents of the overlay.- Returns:
- The text value
-
getPreferredSize
public java.awt.Dimension getPreferredSize(int cols)
Gets the preferred size of the overlay.- Parameters:
cols- Description of the Parameter- Returns:
- The preferredSize value
-
endOverlay
public void endOverlay()
Removes the overlay.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG