Class BasicCommandButtonUI
- 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
-
- Direct Known Subclasses:
BasicRibbonTaskToggleButtonUI
,RadianceCommandButtonUI
public abstract class BasicCommandButtonUI extends CommandButtonUI
Basic UI for command buttonJCommandButton
.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.event.ChangeListener
actionPreviewChangeListener
protected RadianceThemingSlices.BackgroundAppearanceStrategy
backgroundAppearanceStrategy
private BasicCommandButtonListener
basicPopupButtonListener
Tracks user interaction with the command button (including keyboard and mouse).protected JCommandButton
commandButton
The associated command button.private java.beans.PropertyChangeListener
commandPropertyChangeListener
private CommandAction
disposePopupsActionListener
This listener disposes all popup panels when button's action is activated.static java.lang.String
DO_NOT_DISPOSE_POPUPS
Client property to mark the command button to not dispose the popups on activation.protected java.lang.String
extraText
private java.awt.event.FocusListener
focusListener
protected HorizontalAlignment
horizontalAlignment
protected RadianceIcon
icon
protected boolean
isInnerFocusOnAction
protected CommandButtonLayoutManager.CommandButtonLayoutInfo
layoutInfo
Layout information.protected CommandButtonLayoutManager
layoutManager
private PopupActionListener
popupActionListener
Action listener on the popup area.protected RadianceIcon
popupIcon
The popup indicator icon.private java.beans.PropertyChangeListener
propertyChangeListener
Property change listener.protected java.lang.String
text
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasicCommandButtonUI()
Creates a new UI delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasicCommandButtonListener
createButtonListener()
Creates the button listener for the specified command button.protected PopupActionListener
createPopupActionListener()
Creates the popup action listener for this command button.java.awt.Point
getActionKeyTipAnchorCenterPoint()
CommandButtonLayoutManager.CommandButtonLayoutInfo
getLayoutInfo()
Returns the layout information for the associated button.CommandButtonLayoutManager
getLayoutManager()
java.awt.Point
getPopupKeyTipAnchorCenterPoint()
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
protected void
installComponents()
Installs subcomponents on the associated command button.protected void
installDefaults()
Installs defaults on the associated command button.protected void
installKeyboardActions()
Installs the keyboard actions on the associated command button.protected void
installListeners()
Installs listeners on the associated command button.void
installUI(javax.swing.JComponent c)
boolean
isInnerFocusOnAction()
protected boolean
isPaintingBackground()
Returns indication whether the button background is painted.protected boolean
isPaintingSeparators()
Returns indication whether the action-popup areas separator is painted.void
processPopupAction()
void
setInnerFocusOnAction(boolean innerFocusOnAction)
private void
syncActionPreview(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview)
private void
syncIconDimension()
private void
syncInitialInnerFocus()
private void
toggleInnerFocus()
protected void
uninstallComponents()
Uninstalls subcomponents from the associated command button.protected void
uninstallDefaults()
Uninstalls defaults from the associated command button.protected void
uninstallKeyboardActions()
Uninstalls the keyboard actions from the associated command button.protected void
uninstallListeners()
Uninstalls listeners from the associated command button.void
uninstallUI(javax.swing.JComponent c)
void
update(java.awt.Graphics g, javax.swing.JComponent c)
private void
updateBorder()
private void
updateIconDimension()
Updates the icon dimension.protected void
updatePopupIcon()
Updates the popup indicator icon.
-
-
-
Field Detail
-
commandButton
protected JCommandButton commandButton
The associated command button.
-
propertyChangeListener
private java.beans.PropertyChangeListener propertyChangeListener
Property change listener.
-
commandPropertyChangeListener
private java.beans.PropertyChangeListener commandPropertyChangeListener
-
basicPopupButtonListener
private BasicCommandButtonListener basicPopupButtonListener
Tracks user interaction with the command button (including keyboard and mouse).
-
layoutInfo
protected CommandButtonLayoutManager.CommandButtonLayoutInfo layoutInfo
Layout information.
-
actionPreviewChangeListener
private javax.swing.event.ChangeListener actionPreviewChangeListener
-
focusListener
private java.awt.event.FocusListener focusListener
-
isInnerFocusOnAction
protected boolean isInnerFocusOnAction
-
text
protected java.lang.String text
-
extraText
protected java.lang.String extraText
-
icon
protected RadianceIcon icon
-
horizontalAlignment
protected HorizontalAlignment horizontalAlignment
-
backgroundAppearanceStrategy
protected RadianceThemingSlices.BackgroundAppearanceStrategy backgroundAppearanceStrategy
-
DO_NOT_DISPOSE_POPUPS
public static final java.lang.String DO_NOT_DISPOSE_POPUPS
Client property to mark the command button to not dispose the popups on activation.- See Also:
disposePopupsActionListener
, Constant Field Values
-
disposePopupsActionListener
private CommandAction disposePopupsActionListener
This listener disposes all popup panels when button's action is activated. An example of scenario would be a command button in the popup panel of an in-ribbon gallery. When this command button is activated, the associated popup panel is dismissed.- See Also:
DO_NOT_DISPOSE_POPUPS
-
popupActionListener
private PopupActionListener popupActionListener
Action listener on the popup area.
-
popupIcon
protected RadianceIcon popupIcon
The popup indicator icon.
-
layoutManager
protected CommandButtonLayoutManager layoutManager
-
-
Method Detail
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.ComponentUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.ComponentUI
-
installDefaults
protected void installDefaults()
Installs defaults on the associated command button.
-
updateBorder
private void updateBorder()
-
installComponents
protected void installComponents()
Installs subcomponents on the associated command button.
-
installListeners
protected void installListeners()
Installs listeners on the associated command button.
-
createButtonListener
protected BasicCommandButtonListener createButtonListener()
Creates the button listener for the specified command button.- Returns:
- The button listener for the specified command button.
-
installKeyboardActions
protected void installKeyboardActions()
Installs the keyboard actions on the associated command button.
-
uninstallDefaults
protected void uninstallDefaults()
Uninstalls defaults from the associated command button.
-
uninstallComponents
protected void uninstallComponents()
Uninstalls subcomponents from the associated command button.
-
uninstallListeners
protected void uninstallListeners()
Uninstalls listeners from the associated command button.
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()
Uninstalls the keyboard actions from the associated command button.
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
updateIconDimension
private void updateIconDimension()
Updates the icon dimension.
-
updatePopupIcon
protected void updatePopupIcon()
Updates the popup indicator icon.
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classjavax.swing.plaf.ComponentUI
-
getLayoutInfo
public CommandButtonLayoutManager.CommandButtonLayoutInfo getLayoutInfo()
Description copied from class:CommandButtonUI
Returns the layout information for the associated button.- Specified by:
getLayoutInfo
in classCommandButtonUI
- Returns:
- Layout information for the associated button.
-
getLayoutManager
public CommandButtonLayoutManager getLayoutManager()
- Specified by:
getLayoutManager
in classCommandButtonUI
-
isPaintingSeparators
protected boolean isPaintingSeparators()
Returns indication whether the action-popup areas separator is painted.- Returns:
true
if the action-popup areas separator is painted.
-
isPaintingBackground
protected boolean isPaintingBackground()
Returns indication whether the button background is painted.- Returns:
true
if the button background is painted.
-
createPopupActionListener
protected PopupActionListener createPopupActionListener()
Creates the popup action listener for this command button.- Returns:
- Popup action listener for this command button.
-
processPopupAction
public void processPopupAction()
-
syncIconDimension
private void syncIconDimension()
-
syncActionPreview
private void syncActionPreview(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview)
-
getActionKeyTipAnchorCenterPoint
public java.awt.Point getActionKeyTipAnchorCenterPoint()
- Specified by:
getActionKeyTipAnchorCenterPoint
in classCommandButtonUI
-
getPopupKeyTipAnchorCenterPoint
public java.awt.Point getPopupKeyTipAnchorCenterPoint()
- Specified by:
getPopupKeyTipAnchorCenterPoint
in classCommandButtonUI
-
syncInitialInnerFocus
private void syncInitialInnerFocus()
-
toggleInnerFocus
private void toggleInnerFocus()
-
isInnerFocusOnAction
public boolean isInnerFocusOnAction()
- Specified by:
isInnerFocusOnAction
in classCommandButtonUI
-
setInnerFocusOnAction
public void setInnerFocusOnAction(boolean innerFocusOnAction)
- Specified by:
setInnerFocusOnAction
in classCommandButtonUI
-
-