Class RadianceToggleButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
javax.swing.plaf.basic.BasicToggleButtonUI
org.pushingpixels.radiance.theming.internal.ui.RadianceToggleButtonUI
- All Implemented Interfaces:
TransitionAwareUI
UI for toggle buttons in Radiance look and feel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ButtonBackgroundDelegate
Painting delegate.private GhostingListener
Model change listener for ghost image effects.private GlowingIcon
The matching glowing icon.private Rectangle
private PropertyChangeListener
Property change listener.private ButtonVisualStateTracker
Tracker for visual state transitions.private Color
private Rectangle
private JToggleButton
private Rectangle
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RadianceToggleButtonUI
(JToggleButton toggleButton) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(JComponent c, int x, int y) protected BasicButtonListener
static ComponentUI
createUI
(JComponent comp) Returns the model for tracking the transitions.void
protected void
boolean
isInside
(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.void
paint
(Graphics g, JComponent c) private Color
paintButtonText
(Graphics g, AbstractButton button, Rectangle textRect, String text) Paints the text.protected void
paintIcon
(Graphics g, AbstractButton b, Rectangle iconRect) private void
Tracks possible usage of glowing icon.void
protected void
void
update
(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI
getPropertyPrefix, getTextShiftOffset
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, installKeyboardActions, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUI
Methods inherited from class javax.swing.plaf.ComponentUI
getAccessibleChild, getAccessibleChildrenCount
-
Field Details
-
delegate
Painting delegate. -
glowingIcon
The matching glowing icon. Is used only whenAnimationConfigurationManager.isAnimationAllowed(RadianceThemingSlices.AnimationFacet, Component)
returns true onRadianceThemingSlices.AnimationFacet.ICON_GLOW
. -
radiancePropertyListener
Property change listener. Listens on changes to theRadianceSynapse.BUTTON_SHAPER
property andAbstractButton.MODEL_CHANGED_PROPERTY
property. -
radianceVisualStateTracker
Tracker for visual state transitions. -
ghostModelChangeListener
Model change listener for ghost image effects. -
toggleButton
-
textColor
-
viewRect
-
iconRect
-
textRect
-
-
Constructor Details
-
RadianceToggleButtonUI
Simple constructor.
-
-
Method Details
-
createUI
-
installDefaults
- Overrides:
installDefaults
in classBasicButtonUI
-
uninstallDefaults
- Overrides:
uninstallDefaults
in classBasicButtonUI
-
createButtonListener
- Overrides:
createButtonListener
in classBasicButtonUI
-
installListeners
- Overrides:
installListeners
in classBasicButtonUI
-
uninstallListeners
- Overrides:
uninstallListeners
in classBasicButtonUI
-
paint
- Overrides:
paint
in classBasicToggleButtonUI
-
getPreferredSize
- Overrides:
getPreferredSize
in classBasicButtonUI
-
contains
- Overrides:
contains
in classComponentUI
-
paintIcon
- Overrides:
paintIcon
in classBasicToggleButtonUI
-
paintButtonText
Paints the text.- Parameters:
g
- Graphic contextbutton
- ButtontextRect
- Text rectangletext
- Text to paint
-
trackGlowingIcon
private void trackGlowingIcon()Tracks possible usage of glowing icon. -
update
- Overrides:
update
in classComponentUI
-
isInside
Description copied from interface:TransitionAwareUI
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInside
in interfaceTransitionAwareUI
- Parameters:
me
- Mouse event.- Returns:
true
if the mouse position of the specified event lies inside the area of the component designated for transition effects,false
otherwise.
-
getTransitionTracker
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-