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 String
Property used during the button shaper switch.static final String
Property used during the button shaper switch.static final String
Property used to store the original (pre-Substance) button border.protected AbstractButton
protected GlowingIcon
The matching glowing icon.static final String
Property used to store the original button icon.static final String
Internal property used to mark close buttons on title panes.static final String
Property used to lock the original (pre-Substance) button opacity.static final String
Property used to store the original (pre-Substance) button opacity.protected PropertyChangeListener
Property change listener.protected ButtonVisualStateTracker
Tracker for visual state transitions.Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(JComponent c, int x, int y) protected BasicButtonListener
static ComponentUI
createUI
(JComponent comp) org.pushingpixels.trident.Timeline
Returns the model for tracking the transitions.protected 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) protected void
paintButtonText
(Graphics g, AbstractButton button, Rectangle textRect, String text) Paints the text.protected void
paintIcon
(Graphics g, JComponent c, Rectangle iconRect) protected void
Tracks possible usage of glowing icon.protected void
protected void
void
update
(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, uninstallUI
Methods 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_PROPERTY
property andAbstractButton.MODEL_CHANGED_PROPERTY
property. -
substanceVisualStateTracker
Tracker for visual state transitions. -
button
-
-
Constructor Details
-
SubstanceButtonUI
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 classBasicButtonUI
-
getPreferredSize
- Overrides:
getPreferredSize
in classBasicButtonUI
-
contains
- Overrides:
contains
in classComponentUI
-
paintIcon
- Overrides:
paintIcon
in 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:
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.
-
getModificationTimeline
public org.pushingpixels.trident.Timeline getModificationTimeline()- Specified by:
getModificationTimeline
in interfaceModificationAwareUI
-