Package com.jidesoft.plaf.basic
Class BasicJideButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- com.jidesoft.plaf.JideButtonUI
-
- com.jidesoft.plaf.basic.BasicJideButtonUI
-
public class BasicJideButtonUI extends JideButtonUI
JideButtonUI implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
_darkShadowColor
protected java.awt.Color
_focusColor
protected java.awt.Color
_highlight
protected boolean
_isFloatingIcon
protected java.awt.Color
_lightHighlightColor
protected ThemePainter
_painter
protected java.awt.Color
_shadowColor
protected int
defaultTextIconGap
protected int
defaultTextShiftOffset
protected static java.awt.Rectangle
iconRect
protected static java.awt.Rectangle
textRect
protected static java.awt.Rectangle
viewRect
-
Constructor Summary
Constructors Constructor Description BasicJideButtonUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearTextShiftOffset()
protected javax.swing.plaf.basic.BasicButtonListener
createButtonListener(javax.swing.AbstractButton b)
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
int
getDefaultTextIconGap(javax.swing.AbstractButton b)
protected java.awt.Color
getFocusColor()
protected java.awt.Color
getForegroundOfState(javax.swing.AbstractButton b)
protected javax.swing.Icon
getIcon(javax.swing.AbstractButton b)
java.awt.Dimension
getMaximumSize(javax.swing.JComponent c)
java.awt.Dimension
getMinimumSize(javax.swing.JComponent c)
ThemePainter
getPainter()
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
protected java.lang.String
getPropertyPrefix()
protected int
getTextShiftOffset()
protected void
installDefaults(javax.swing.AbstractButton b)
protected void
installKeyboardActions(javax.swing.AbstractButton b)
protected void
installListeners(javax.swing.AbstractButton b)
void
installUI(javax.swing.JComponent c)
protected boolean
isFloatingIcon()
void
paint(java.awt.Graphics g, javax.swing.JComponent c)
protected void
paintBackground(java.awt.Graphics g, javax.swing.AbstractButton b)
protected void
paintIcon(javax.swing.AbstractButton b, java.awt.Graphics g)
protected void
paintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
Method which renders the text of the current button.protected void
paintText(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle textRect, java.lang.String text)
As of Java 2 platform v 1.4 this method should not be used or overridden.protected void
setTextShiftOffset()
static boolean
shouldWrapText(java.awt.Component c)
Checks if we should wrap text on a button.protected void
uninstallDefaults(javax.swing.AbstractButton b)
protected void
uninstallKeyboardActions(javax.swing.AbstractButton b)
protected void
uninstallListeners(javax.swing.AbstractButton b)
void
uninstallUI(javax.swing.JComponent c)
protected void
updateMargin(javax.swing.AbstractButton b)
-
-
-
Field Detail
-
defaultTextIconGap
protected int defaultTextIconGap
-
defaultTextShiftOffset
protected int defaultTextShiftOffset
-
_painter
protected ThemePainter _painter
-
_shadowColor
protected java.awt.Color _shadowColor
-
_darkShadowColor
protected java.awt.Color _darkShadowColor
-
_highlight
protected java.awt.Color _highlight
-
_lightHighlightColor
protected java.awt.Color _lightHighlightColor
-
_focusColor
protected java.awt.Color _focusColor
-
_isFloatingIcon
protected boolean _isFloatingIcon
-
viewRect
protected static java.awt.Rectangle viewRect
-
textRect
protected static java.awt.Rectangle textRect
-
iconRect
protected static java.awt.Rectangle iconRect
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.ComponentUI
-
installDefaults
protected void installDefaults(javax.swing.AbstractButton b)
-
installListeners
protected void installListeners(javax.swing.AbstractButton b)
-
installKeyboardActions
protected void installKeyboardActions(javax.swing.AbstractButton b)
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.ComponentUI
-
uninstallKeyboardActions
protected void uninstallKeyboardActions(javax.swing.AbstractButton b)
-
uninstallListeners
protected void uninstallListeners(javax.swing.AbstractButton b)
-
uninstallDefaults
protected void uninstallDefaults(javax.swing.AbstractButton b)
-
createButtonListener
protected javax.swing.plaf.basic.BasicButtonListener createButtonListener(javax.swing.AbstractButton b)
-
getDefaultTextIconGap
public int getDefaultTextIconGap(javax.swing.AbstractButton b)
-
getFocusColor
protected java.awt.Color getFocusColor()
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.ComponentUI
-
paintIcon
protected void paintIcon(javax.swing.AbstractButton b, java.awt.Graphics g)
-
getIcon
protected javax.swing.Icon getIcon(javax.swing.AbstractButton b)
-
isFloatingIcon
protected boolean isFloatingIcon()
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle textRect, java.lang.String text)
As of Java 2 platform v 1.4 this method should not be used or overridden. Use the paintText method which takes the AbstractButton argument.- Parameters:
g
- the Graphics instancec
- the componenttextRect
- the rectangle of the texttext
- the text to paint
-
getForegroundOfState
protected java.awt.Color getForegroundOfState(javax.swing.AbstractButton b)
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
Method which renders the text of the current button.- Parameters:
g
- Graphics contextb
- Current button to rendertextRect
- Bounding rectangle to render the text.text
- String to render- Since:
- 1.4
-
paintBackground
protected void paintBackground(java.awt.Graphics g, javax.swing.AbstractButton b)
-
clearTextShiftOffset
protected void clearTextShiftOffset()
-
setTextShiftOffset
protected void setTextShiftOffset()
-
getTextShiftOffset
protected int getTextShiftOffset()
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSize
in classjavax.swing.plaf.ComponentUI
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classjavax.swing.plaf.ComponentUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSize
in classjavax.swing.plaf.ComponentUI
-
getPainter
public ThemePainter getPainter()
-
updateMargin
protected void updateMargin(javax.swing.AbstractButton b)
-
shouldWrapText
public static boolean shouldWrapText(java.awt.Component c)
Checks if we should wrap text on a button. If the vertical text position is bottom and horizontal text position is center, we will wrap the text.- Parameters:
c
- the component- Returns:
- true or false.
-
-