JHotDraw 7.1

org.jhotdraw.draw
Class FloatingTextField

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

public class FloatingTextField
extends java.lang.Object

A text field overlay that is used to edit a TextFigure. A FloatingTextField requires a two step initialization: In a first step the overlay is created and in a second step it can be positioned.

Version:
2.0 2006-01-14 Changed to support double precision coordinates.
1.0 2003-12-01 Derived from JHotDraw 5.4b1.
Author:
Werner Randelshofer
See Also:
TextFigure

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()
           
 void setBounds(java.awt.Rectangle r, java.lang.String text)
          Positions the overlay.
 
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.


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


setBounds

public void setBounds(java.awt.Rectangle r,
                      java.lang.String text)
Positions the overlay.


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-2007 (c) JHotDraw.org.
Some rights reserved.