Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.pdf.plaf
Class PDFTextFieldUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TextUI
          extended by javax.swing.plaf.basic.BasicTextUI
              extended by javax.swing.plaf.basic.BasicTextFieldUI
                  extended by ch.randelshofer.pdf.plaf.PDFTextFieldUI
All Implemented Interfaces:
javax.swing.text.ViewFactory

public class PDFTextFieldUI
extends javax.swing.plaf.basic.BasicTextFieldUI

PDFTextFieldUI.

Version:
1.6 2007-08-06 Select all text when the user tabs into the field.
1.5 2007-07-27 Added 2 pixels to the preferred width.
1.4 2006-04-24 Fixed .opaque UIManager property. Added support for .popupHandler UIManager property.
1.2 2005-07-17 Adapted to changes in interface VisuallyLayoutable.
1.1.1 2005-06-26 Fixed NullPointerException in method getVisualBounds.
1.1 2005-02-27 Set to non-opaque. Support for margin added.
1.0 December 1, 2004 Created.
Author:
Werner Randelshofer

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTextUI
javax.swing.plaf.basic.BasicTextUI.BasicCaret, javax.swing.plaf.basic.BasicTextUI.BasicHighlighter
 
Constructor Summary
PDFTextFieldUI()
           
 
Method Summary
protected  javax.swing.text.Caret createCaret()
           
protected  java.awt.event.FocusListener createFocusListener()
           
protected  javax.swing.text.Highlighter createHighlighter()
           
protected  javax.swing.text.Keymap createKeymap()
          Creates the keymap to use for the text component, and installs any necessary bindings into it.
protected  java.awt.event.MouseListener createPopupListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent jcomponent)
          Preferred spacing between text fiels and other components.
 int getBaseline(javax.swing.JComponent c, int width, int height)
           
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
 java.awt.Insets getVisualMargin(javax.swing.text.JTextComponent tc)
           
protected  void installDefaults()
           
protected  void installListeners()
           
 void installUI(javax.swing.JComponent c)
           
protected  void paintSafely(java.awt.Graphics g)
           
 void propertyChange(java.beans.PropertyChangeEvent event)
           
protected  void uninstallDefaults()
           
protected  void uninstallListeners()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicTextFieldUI
create, getBaselineResizeBehavior, getPropertyPrefix
 
Methods inherited from class javax.swing.plaf.basic.BasicTextUI
create, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, getVisibleEditorRect, installKeyboardActions, modelChanged, modelToView, modelToView, paint, paintBackground, setView, uninstallKeyboardActions, uninstallUI, update, viewToModel, viewToModel
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFTextFieldUI

public PDFTextFieldUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent jcomponent)
Preferred spacing between text fiels and other components. / private final static Insets regularSpacing = new Insets(10,10,10,10); private final static Insets smallSpacing = new Insets(8,8,8,8); private final static Insets miniSpacing = new Insets(8,8,8,8);


installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.basic.BasicTextUI

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicTextUI

uninstallDefaults

protected void uninstallDefaults()
Overrides:
uninstallDefaults in class javax.swing.plaf.basic.BasicTextUI

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicTextUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicTextUI

createFocusListener

protected java.awt.event.FocusListener createFocusListener()

createPopupListener

protected java.awt.event.MouseListener createPopupListener()

getVisualMargin

public java.awt.Insets getVisualMargin(javax.swing.text.JTextComponent tc)

paintSafely

protected void paintSafely(java.awt.Graphics g)
Overrides:
paintSafely in class javax.swing.plaf.basic.BasicTextUI

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Overrides:
propertyChange in class javax.swing.plaf.basic.BasicTextUI

createCaret

protected javax.swing.text.Caret createCaret()
Overrides:
createCaret in class javax.swing.plaf.basic.BasicTextUI

createHighlighter

protected javax.swing.text.Highlighter createHighlighter()
Overrides:
createHighlighter in class javax.swing.plaf.basic.BasicTextUI

createKeymap

protected javax.swing.text.Keymap createKeymap()
Creates the keymap to use for the text component, and installs any necessary bindings into it. By default, the keymap is shared between all instances of this type of TextUI. The keymap has the name defined by the getKeymapName method. If the keymap is not found, then DEFAULT_KEYMAP from JTextComponent is used.

The set of bindings used to create the keymap is fetched from the UIManager using a key formed by combining the BasicTextFieldUI.getPropertyPrefix() method and the string .keyBindings. The type is expected to be JTextComponent.KeyBinding[].

Overrides:
createKeymap in class javax.swing.plaf.basic.BasicTextUI
Returns:
the keymap
See Also:
BasicTextUI.getKeymapName(), JTextComponent

getBaseline

public int getBaseline(javax.swing.JComponent c,
                       int width,
                       int height)
Overrides:
getBaseline in class javax.swing.plaf.basic.BasicTextFieldUI

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicTextUI

Copyright 2012-02-25 Werner Randelshofer