Class BasicHyperlinkUI


  • public class BasicHyperlinkUI
    extends javax.swing.plaf.basic.BasicButtonUI
    Basic implementation of the JXHyperlink UI.
    This is copied from org.jdesktop.jdnc.plaf.basic.BasicLinkButtonUI
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(javax.swing.JComponent c, int x, int y)
      protected javax.swing.plaf.basic.BasicButtonListener createButtonListener​(javax.swing.AbstractButton b)  
      static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)  
      protected java.awt.Color getFocusColor()  
      protected java.awt.Rectangle getIconTextRect​(javax.swing.AbstractButton b)
      C&p'ed from BasicGraphicsUtils (getPreferredButtonSize).
      protected void installDefaults​(javax.swing.AbstractButton b)  
      protected void installListeners​(javax.swing.AbstractButton b)  
      void paint​(java.awt.Graphics g, javax.swing.JComponent c)  
      protected void paintButtonPressed​(java.awt.Graphics g, javax.swing.AbstractButton b)  
      protected void paintFocus​(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)  
      protected void paintHTMLText​(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text, javax.swing.text.View v)
      Method which renders the text of the current button if html.
      protected void paintText​(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
      protected void uninstallListeners​(javax.swing.AbstractButton b)  
      • Methods inherited from class javax.swing.plaf.basic.BasicButtonUI

        clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installUI, paintIcon, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallUI
      • Methods inherited from class javax.swing.plaf.ComponentUI

        getAccessibleChild, getAccessibleChildrenCount, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dashedRectGapX

        protected int dashedRectGapX
      • dashedRectGapY

        protected int dashedRectGapY
      • dashedRectGapWidth

        protected int dashedRectGapWidth
      • dashedRectGapHeight

        protected int dashedRectGapHeight
    • Constructor Detail

      • BasicHyperlinkUI

        public BasicHyperlinkUI()
    • Method Detail

      • createUI

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

        protected void installDefaults​(javax.swing.AbstractButton b)
        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicButtonUI
      • installListeners

        protected void installListeners​(javax.swing.AbstractButton b)
        Overrides:
        installListeners in class javax.swing.plaf.basic.BasicButtonUI
      • uninstallListeners

        protected void uninstallListeners​(javax.swing.AbstractButton b)
        Overrides:
        uninstallListeners in class javax.swing.plaf.basic.BasicButtonUI
      • getFocusColor

        protected java.awt.Color getFocusColor()
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Overrides:
        paint in class javax.swing.plaf.basic.BasicButtonUI
      • paintHTMLText

        protected void paintHTMLText​(java.awt.Graphics g,
                                     javax.swing.AbstractButton b,
                                     java.awt.Rectangle textRect,
                                     java.lang.String text,
                                     javax.swing.text.View v)
        Method which renders the text of the current button if html.

        Parameters:
        g - Graphics context
        b - Current button to render
        textRect - Bounding rectangle to render the text.
        text - String to render
        v - the View to use.
      • paintText

        protected void paintText​(java.awt.Graphics g,
                                 javax.swing.AbstractButton b,
                                 java.awt.Rectangle textRect,
                                 java.lang.String text)

        Overridden to paint the underline on rollover.

        Overrides:
        paintText in class javax.swing.plaf.basic.BasicButtonUI
      • paintFocus

        protected void paintFocus​(java.awt.Graphics g,
                                  javax.swing.AbstractButton b,
                                  java.awt.Rectangle viewRect,
                                  java.awt.Rectangle textRect,
                                  java.awt.Rectangle iconRect)
        Overrides:
        paintFocus in class javax.swing.plaf.basic.BasicButtonUI
      • paintButtonPressed

        protected void paintButtonPressed​(java.awt.Graphics g,
                                          javax.swing.AbstractButton b)
        Overrides:
        paintButtonPressed in class javax.swing.plaf.basic.BasicButtonUI
      • createButtonListener

        protected javax.swing.plaf.basic.BasicButtonListener createButtonListener​(javax.swing.AbstractButton b)
        Overrides:
        createButtonListener in class javax.swing.plaf.basic.BasicButtonUI
      • contains

        public boolean contains​(javax.swing.JComponent c,
                                int x,
                                int y)

        Overridden to return true if the position is inside the union of the text and icon rectangle, false otherwise.

        Overrides:
        contains in class javax.swing.plaf.ComponentUI
      • getIconTextRect

        protected java.awt.Rectangle getIconTextRect​(javax.swing.AbstractButton b)
        C&p'ed from BasicGraphicsUtils (getPreferredButtonSize).
        Parameters:
        b - the button to analyse.
        Returns:
        the union of the text and icon rectangle of the AbstractButton or null if the button has children (??)