de.uni_paderborn.fujaba.fsa.swing
Class TextGrabUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byjavax.swing.plaf.PanelUI
          extended byde.uni_paderborn.fujaba.fsa.swing.BendUI
              extended byde.uni_paderborn.fujaba.fsa.swing.GrabUI
                  extended byde.uni_paderborn.fujaba.fsa.swing.TextGrabUI

public class TextGrabUI
extends GrabUI

Grab UI that has a TextComponent to edit the value of JBend.data

Version:
$Revision: 1.15 $
Author:
$Author: lowende $

Nested Class Summary
 class TextGrabUI.BendLayoutManager
          No comment provided by developer, please add a comment to improve documentation.
 class TextGrabUI.MouseHandler
          No comment provided by developer, please add a comment to improve documentation.
 class TextGrabUI.PropertyChangeHandler
          This listener watches for bound properties that have changed in the JTextComponent.
 
Constructor Summary
TextGrabUI()
           
 
Method Summary
 void addEditor()
          Adds the editor to the JTextComponent.
protected  void configureEditor()
          Configures the editor by setting its font and adding listeners.
protected  javax.swing.text.JTextComponent createEditor()
          No comment provided by developer, please add a comment to improve documentation.
protected  java.awt.LayoutManager createLayoutManager()
          No comment provided by developer, please add a comment to improve documentation.
protected  java.awt.event.MouseListener createMouseListener()
          No comment provided by developer, please add a comment to improve documentation.
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
          No comment provided by developer, please add a comment to improve documentation.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          No comment provided by developer, please add a comment to improve documentation.
 JBend getBend()
          Get the bend attribute of the TextGrabUI object
 javax.swing.text.JTextComponent getEditor()
          Get the editor attribute of the TextGrabUI object
protected  java.lang.String getEditorText()
          the text of the TextField
protected  java.awt.Insets getInsets()
          Gets the insets from the JTextComponent.
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
          Get the maximumSize attribute of the TextGrabUI object
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          Get the minimumSize attribute of the TextGrabUI object
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          Get the preferredSize attribute of the TextGrabUI object
 java.lang.String getText()
          the text of the grab.
protected  void installComponents()
          The editor and arrow button are added to the JTextComponent here.
protected  void installDefaults()
          Installs the default colors, default font, default renderer, and default editor into the JTextComponent.
protected  void installKeyboardActions()
          Adds keyboard actions to the JTextComponent.
protected  void installListeners()
          No comment provided by developer, please add a comment to improve documentation.
 void installUI(javax.swing.JComponent c)
          No comment provided by developer, please add a comment to improve documentation.
 boolean isEditorVisible(JBend b)
          Tells if the popup is visible or not.
 boolean isFocusTraversable(JBend c)
          Determines if the JTextComponent is focus traversable.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          No comment provided by developer, please add a comment to improve documentation.
 void paintCurrentValue(java.awt.Graphics g, java.awt.Rectangle bounds)
          Paints the currently selected item.
 void paintCurrentValueBackground(java.awt.Graphics g, java.awt.Rectangle bounds)
          Paints the background of the currently selected item.
protected  java.awt.Rectangle rectangleForCurrentValue()
          Returns the area that is reserved for drawing the currently selected item.
 void removeEditor()
          Removes the editor from the JTextComponent.
 boolean setBend(JBend bend)
          Sets the bend attribute of the TextGrabUI object
 boolean setEditor(javax.swing.text.JTextComponent editor)
          Sets the editor attribute of the TextGrabUI object
protected  void setEditorText(java.lang.String text)
          the text of the TextField
 boolean setEditorVisible(JBend b, boolean v)
          Hides the popup.
 boolean setText(java.lang.String text)
          the text of the grab. taken from grab.data
protected  void unconfigureEditor()
          Unconfigures the editor by removing listeners.
protected  void uninstallComponents()
          The editor and/or arrow button are removed from the JTextComponent here.
protected  void uninstallDefaults()
          No comment provided by developer, please add a comment to improve documentation.
protected  void uninstallKeyboardActions()
          Removes the keyboard actions that were added by installKeyboardActions().
protected  void uninstallListeners()
          No comment provided by developer, please add a comment to improve documentation.
 void uninstallUI(javax.swing.JComponent c)
          No comment provided by developer, please add a comment to improve documentation.
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.GrabUI
calculatePoint, getAlignmentOffset, getPadOffset, getTouchLength, getTouchOffset
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.BendUI
firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextGrabUI

public TextGrabUI()
Method Detail

getBend

public JBend getBend()
Get the bend attribute of the TextGrabUI object

Returns:
The bend value

setBend

public boolean setBend(JBend bend)
Sets the bend attribute of the TextGrabUI object

Parameters:
bend - The new bend value
Returns:
No description provided

getEditor

public javax.swing.text.JTextComponent getEditor()
Get the editor attribute of the TextGrabUI object

Returns:
The editor value

setEditor

public boolean setEditor(javax.swing.text.JTextComponent editor)
Sets the editor attribute of the TextGrabUI object

Parameters:
editor - The new editor value
Returns:
No description provided

getText

public java.lang.String getText()
the text of the grab.

Returns:
The text value

setText

public boolean setText(java.lang.String text)
the text of the grab. taken from grab.data

Parameters:
text - The new text value
Returns:
No description provided

getEditorText

protected java.lang.String getEditorText()
the text of the TextField

Returns:
The editorText value

setEditorText

protected void setEditorText(java.lang.String text)
the text of the TextField

Parameters:
text - The new editorText value

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
c - No description provided
Returns:
No description provided

installUI

public void installUI(javax.swing.JComponent c)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
c - No description provided

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
c - No description provided

installDefaults

protected void installDefaults()
Installs the default colors, default font, default renderer, and default editor into the JTextComponent.


installListeners

protected void installListeners()
No comment provided by developer, please add a comment to improve documentation.


uninstallDefaults

protected void uninstallDefaults()
No comment provided by developer, please add a comment to improve documentation.


uninstallListeners

protected void uninstallListeners()
No comment provided by developer, please add a comment to improve documentation.


createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createMouseListener

protected java.awt.event.MouseListener createMouseListener()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createEditor

protected javax.swing.text.JTextComponent createEditor()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

installComponents

protected void installComponents()
The editor and arrow button are added to the JTextComponent here.


uninstallComponents

protected void uninstallComponents()
The editor and/or arrow button are removed from the JTextComponent here. This method calls removeAll() on the JTextComponent just to make sure that everything gets removed.


addEditor

public void addEditor()
Adds the editor to the JTextComponent.


removeEditor

public void removeEditor()
Removes the editor from the JTextComponent. It also calls unconfigureEditor()


configureEditor

protected void configureEditor()
Configures the editor by setting its font and adding listeners.


unconfigureEditor

protected void unconfigureEditor()
Unconfigures the editor by removing listeners.


isEditorVisible

public boolean isEditorVisible(JBend b)
Tells if the popup is visible or not.

Parameters:
b - No description provided
Returns:
The editorVisible value

setEditorVisible

public boolean setEditorVisible(JBend b,
                                boolean v)
Hides the popup.

Parameters:
b - The new editorVisible value
v - The new editorVisible value
Returns:
No description provided

isFocusTraversable

public boolean isFocusTraversable(JBend c)
Determines if the JTextComponent is focus traversable. If the JTextComponent is editable this returns false, otherwise it returns true.

Parameters:
c - No description provided
Returns:
The focusTraversable value

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
No comment provided by developer, please add a comment to improve documentation.

Specified by:
paint in class BendUI
Parameters:
g - No description provided
c - No description provided

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Get the preferredSize attribute of the TextGrabUI object

Specified by:
getPreferredSize in class BendUI
Parameters:
c - No description provided
Returns:
The preferredSize value

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Get the minimumSize attribute of the TextGrabUI object

Parameters:
c - No description provided
Returns:
The minimumSize value

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Get the maximumSize attribute of the TextGrabUI object

Parameters:
c - No description provided
Returns:
The maximumSize value

rectangleForCurrentValue

protected java.awt.Rectangle rectangleForCurrentValue()
Returns the area that is reserved for drawing the currently selected item.

Returns:
No description provided

getInsets

protected java.awt.Insets getInsets()
Gets the insets from the JTextComponent.

Returns:
The insets value

paintCurrentValue

public void paintCurrentValue(java.awt.Graphics g,
                              java.awt.Rectangle bounds)
Paints the currently selected item.

Parameters:
g - No description provided
bounds - No description provided

paintCurrentValueBackground

public void paintCurrentValueBackground(java.awt.Graphics g,
                                        java.awt.Rectangle bounds)
Paints the background of the currently selected item.

Parameters:
g - No description provided
bounds - No description provided

installKeyboardActions

protected void installKeyboardActions()
Adds keyboard actions to the JTextComponent. Actions on enter and esc are already supplied. Add more actions as you need them.


uninstallKeyboardActions

protected void uninstallKeyboardActions()
Removes the keyboard actions that were added by installKeyboardActions().