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, RadianceCoreUtilities.BackgroundAppearanceStrategyAware
public class RadianceCommandButtonUI
extends BasicCommandButtonUI
implements ActionPopupTransitionAwareUI
UI for command buttons
JCommandButton in Radiance look and feel.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandButtonBackgroundDelegateprivate GlowingRadianceIconThe matching glowing icon.private ButtonModelprivate StateTransitionTrackerprivate GhostingListenerModel change listener for ghost image effects.private RolloverControlListenerprivate PropertyChangeListenerProperty change listener.private CommandButtonVisualStateTrackerTracker for visual state transitions.private MouseListenerRollover menu mouse listener.Fields inherited from class 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 ComponentUIcreateUI(JComponent comp) voidFires the rollover action on all registered handlers.private ColorgetForegroundColor(StateTransitionTracker.ModelStateInfo modelStateInfo) private ColorgetForegroundVariantColor(StateTransitionTracker.ModelStateInfo modelStateInfo) private static ColorgetMenuButtonForegroundColor(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo) private static ColorgetMenuButtonForegroundVariantColor(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo) private floatComputes the alpha value for painting the separators.Returns the model for tracking the transitions.protected voidInstalls defaults on the associated command button.protected voidInstalls listeners on the associated command button.booleanisInside(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected booleanReturns indication whether the button background is painted.protected booleanReturns indication whether the action-popup areas separator is painted.voidpaint(Graphics g, JComponent c) private voidpaintButtonBackground(Graphics graphics) private voidpaintButtonHorizontalSeparator(Graphics graphics, Rectangle separatorArea) protected voidpaintButtonIcon(Graphics g, Rectangle iconRect, Color textColor) private voidpaintButtonIconRegular(Graphics g, Rectangle iconRect, Color textColor) private voidpaintButtonVerticalSeparator(Graphics graphics, Rectangle separatorArea) private voidpaintPopupActionIcon(Graphics g, Rectangle popupActionRect) private voidTracks possible usage of glowing icon.protected voidUninstalls listeners from the associated command button.voidupdate(Graphics g, JComponent c) Methods inherited from class BasicCommandButtonUI
createButtonListener, createPopupActionListener, getActionKeyTipAnchorCenterPoint, getBackgroundAppearanceStrategy, getLayoutInfo, getLayoutManager, getPopupKeyTipAnchorCenterPoint, installComponents, installKeyboardActions, installUI, isInnerFocusOnAction, processPopupAction, setInnerFocusOnAction, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallUI, updatePopupIconMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize
-
Field Details
-
radiancePropertyListener
Property change listener. Listens on changes toAbstractButton.MODEL_CHANGED_PROPERTYproperty. -
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:BasicCommandButtonUIInstalls defaults on the associated command button.- Overrides:
installDefaultsin classBasicCommandButtonUI
-
installListeners
protected void installListeners()Description copied from class:BasicCommandButtonUIInstalls listeners on the associated command button.- Overrides:
installListenersin classBasicCommandButtonUI
-
uninstallListeners
protected void uninstallListeners()Description copied from class:BasicCommandButtonUIUninstalls listeners from the associated command button.- Overrides:
uninstallListenersin 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:BasicCommandButtonUIReturns indication whether the button background is painted.- Overrides:
isPaintingBackgroundin classBasicCommandButtonUI- Returns:
trueif the button background is painted.
-
isPaintingSeparators
protected boolean isPaintingSeparators()Description copied from class:BasicCommandButtonUIReturns indication whether the action-popup areas separator is painted.- Overrides:
isPaintingSeparatorsin classBasicCommandButtonUI- Returns:
trueif the action-popup areas separator is painted.
-
paint
- Overrides:
paintin classComponentUI
-
getForegroundColor
-
getForegroundVariantColor
-
update
- Overrides:
updatein classBasicCommandButtonUI
-
paintPopupActionIcon
-
getPreferredSize
- Overrides:
getPreferredSizein 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:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-
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.
-
getActionTransitionTracker
- Specified by:
getActionTransitionTrackerin interfaceActionPopupTransitionAwareUI
-
getPopupTransitionTracker
- Specified by:
getPopupTransitionTrackerin interfaceActionPopupTransitionAwareUI
-
getMenuButtonForegroundColor
private static Color getMenuButtonForegroundColor(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo) -
getMenuButtonForegroundVariantColor
private static Color getMenuButtonForegroundVariantColor(JCommandButton menuButton, StateTransitionTracker.ModelStateInfo modelStateInfo)
-