Package org.jdesktop.swingx.plaf.basic
Class BasicHyperlinkUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.basic.BasicButtonUI
-
- org.jdesktop.swingx.plaf.basic.BasicHyperlinkUI
-
public class BasicHyperlinkUI extends javax.swing.plaf.basic.BasicButtonUIBasic implementation of theJXHyperlinkUI.
This is copied from org.jdesktop.jdnc.plaf.basic.BasicLinkButtonUI
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBasicHyperlinkUI.BasicHyperlinkListenerA BasicButtonListener specialized to the needs of a Hyperlink.(package private) static classBasicHyperlinkUI.ULHtml
-
Field Summary
Fields Modifier and Type Field Description protected intdashedRectGapHeightprotected intdashedRectGapWidthprotected intdashedRectGapXprotected intdashedRectGapYprivate java.awt.ColorfocusColorprivate static java.awt.RectangleiconRectprivate static java.util.logging.LoggerLOGprivate java.beans.PropertyChangeListenerpcListenerprivate static java.awt.RectangletextRectprivate javax.swing.text.Viewulvprivate static java.awt.RectangleviewRect
-
Constructor Summary
Constructors Constructor Description BasicHyperlinkUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(javax.swing.JComponent c, int x, int y)protected javax.swing.plaf.basic.BasicButtonListenercreateButtonListener(javax.swing.AbstractButton b)static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)protected java.awt.ColorgetFocusColor()protected java.awt.RectanglegetIconTextRect(javax.swing.AbstractButton b)C&p'ed from BasicGraphicsUtils (getPreferredButtonSize).protected voidinstallDefaults(javax.swing.AbstractButton b)protected voidinstallListeners(javax.swing.AbstractButton b)private booleanisInside(java.awt.Rectangle iconTextRect, int x, int y)voidpaint(java.awt.Graphics g, javax.swing.JComponent c)protected voidpaintButtonPressed(java.awt.Graphics g, javax.swing.AbstractButton b)protected voidpaintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)protected voidpaintHTMLText(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 voidpaintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)private voidpaintUnderline(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle rect, java.lang.String text)protected voiduninstallListeners(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
-
-
-
-
Field Detail
-
LOG
private static final java.util.logging.Logger LOG
-
viewRect
private static java.awt.Rectangle viewRect
-
textRect
private static java.awt.Rectangle textRect
-
iconRect
private static java.awt.Rectangle iconRect
-
dashedRectGapX
protected int dashedRectGapX
-
dashedRectGapY
protected int dashedRectGapY
-
dashedRectGapWidth
protected int dashedRectGapWidth
-
dashedRectGapHeight
protected int dashedRectGapHeight
-
focusColor
private java.awt.Color focusColor
-
ulv
private javax.swing.text.View ulv
-
pcListener
private java.beans.PropertyChangeListener pcListener
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installDefaults
protected void installDefaults(javax.swing.AbstractButton b)
- Overrides:
installDefaultsin classjavax.swing.plaf.basic.BasicButtonUI
-
installListeners
protected void installListeners(javax.swing.AbstractButton b)
- Overrides:
installListenersin classjavax.swing.plaf.basic.BasicButtonUI
-
uninstallListeners
protected void uninstallListeners(javax.swing.AbstractButton b)
- Overrides:
uninstallListenersin classjavax.swing.plaf.basic.BasicButtonUI
-
getFocusColor
protected java.awt.Color getFocusColor()
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintin classjavax.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 contextb- Current button to rendertextRect- Bounding rectangle to render the text.text- String to renderv- 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:
paintTextin classjavax.swing.plaf.basic.BasicButtonUI
-
paintUnderline
private void paintUnderline(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle rect, java.lang.String text)
-
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:
paintFocusin classjavax.swing.plaf.basic.BasicButtonUI
-
paintButtonPressed
protected void paintButtonPressed(java.awt.Graphics g, javax.swing.AbstractButton b)- Overrides:
paintButtonPressedin classjavax.swing.plaf.basic.BasicButtonUI
-
createButtonListener
protected javax.swing.plaf.basic.BasicButtonListener createButtonListener(javax.swing.AbstractButton b)
- Overrides:
createButtonListenerin classjavax.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:
containsin classjavax.swing.plaf.ComponentUI
-
isInside
private boolean isInside(java.awt.Rectangle iconTextRect, int x, int y)- Parameters:
iconTextRect-point-- Returns:
-
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 (??)
-
-