Class BasicCommandButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
org.pushingpixels.flamingo.internal.ui.common.CommandButtonUI
org.pushingpixels.flamingo.internal.ui.common.BasicCommandButtonUI
- Direct Known Subclasses:
BasicCommandMenuButtonUI,BasicCommandToggleButtonUI,BasicRibbonApplicationMenuButtonUI
Basic UI for command button
JCommandButton.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BasicCommandButtonListenerTracks user interaction with the command button (including keyboard and mouse).protected CellRendererPaneUsed to provide a LAF-consistent appearance under core LAFs.protected AbstractCommandButtonThe associated command button.protected ActionListenerThis listener disposes all popup panels when button's action is activated.static final StringClient property to mark the command button to not dispose the popups on activation.static final StringClient property to mark the command button to have square corners.protected booleanIndication whether the mouse pointer is over the associated command button.Layout information.protected CommandButtonLayoutManagerprotected ResizableIconThe "expand" action icon.protected PopupActionListenerAction listener on the popup area.protected PropertyChangeListenerProperty change listener.protected AbstractButtonUsed to provide a LAF-consistent appearance under core LAFs.protected JSeparatorUsed to paint the separator between the action and popup areas. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected BasicCommandButtonListenerCreates the button listener for the specified command button.protected ResizableIconCreates the icon for the popup area.protected PopupActionListenerCreates the popup action listener for this command button.protected AbstractButtonCreates the renderer button.static ComponentUIprotected ColorgetForegroundColor(boolean isTextPaintedEnabled) protected IconReturns the current icon.protected intReturns the layout gap for the visuals of the associated command button.Returns the layout information for the associated button.protected voidInstalls subcomponents on the associated command button.protected voidInstalls defaults on the associated command button.protected voidInstalls the keyboard actions on the associated command button.protected voidInstalls listeners on the associated command button.voidprotected booleanReturns indication whether the button background is painted.protected booleanReturns indication whether the action-popup areas separator is painted.voidpaint(Graphics g, JComponent c) protected voidpaintButtonBackground(Graphics graphics, Rectangle toFill) Paints command button background.protected voidpaintButtonBackground(Graphics graphics, Rectangle toFill, ButtonModel... modelToUse) Paints the background of the command button.protected voidpaintButtonHorizontalSeparator(Graphics graphics, Rectangle separatorArea) Paints command button horizontal separator.protected voidpaintButtonIcon(Graphics g, Rectangle iconRect) Paints the button icon.protected voidpaintButtonVerticalSeparator(Graphics graphics, Rectangle separatorArea) Paints command button vertical separator.protected voidpaintPopupActionIcon(Graphics g, Rectangle popupActionRect) Paints the icon of the popup area.protected voidprotected voidprotected voidprotected booleanprotected voidprotected voidUninstalls subcomponents from the associated command button.protected voidUninstalls defaults from the associated command button.protected voidUninstalls the keyboard actions from the associated command button.protected voidUninstalls listeners from the associated command button.voidvoidupdate(Graphics g, JComponent c) protected voidprotected voidUpdates the custom dimension.protected voidUpdates the popup action icon.Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize
-
Field Details
-
commandButton
The associated command button. -
isUnderMouse
protected boolean isUnderMouseIndication whether the mouse pointer is over the associated command button. -
propertyChangeListener
Property change listener. -
basicPopupButtonListener
Tracks user interaction with the command button (including keyboard and mouse). -
layoutInfo
Layout information. -
EMULATE_SQUARE_BUTTON
Client property to mark the command button to have square corners. This client property is for internal use only.- See Also:
-
DONT_DISPOSE_POPUPS
Client property to mark the command button to not dispose the popups on activation. -
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:
-
popupActionListener
Action listener on the popup area. -
popupActionIcon
The "expand" action icon. -
layoutManager
-
buttonRendererPane
Used to provide a LAF-consistent appearance under core LAFs. -
rendererButton
Used to provide a LAF-consistent appearance under core LAFs. -
rendererSeparator
Used to paint the separator between the action and popup areas.
-
-
Constructor Details
-
BasicCommandButtonUI
public BasicCommandButtonUI()Creates a new UI delegate.
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUIin classComponentUI
-
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
installDefaults
protected void installDefaults()Installs defaults on the associated command button. -
configureRenderer
protected void configureRenderer() -
updateBorder
protected void updateBorder() -
createRendererButton
Creates the renderer button.- Returns:
- The renderer button.
-
installComponents
protected void installComponents()Installs subcomponents on the associated command button. -
installListeners
protected void installListeners()Installs listeners on the associated command button. -
createPopupActionIcon
Creates the icon for the popup area.- Returns:
- The icon for the popup area.
-
createButtonListener
Creates the button listener for the specified command button.- Parameters:
b- 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. -
unconfigureRenderer
protected void unconfigureRenderer() -
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
- Overrides:
updatein classComponentUI
-
paint
- Overrides:
paintin classComponentUI
-
getForegroundColor
-
paintPopupActionIcon
Paints the icon of the popup area.- Parameters:
g- Graphics context.popupActionRect-
-
getIconToPaint
Returns the current icon.- Returns:
- Current icon.
-
toUseDisabledIcon
protected boolean toUseDisabledIcon() -
paintButtonVerticalSeparator
Paints command button vertical separator.- Parameters:
graphics- Graphics context.separatorArea- Separator area.
-
paintButtonHorizontalSeparator
Paints command button horizontal separator.- Parameters:
graphics- Graphics context.separatorArea- Separator area.
-
paintButtonBackground
Paints command button background.- Parameters:
graphics- Graphics context.toFill- Rectangle for the background.
-
paintButtonBackground
protected void paintButtonBackground(Graphics graphics, Rectangle toFill, ButtonModel... modelToUse) Paints the background of the command button.- Parameters:
graphics- Graphics context.toFill- Rectangle to fill.modelToUse- Button models to use for computing the background fill.
-
updateCustomDimension
protected void updateCustomDimension()Updates the custom dimension. -
updatePopupActionIcon
protected void updatePopupActionIcon()Updates the popup action icon. -
paintButtonIcon
Paints the button icon.- Parameters:
g- Graphics context.iconRect- Icon rectangle.
-
getPreferredSize
- Overrides:
getPreferredSizein classComponentUI
-
getLayoutInfo
Description copied from class:CommandButtonUIReturns the layout information for the associated button.- Specified by:
getLayoutInfoin classCommandButtonUI- Returns:
- Layout information for the associated button.
-
getLayoutGap
protected int getLayoutGap()Returns the layout gap for the visuals of the associated command button.- Returns:
- The layout gap for the visuals of the associated command button.
-
isPaintingSeparators
protected boolean isPaintingSeparators()Returns indication whether the action-popup areas separator is painted.- Returns:
trueif the action-popup areas separator is painted.
-
isPaintingBackground
protected boolean isPaintingBackground()Returns indication whether the button background is painted.- Returns:
trueif the button background is painted.
-
createPopupActionListener
Creates the popup action listener for this command button.- Returns:
- Popup action listener for this command button.
-
processPopupAction
protected void processPopupAction() -
syncDisabledIcon
protected void syncDisabledIcon() -
syncIconDimension
protected void syncIconDimension() -
getKeyTipAnchorCenterPoint
- Specified by:
getKeyTipAnchorCenterPointin classCommandButtonUI
-