JHotDraw 7.4.1

org.jhotdraw.draw.text
Class FloatingTextField

java.lang.Object
  extended by org.jhotdraw.draw.text.FloatingTextField

public class FloatingTextField
extends java.lang.Object

A floating text field that is used to edit a TextHolderFigure.

FloatingTextField requires a two step initialization: In a first step the overlay is created and in a second step it can be positioned.


Design Patterns

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.


Version:
$Id: FloatingTextField.java -1 $
Author:
Werner Randelshofer

Constructor Summary
FloatingTextField()
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Adds an action listener
 void createOverlay(DrawingView view)
          Creates the overlay for the given Component.
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatingTextField

public FloatingTextField()
Method Detail

createOverlay

public void createOverlay(DrawingView view)
Creates the overlay for the given Component.


requestFocus

public void requestFocus()

createOverlay

public void createOverlay(DrawingView view,
                          TextHolderFigure figure)
Creates the overlay for the given Container using a specific font.


updateWidget

protected void updateWidget()

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.


Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.