BasicCommandMenuButtonUI
, BasicCommandToggleButtonUI
, BasicRibbonApplicationMenuButtonUI
public class BasicCommandButtonUI extends CommandButtonUI
JCommandButton
.Modifier and Type | Field | Description |
---|---|---|
protected BasicCommandButtonListener |
basicPopupButtonListener |
Tracks user interaction with the command button (including keyboard and
mouse).
|
protected CellRendererPane |
buttonRendererPane |
Used to provide a LAF-consistent appearance under core LAFs.
|
protected AbstractCommandButton |
commandButton |
The associated command button.
|
protected ActionListener |
disposePopupsActionListener |
This listener disposes all popup panels when button's action is
activated.
|
static String |
DONT_DISPOSE_POPUPS |
Client property to mark the command button to not dispose the popups on
activation.
|
static String |
EMULATE_SQUARE_BUTTON |
Client property to mark the command button to have square corners.
|
protected boolean |
isUnderMouse |
Indication whether the mouse pointer is over the associated command
button.
|
protected CommandButtonLayoutManager.CommandButtonLayoutInfo |
layoutInfo |
Layout information.
|
protected CommandButtonLayoutManager |
layoutManager |
|
protected ResizableIcon |
popupActionIcon |
The "expand" action icon.
|
protected PopupActionListener |
popupActionListener |
Action listener on the popup area.
|
protected PropertyChangeListener |
propertyChangeListener |
Property change listener.
|
protected AbstractButton |
rendererButton |
Used to provide a LAF-consistent appearance under core LAFs.
|
protected JSeparator |
rendererSeparator |
Used to paint the separator between the action and popup areas.
|
Constructor | Description |
---|---|
BasicCommandButtonUI() |
Creates a new UI delegate.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
configureRenderer() |
|
protected BasicCommandButtonListener |
createButtonListener(AbstractCommandButton b) |
Creates the button listener for the specified command button.
|
protected ResizableIcon |
createPopupActionIcon() |
Creates the icon for the popup area.
|
protected PopupActionListener |
createPopupActionListener() |
Creates the popup action listener for this command button.
|
protected AbstractButton |
createRendererButton() |
Creates the renderer button.
|
static ComponentUI |
createUI(JComponent c) |
|
protected Color |
getForegroundColor(boolean isTextPaintedEnabled) |
|
protected Icon |
getIconToPaint() |
Returns the current icon.
|
Point |
getKeyTipAnchorCenterPoint() |
|
protected int |
getLayoutGap() |
Returns the layout gap for the visuals of the associated command button.
|
CommandButtonLayoutManager.CommandButtonLayoutInfo |
getLayoutInfo() |
Returns the layout information for the associated button.
|
Dimension |
getPreferredSize(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(JComponent c) |
|
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 |
paint(Graphics g,
JComponent c) |
|
protected void |
paintButtonBackground(Graphics graphics,
Rectangle toFill) |
Paints command button background.
|
protected void |
paintButtonBackground(Graphics graphics,
Rectangle toFill,
ButtonModel... modelToUse) |
Paints the background of the command button.
|
protected void |
paintButtonHorizontalSeparator(Graphics graphics,
Rectangle separatorArea) |
Paints command button horizontal separator.
|
protected void |
paintButtonIcon(Graphics g,
Rectangle iconRect) |
Paints the button icon.
|
protected void |
paintButtonVerticalSeparator(Graphics graphics,
Rectangle separatorArea) |
Paints command button vertical separator.
|
protected void |
paintPopupActionIcon(Graphics g,
Rectangle popupActionRect) |
Paints the icon of the popup area.
|
protected void |
processPopupAction() |
|
protected void |
syncDisabledIcon() |
|
protected void |
syncIconDimension() |
|
protected boolean |
toUseDisabledIcon() |
|
protected void |
unconfigureRenderer() |
|
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(JComponent c) |
|
void |
update(Graphics g,
JComponent c) |
|
protected void |
updateBorder() |
|
protected void |
updateCustomDimension() |
Updates the custom dimension.
|
protected void |
updatePopupActionIcon() |
Updates the popup action icon.
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize
protected AbstractCommandButton commandButton
protected boolean isUnderMouse
protected PropertyChangeListener propertyChangeListener
protected BasicCommandButtonListener basicPopupButtonListener
protected CommandButtonLayoutManager.CommandButtonLayoutInfo layoutInfo
public static final String EMULATE_SQUARE_BUTTON
public static final String DONT_DISPOSE_POPUPS
disposePopupsActionListener
,
Constant Field Valuesprotected ActionListener disposePopupsActionListener
DONT_DISPOSE_POPUPS
protected PopupActionListener popupActionListener
protected ResizableIcon popupActionIcon
protected CommandButtonLayoutManager layoutManager
protected CellRendererPane buttonRendererPane
protected AbstractButton rendererButton
protected JSeparator rendererSeparator
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
installUI
in class ComponentUI
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
protected void installDefaults()
protected void configureRenderer()
protected void updateBorder()
protected AbstractButton createRendererButton()
protected void installComponents()
protected void installListeners()
protected ResizableIcon createPopupActionIcon()
protected BasicCommandButtonListener createButtonListener(AbstractCommandButton b)
b
- Command button.protected void installKeyboardActions()
protected void uninstallDefaults()
protected void unconfigureRenderer()
protected void uninstallComponents()
protected void uninstallListeners()
protected void uninstallKeyboardActions()
public void update(Graphics g, JComponent c)
update
in class ComponentUI
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
protected Color getForegroundColor(boolean isTextPaintedEnabled)
protected void paintPopupActionIcon(Graphics g, Rectangle popupActionRect)
g
- Graphics context.popupActionRect
- protected Icon getIconToPaint()
protected boolean toUseDisabledIcon()
protected void paintButtonVerticalSeparator(Graphics graphics, Rectangle separatorArea)
graphics
- Graphics context.separatorArea
- Separator area.protected void paintButtonHorizontalSeparator(Graphics graphics, Rectangle separatorArea)
graphics
- Graphics context.separatorArea
- Separator area.protected void paintButtonBackground(Graphics graphics, Rectangle toFill)
graphics
- Graphics context.toFill
- Rectangle for the background.protected void paintButtonBackground(Graphics graphics, Rectangle toFill, ButtonModel... modelToUse)
graphics
- Graphics context.toFill
- Rectangle to fill.modelToUse
- Button models to use for computing the background fill.protected void updateCustomDimension()
protected void updatePopupActionIcon()
protected void paintButtonIcon(Graphics g, Rectangle iconRect)
g
- Graphics context.iconRect
- Icon rectangle.public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class ComponentUI
public CommandButtonLayoutManager.CommandButtonLayoutInfo getLayoutInfo()
CommandButtonUI
getLayoutInfo
in class CommandButtonUI
protected int getLayoutGap()
protected boolean isPaintingSeparators()
true
if the action-popup areas separator is painted.protected boolean isPaintingBackground()
true
if the button background is painted.protected PopupActionListener createPopupActionListener()
protected void processPopupAction()
protected void syncDisabledIcon()
protected void syncIconDimension()
public Point getKeyTipAnchorCenterPoint()
getKeyTipAnchorCenterPoint
in class CommandButtonUI