Class RadianceCommandButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
org.pushingpixels.radiance.component.internal.ui.common.CommandButtonUI
org.pushingpixels.radiance.component.internal.ui.common.BasicCommandButtonUI
org.pushingpixels.radiance.component.internal.theming.common.ui.RadianceCommandButtonUI
- All Implemented Interfaces:
ActionPopupTransitionAwareUI
,TransitionAwareUI
public class RadianceCommandButtonUI
extends BasicCommandButtonUI
implements ActionPopupTransitionAwareUI
UI for command buttons
JCommandButton
in Radiance look and feel.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandButtonBackgroundDelegate
private GlowingRadianceIcon
The matching glowing icon.private ButtonModel
private StateTransitionTracker
private GhostingListener
Model change listener for ghost image effects.private RolloverControlListener
private PropertyChangeListener
Property change listener.private CommandButtonVisualStateTracker
Tracker for visual state transitions.private MouseListener
Rollover menu mouse listener.Fields inherited from class org.pushingpixels.radiance.component.internal.ui.common.BasicCommandButtonUI
backgroundAppearanceStrategy, commandButton, DO_NOT_DISPOSE_POPUPS, extraText, horizontalAlignment, icon, isInnerFocusOnAction, layoutInfo, layoutManager, popupIcon, text
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new UI delegate for command button. -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUI
createUI
(JComponent comp) void
Fires the rollover action on all registered handlers.protected Color
getForegroundColor
(StateTransitionTracker.ModelStateInfo modelStateInfo) private static Color
getMenuButtonForegroundColor
(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo) private float
Computes the alpha value for painting the separators.Returns the model for tracking the transitions.protected void
Installs defaults on the associated command button.protected void
Installs listeners on the associated command button.boolean
isInside
(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected boolean
Returns indication whether the button background is painted.protected boolean
Returns indication whether the action-popup areas separator is painted.void
paint
(Graphics g, JComponent c) private void
paintButtonBackground
(Graphics graphics) private void
paintButtonHorizontalSeparator
(Graphics graphics, Rectangle separatorArea) protected void
paintButtonIcon
(Graphics g, Rectangle iconRect, Color textColor) private void
paintButtonIconRegular
(Graphics g, Rectangle iconRect, Color textColor) private void
paintButtonVerticalSeparator
(Graphics graphics, Rectangle separatorArea) private void
paintPopupActionIcon
(Graphics g, Rectangle popupActionRect) private void
Tracks possible usage of glowing icon.protected void
Uninstalls listeners from the associated command button.void
update
(Graphics g, JComponent c) Methods inherited from class org.pushingpixels.radiance.component.internal.ui.common.BasicCommandButtonUI
createButtonListener, createPopupActionListener, getActionKeyTipAnchorCenterPoint, getLayoutInfo, getLayoutManager, getPopupKeyTipAnchorCenterPoint, installComponents, installKeyboardActions, installUI, isInnerFocusOnAction, processPopupAction, setInnerFocusOnAction, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallUI, updatePopupIcon
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize
-
Field Details
-
radiancePropertyListener
Property change listener. Listens on changes toAbstractButton.MODEL_CHANGED_PROPERTY
property. -
radianceModelChangeListener
Model change listener for ghost image effects. -
radianceVisualStateTracker
Tracker for visual state transitions. -
overallRolloverModel
-
radianceOverallRolloverListener
-
rolloverMenuMouseListener
Rollover menu mouse listener. -
overallStateTransitionTracker
-
commandButtonBackgroundDelegate
-
glowingIcon
The matching glowing icon. Is used only whenAnimationConfigurationManager.isAnimationAllowed(AnimationFacet, Component)
returns true onRadianceThemingSlices.AnimationFacet.ICON_GLOW
.
-
-
Constructor Details
-
RadianceCommandButtonUI
RadianceCommandButtonUI(JCommandButton button) Creates a new UI delegate for command button.- Parameters:
button
- command button
-
-
Method Details
-
createUI
-
installDefaults
protected void installDefaults()Description copied from class:BasicCommandButtonUI
Installs defaults on the associated command button.- Overrides:
installDefaults
in classBasicCommandButtonUI
-
installListeners
protected void installListeners()Description copied from class:BasicCommandButtonUI
Installs listeners on the associated command button.- Overrides:
installListeners
in classBasicCommandButtonUI
-
uninstallListeners
protected void uninstallListeners()Description copied from class:BasicCommandButtonUI
Uninstalls listeners from the associated command button.- Overrides:
uninstallListeners
in classBasicCommandButtonUI
-
fireRolloverActionPerformed
Fires the rollover action on all registered handlers.- Parameters:
e
- Event object.
-
trackGlowingIcon
private void trackGlowingIcon()Tracks possible usage of glowing icon. -
paintButtonBackground
-
paintButtonIconRegular
-
paintButtonIcon
-
paintButtonHorizontalSeparator
-
paintButtonVerticalSeparator
-
isPaintingBackground
protected boolean isPaintingBackground()Description copied from class:BasicCommandButtonUI
Returns indication whether the button background is painted.- Overrides:
isPaintingBackground
in classBasicCommandButtonUI
- Returns:
true
if the button background is painted.
-
isPaintingSeparators
protected boolean isPaintingSeparators()Description copied from class:BasicCommandButtonUI
Returns indication whether the action-popup areas separator is painted.- Overrides:
isPaintingSeparators
in classBasicCommandButtonUI
- Returns:
true
if the action-popup areas separator is painted.
-
paint
- Overrides:
paint
in classComponentUI
-
getForegroundColor
-
update
- Overrides:
update
in classBasicCommandButtonUI
-
paintPopupActionIcon
-
getPreferredSize
- Overrides:
getPreferredSize
in classBasicCommandButtonUI
-
getSeparatorAlpha
private float getSeparatorAlpha()Computes the alpha value for painting the separators.- Returns:
- Alpha value for painting the separators.
-
getTransitionTracker
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-
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.
-
getActionTransitionTracker
- Specified by:
getActionTransitionTracker
in interfaceActionPopupTransitionAwareUI
-
getPopupTransitionTracker
- Specified by:
getPopupTransitionTracker
in interfaceActionPopupTransitionAwareUI
-
getMenuButtonForegroundColor
private static Color getMenuButtonForegroundColor(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo)
-