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 ButtonBackgroundDelegatePainting delegate.private GhostingListenerModel change listener for ghost image effects.private GlowingIconThe matching glowing icon.private Rectangleprivate PropertyChangeListenerProperty change listener.private ButtonVisualStateTrackerTracker for visual state transitions.private Colorprivate Rectangleprivate JToggleButtonprivate RectangleFields inherited from class BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRadianceToggleButtonUI(JToggleButton toggleButton) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(JComponent c, int x, int y) protected BasicButtonListenerstatic ComponentUIcreateUI(JComponent comp) Returns the model for tracking the transitions.voidprotected voidbooleanisInside(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.voidpaint(Graphics g, JComponent c) private ColorpaintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) Paints the text.protected voidpaintIcon(Graphics g, AbstractButton b, Rectangle iconRect) private voidTracks possible usage of glowing icon.voidprotected voidvoidupdate(Graphics g, JComponent c) Methods inherited from class BasicToggleButtonUI
getPropertyPrefix, getTextShiftOffsetMethods inherited from class BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, installKeyboardActions, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUIMethods inherited from class 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_SHAPERproperty andAbstractButton.MODEL_CHANGED_PROPERTYproperty. -
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:
installDefaultsin classBasicButtonUI
-
uninstallDefaults
- Overrides:
uninstallDefaultsin classBasicButtonUI
-
createButtonListener
- Overrides:
createButtonListenerin classBasicButtonUI
-
installListeners
- Overrides:
installListenersin classBasicButtonUI
-
uninstallListeners
- Overrides:
uninstallListenersin classBasicButtonUI
-
paint
- Overrides:
paintin classBasicToggleButtonUI
-
getPreferredSize
- Overrides:
getPreferredSizein classBasicButtonUI
-
contains
- Overrides:
containsin classComponentUI
-
paintIcon
- Overrides:
paintIconin 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:
updatein classComponentUI
-
isInside
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
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-