Class RadianceButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.basic.BasicButtonUI
-
- org.pushingpixels.radiance.theming.internal.ui.RadianceButtonUI
-
- All Implemented Interfaces:
ModificationAwareUI,TransitionAwareUI
public class RadianceButtonUI extends javax.swing.plaf.basic.BasicButtonUI implements TransitionAwareUI, ModificationAwareUI
UI for buttons in Radiance look and feel.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBORDER_COMPUTEDProperty used during the button shaper switch.static java.lang.StringBORDER_COMPUTINGProperty used during the button shaper switch.(package private) static java.lang.StringBORDER_ORIGINALProperty used to store the original (pre-Radiance) button border.protected javax.swing.AbstractButtonbuttonprivate ButtonBackgroundDelegatedelegatePainting delegate.private GhostingListenerghostModelChangeListenerModel change listener for ghost image effects.private GlowingIconglowingIconThe matching glowing icon.private static java.lang.StringICON_ORIGINALProperty used to store the original button icon.private java.awt.RectangleiconRect(package private) static java.lang.StringLOCK_OPACITYProperty used to lock the original (pre-Radiance) button opacity.private TimelinemodifiedTimeline(package private) static java.lang.StringOPACITY_ORIGINALProperty used to store the original (pre-Radiance) control opacity.private java.beans.PropertyChangeListenerradiancePropertyListenerProperty change listener.private ButtonVisualStateTrackerradianceVisualStateTrackerTracker for visual state transitions.private java.awt.ColortextColorprivate java.awt.RectangletextRectprivate java.util.Set<RadianceThemingWidget<javax.swing.JComponent>>themingWidgetsprivate java.awt.RectangleviewRect
-
Constructor Summary
Constructors Modifier Constructor Description protectedRadianceButtonUI(javax.swing.AbstractButton button)Simple constructor.
-
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 comp)TimelinegetModificationTimeline()java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)StateTransitionTrackergetTransitionTracker()Returns the model for tracking the transitions.protected voidinstallDefaults(javax.swing.AbstractButton b)protected voidinstallListeners(javax.swing.AbstractButton b)voidinstallUI(javax.swing.JComponent c)booleanisInside(java.awt.event.MouseEvent me)Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.voidpaint(java.awt.Graphics g, javax.swing.JComponent c)private java.awt.ColorpaintButtonText(java.awt.Graphics g, javax.swing.AbstractButton button, java.awt.Rectangle textRect, java.lang.String text)Paints the text.protected voidpaintIcon(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle iconRect)private voidtrackGlowingIcon()Tracks possible usage of glowing icon.private voidtrackModificationFlag()protected voiduninstallDefaults(javax.swing.AbstractButton b)protected voiduninstallListeners(javax.swing.AbstractButton b)voiduninstallUI(javax.swing.JComponent c)voidupdate(java.awt.Graphics g, javax.swing.JComponent c)-
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, paintButtonPressed, paintFocus, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions
-
-
-
-
Field Detail
-
BORDER_COMPUTED
public static final java.lang.String BORDER_COMPUTED
Property used during the button shaper switch.- See Also:
- Constant Field Values
-
BORDER_COMPUTING
public static final java.lang.String BORDER_COMPUTING
Property used during the button shaper switch.- See Also:
- Constant Field Values
-
BORDER_ORIGINAL
static final java.lang.String BORDER_ORIGINAL
Property used to store the original (pre-Radiance) button border.- See Also:
- Constant Field Values
-
ICON_ORIGINAL
private static final java.lang.String ICON_ORIGINAL
Property used to store the original button icon.- See Also:
- Constant Field Values
-
OPACITY_ORIGINAL
static final java.lang.String OPACITY_ORIGINAL
Property used to store the original (pre-Radiance) control opacity.- See Also:
- Constant Field Values
-
LOCK_OPACITY
static final java.lang.String LOCK_OPACITY
Property used to lock the original (pre-Radiance) button opacity.- See Also:
- Constant Field Values
-
delegate
private ButtonBackgroundDelegate delegate
Painting delegate.
-
glowingIcon
private GlowingIcon glowingIcon
The matching glowing icon. Is used only whenAnimationConfigurationManager.isAnimationAllowed(AnimationFacet, Component)returns true onRadianceThemingSlices.AnimationFacet.ICON_GLOW.
-
radiancePropertyListener
private java.beans.PropertyChangeListener radiancePropertyListener
Property change listener.
-
radianceVisualStateTracker
private ButtonVisualStateTracker radianceVisualStateTracker
Tracker for visual state transitions.
-
ghostModelChangeListener
private GhostingListener ghostModelChangeListener
Model change listener for ghost image effects.
-
themingWidgets
private java.util.Set<RadianceThemingWidget<javax.swing.JComponent>> themingWidgets
-
button
protected javax.swing.AbstractButton button
-
textColor
private java.awt.Color textColor
-
modifiedTimeline
private Timeline modifiedTimeline
-
viewRect
private java.awt.Rectangle viewRect
-
iconRect
private java.awt.Rectangle iconRect
-
textRect
private java.awt.Rectangle textRect
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.basic.BasicButtonUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.basic.BasicButtonUI
-
installDefaults
protected void installDefaults(javax.swing.AbstractButton b)
- Overrides:
installDefaultsin classjavax.swing.plaf.basic.BasicButtonUI
-
uninstallDefaults
protected void uninstallDefaults(javax.swing.AbstractButton b)
- Overrides:
uninstallDefaultsin classjavax.swing.plaf.basic.BasicButtonUI
-
createButtonListener
protected javax.swing.plaf.basic.BasicButtonListener createButtonListener(javax.swing.AbstractButton b)
- Overrides:
createButtonListenerin 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
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintin classjavax.swing.plaf.basic.BasicButtonUI
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSizein classjavax.swing.plaf.basic.BasicButtonUI
-
contains
public boolean contains(javax.swing.JComponent c, int x, int y)- Overrides:
containsin classjavax.swing.plaf.ComponentUI
-
paintIcon
protected void paintIcon(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle iconRect)- Overrides:
paintIconin classjavax.swing.plaf.basic.BasicButtonUI
-
paintButtonText
private java.awt.Color paintButtonText(java.awt.Graphics g, javax.swing.AbstractButton button, java.awt.Rectangle textRect, java.lang.String text)Paints the text.- Parameters:
g- Graphic contextbutton- ButtontextRect- Text rectangletext- Text to paint
-
trackGlowingIcon
private void trackGlowingIcon()
Tracks possible usage of glowing icon.
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
updatein classjavax.swing.plaf.ComponentUI
-
isInside
public boolean isInside(java.awt.event.MouseEvent me)
Description copied from interface:TransitionAwareUIChecks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInsidein interfaceTransitionAwareUI- Parameters:
me- Mouse event.- Returns:
trueif the mouse position of the specified event lies inside the area of the component designated for transition effects,falseotherwise.
-
getTransitionTracker
public StateTransitionTracker getTransitionTracker()
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-
trackModificationFlag
private void trackModificationFlag()
-
getModificationTimeline
public Timeline getModificationTimeline()
- Specified by:
getModificationTimelinein interfaceModificationAwareUI
-
-