Class SubstanceButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
org.pushingpixels.substance.internal.ui.SubstanceButtonUI
- All Implemented Interfaces:
ModificationAwareUI,TransitionAwareUI
public class SubstanceButtonUI
extends BasicButtonUI
implements TransitionAwareUI, ModificationAwareUI
UI for buttons in Substance look and feel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty used during the button shaper switch.static final StringProperty used during the button shaper switch.static final StringProperty used to store the original (pre-Substance) button border.protected AbstractButtonprotected GlowingIconThe matching glowing icon.static final StringProperty used to store the original button icon.static final StringInternal property used to mark close buttons on title panes.static final StringProperty used to lock the original (pre-Substance) button opacity.static final StringProperty used to store the original (pre-Substance) button opacity.protected PropertyChangeListenerProperty change listener.protected ButtonVisualStateTrackerTracker for visual state transitions.Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(JComponent c, int x, int y) protected BasicButtonListenerstatic ComponentUIcreateUI(JComponent comp) org.pushingpixels.trident.TimelineReturns the model for tracking the transitions.protected 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) protected voidpaintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) Paints the text.protected voidpaintIcon(Graphics g, JComponent c, Rectangle iconRect) protected voidTracks possible usage of glowing icon.protected voidprotected voidvoidupdate(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installUI, paintButtonPressed, paintFocus, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUIMethods inherited from class javax.swing.plaf.ComponentUI
getAccessibleChild, getAccessibleChildrenCount
-
Field Details
-
BORDER_COMPUTED
Property used during the button shaper switch.- See Also:
-
BORDER_COMPUTING
Property used during the button shaper switch.- See Also:
-
BORDER_ORIGINAL
Property used to store the original (pre-Substance) button border.- See Also:
-
ICON_ORIGINAL
Property used to store the original button icon.- See Also:
-
OPACITY_ORIGINAL
Property used to store the original (pre-Substance) button opacity.- See Also:
-
LOCK_OPACITY
Property used to lock the original (pre-Substance) button opacity.- See Also:
-
IS_TITLE_CLOSE_BUTTON
Internal property used to mark close buttons on title panes.- See Also:
-
glowingIcon
The matching glowing icon. Is used only whenAnimationConfigurationManager.isAnimationAllowed(AnimationFacet, Component)returns true onAnimationFacet.ICON_GLOW. -
substancePropertyListener
Property change listener. Listens on changes to theSubstanceLookAndFeel.BUTTON_SHAPER_PROPERTYproperty andAbstractButton.MODEL_CHANGED_PROPERTYproperty. -
substanceVisualStateTracker
Tracker for visual state transitions. -
button
-
-
Constructor Details
-
SubstanceButtonUI
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 classBasicButtonUI
-
getPreferredSize
- Overrides:
getPreferredSizein classBasicButtonUI
-
contains
- Overrides:
containsin classComponentUI
-
paintIcon
- Overrides:
paintIconin classBasicButtonUI
-
paintButtonText
Paints the text.- Parameters:
g- Graphic contextbutton- ButtontextRect- Text rectangletext- Text to paint
-
trackGlowingIcon
protected 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.
-
getModificationTimeline
public org.pushingpixels.trident.Timeline getModificationTimeline()- Specified by:
getModificationTimelinein interfaceModificationAwareUI
-