Class FlatTextFieldUI

    • Field Detail

      • minimumWidth

        protected int minimumWidth
      • background

        private java.awt.Color background
      • disabledBackground

        protected java.awt.Color disabledBackground
      • inactiveBackground

        protected java.awt.Color inactiveBackground
      • placeholderForeground

        protected java.awt.Color placeholderForeground
      • focusedBackground

        protected java.awt.Color focusedBackground
      • iconTextGap

        protected int iconTextGap
        Since:
        2
      • leadingIcon

        protected javax.swing.Icon leadingIcon
        Since:
        2
      • trailingIcon

        protected javax.swing.Icon trailingIcon
        Since:
        2
      • leadingComponent

        protected javax.swing.JComponent leadingComponent
        Since:
        2
      • trailingComponent

        protected javax.swing.JComponent trailingComponent
        Since:
        2
      • clearButton

        protected javax.swing.JComponent clearButton
        Since:
        2
      • showClearButton

        protected boolean showClearButton
        Since:
        2
      • oldDisabledBackground

        private java.awt.Color oldDisabledBackground
      • oldInactiveBackground

        private java.awt.Color oldInactiveBackground
      • defaultMargin

        private java.awt.Insets defaultMargin
      • focusListener

        private java.awt.event.FocusListener focusListener
      • documentListener

        private javax.swing.event.DocumentListener documentListener
      • oldStyleValues

        private java.util.Map<java.lang.String,​java.lang.Object> oldStyleValues
      • borderShared

        private java.util.concurrent.atomic.AtomicBoolean borderShared
    • Constructor Detail

      • FlatTextFieldUI

        public FlatTextFieldUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)
      • installUI

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

        private void installUIImpl​(javax.swing.JComponent c)
      • uninstallUI

        public void uninstallUI​(javax.swing.JComponent c)
        Overrides:
        uninstallUI 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
      • createCaret

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

        protected void propertyChange​(java.beans.PropertyChangeEvent e)
        Overrides:
        propertyChange in class javax.swing.plaf.basic.BasicTextUI
      • installDocumentListener

        protected void installDocumentListener()
        Since:
        2
      • documentChanged

        protected void documentChanged​(javax.swing.event.DocumentEvent e)
        Since:
        2
      • installStyle

        protected void installStyle()
        Since:
        2
      • getStyleType

        java.lang.String getStyleType()
        Since:
        2
      • applyStyle

        protected void applyStyle​(java.lang.Object style)
        Since:
        2
      • applyStyleProperty

        protected java.lang.Object applyStyleProperty​(java.lang.String key,
                                                      java.lang.Object value)
        Since:
        2
      • updateBackground

        private void updateBackground()
      • updateBackground

        static void updateBackground​(javax.swing.text.JTextComponent c,
                                     java.awt.Color background,
                                     java.awt.Color disabledBackground,
                                     java.awt.Color inactiveBackground,
                                     java.awt.Color oldDisabledBackground,
                                     java.awt.Color oldInactiveBackground)
      • paintSafely

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

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

        static void paintBackground​(java.awt.Graphics g,
                                    javax.swing.text.JTextComponent c,
                                    java.awt.Color focusedBackground)
      • getBackground

        static java.awt.Color getBackground​(javax.swing.text.JTextComponent c,
                                            java.awt.Color focusedBackground)
      • paintPlaceholder

        protected void paintPlaceholder​(java.awt.Graphics g)
      • paintIcons

        protected void paintIcons​(java.awt.Graphics g,
                                  java.awt.Rectangle r)
        Paints the leading and trailing icons in the given rectangle. The rectangle is updated by this method so that subclasses can use it without painting over leading or trailing icons.
        Since:
        2
      • getPreferredSize

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

        public java.awt.Dimension getMinimumSize​(javax.swing.JComponent c)
        Overrides:
        getMinimumSize in class javax.swing.plaf.basic.BasicTextUI
      • applyExtraSize

        private java.awt.Dimension applyExtraSize​(java.awt.Dimension size)
      • applyMinimumWidth

        private java.awt.Dimension applyMinimumWidth​(javax.swing.JComponent c,
                                                     java.awt.Dimension size,
                                                     int minimumWidth)
      • hasDefaultMargins

        static boolean hasDefaultMargins​(javax.swing.JComponent c,
                                         java.awt.Insets defaultMargin)
      • getVisibleEditorRect

        protected java.awt.Rectangle getVisibleEditorRect()
        Returns the rectangle used for the root view of the text. This method is used to place the text.
        Overrides:
        getVisibleEditorRect in class javax.swing.plaf.basic.BasicTextUI
      • getIconsRect

        protected java.awt.Rectangle getIconsRect()
        Returns the rectangle used to paint leading and trailing icons. It invokes super.getVisibleEditorRect() and reduces left and/or right margin if the text field has leading or trailing icons or components. Also, the preferred widths of leading and trailing components are removed.
        Since:
        2
      • hasLeadingIcon

        protected boolean hasLeadingIcon()
        Since:
        2
      • hasTrailingIcon

        protected boolean hasTrailingIcon()
        Since:
        2
      • getLeadingIconWidth

        protected int getLeadingIconWidth()
        Since:
        2
      • getTrailingIconWidth

        protected int getTrailingIconWidth()
        Since:
        2
      • isLeftToRight

        boolean isLeftToRight()
      • getPadding

        protected java.awt.Insets getPadding()
        Since:
        1.4
      • scrollCaretToVisible

        protected void scrollCaretToVisible()
        Since:
        1.4
      • installLeadingComponent

        protected void installLeadingComponent()
        Since:
        2
      • installTrailingComponent

        protected void installTrailingComponent()
        Since:
        2
      • uninstallLeadingComponent

        protected void uninstallLeadingComponent()
        Since:
        2
      • uninstallTrailingComponent

        protected void uninstallTrailingComponent()
        Since:
        2
      • installClearButton

        protected void installClearButton()
        Since:
        2
      • uninstallClearButton

        protected void uninstallClearButton()
        Since:
        2
      • createClearButton

        protected javax.swing.JComponent createClearButton()
        Since:
        2
      • clearButtonClicked

        protected void clearButtonClicked()
        Since:
        2
      • updateClearButton

        protected void updateClearButton()
        Since:
        2
      • getLeadingComponents

        protected javax.swing.JComponent[] getLeadingComponents()
        Returns components placed at the leading side of the text field. The returned array may contain null. The default implementation returns leadingComponent.
        Since:
        2
      • getTrailingComponents

        protected javax.swing.JComponent[] getTrailingComponents()
        Returns components placed at the trailing side of the text field. The returned array may contain null. The default implementation returns trailingComponent and clearButton.

        Note: The components in the array must be in reverse (visual) order.

        Since:
        2
      • prepareLeadingOrTrailingComponent

        protected void prepareLeadingOrTrailingComponent​(javax.swing.JComponent c)
        Since:
        2
      • installLayout

        protected void installLayout()
        Since:
        2