Class JCommandButton
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- org.pushingpixels.flamingo.api.common.RichTooltipManager.JTrackableComponent
-
- org.pushingpixels.flamingo.api.common.JCommandButton
-
public class JCommandButton extends RichTooltipManager.JTrackableComponent
Command button. Note that while this class is a part of public API, it is highly recommended to use theCommandandCommandButtonPresentationModelinstances used to project the command button on screen for any dynamic manipulation of the state.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJCommandButton.CommandButtonKindEnumerates the available command button kinds.static classJCommandButton.CommandButtonLocationOrderKindEnumerates the available values for the location order kind.-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_GAP_SCALE_FACTORstatic intDEFAULT_HORIZONTAL_ALIGNMENTstatic java.lang.StringuiClassIDThe UI class ID string.-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JCommandButton(Projection<JCommandButton,? extends Command,CommandButtonPresentationModel> projection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(javax.swing.event.ChangeListener l)Adds the specified change listener to this button.voidaddCommandListener(CommandAction l)Adds the specified command listener to this button.voidaddRolloverActionListener(RolloverActionListener l)Adds a rollover action listener that will be called when the rollover state of this button becomes active.voiddoActionClick()Programmatically perform an action "click".voiddoActionRollover()Programmatically perform a "rollover" on the action area.voiddoPopupClick()Programmatically perform a "click" on the popup area.protected voidfireActionPerformed(java.awt.event.ActionEvent event)Notifies all listeners that have registered interest for notification on this event type.protected voidfirePopupActionPerformed(java.awt.event.ActionEvent event)Notifies all listeners that have registered interest for notification on this event type.protected voidfireStateChanged()Notifies all listeners that have registered interest for notification on this event type.java.lang.StringgetActionKeyTip()Returns the key tip for the action area of this button.ActionButtonModelgetActionModel()Returns the action model for this button.intgetAutoRepeatInitialInterval()Returns the initial interval for invoking the registered action listeners in the auto-repeat action mode.intgetAutoRepeatSubsequentInterval()Returns the subsequent interval for invoking the registered action listeners in the auto-repeat action mode.JCommandButton.CommandButtonKindgetCommandButtonKind()Returns the command button kind of this button.org.pushingpixels.neon.api.icon.ResizableIcongetDisabledIcon()Returns the associated disabled icon.java.lang.StringgetExtraText()Returns the extra text of this button.doublegetHGapScaleFactor()Returns the horizontal gap scale factor for the content of this button.intgetHorizontalAlignment()Returns the horizontal alignment for the content of this button.org.pushingpixels.neon.api.icon.ResizableIcongetIcon()Returns the associated icon.intgetIconDimension()Returns the dimension of the icon of the associated command button in theCommandButtonPresentationState.FIT_TO_ICONstate.JCommandButton.CommandButtonLocationOrderKindgetLocationOrderKind()Returns the location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips.PopupPanelCallbackgetPopupCallback()Returns the associated popup callback.CommandButtonPresentationModel.PopupHorizontalGravitygetPopupHorizontalGravity()Returns the popup horizontal gravity of this button.java.lang.StringgetPopupKeyTip()Returns the key tip for the popup area of this button.PopupButtonModelgetPopupModel()Returns the popup model of this button.CommandButtonPresentationModel.PopupOrientationKindgetPopupOrientationKind()Returns the popup orientation kind of this button.CommandButtonPresentationStategetPresentationState()Return the current presentation state ofthisbutton.CommandButtonProjection<? extends Command>getProjection()RichTooltipgetRichTooltip(java.awt.event.MouseEvent event)java.lang.StringgetText()Returns the text of this button.org.pushingpixels.flamingo.internal.ui.common.CommandButtonUIgetUI()Returns the UI delegate for this button.java.lang.StringgetUIClassID()doublegetVGapScaleFactor()Returns the vertical gap scale factor for the content of this button.booleanisAutoRepeatAction()Returns indication whether the button is in auto-repeat action mode.booleanisFireActionOnRollover()Returns indication whether this button is in action-on-rollover mode.booleanisFlat()Returns indication whether this button has flat appearance.booleanisPopupVisible()voidremoveChangeListener(javax.swing.event.ChangeListener l)Removes the specified change listener from this button.voidremoveCommandListener(CommandAction l)Removes the specified command listener from this button.voidremoveRolloverActionListener(RolloverActionListener l)Removes the specified rollover action listener.voidsetActionKeyTip(java.lang.String actionKeyTip)Sets the key tip for the action area of this button.voidsetActionModel(ActionButtonModel newModel)Sets the new action model for this button.voidsetActionRichTooltip(RichTooltip richTooltip)Sets the rich tooltip for the action area of this button.voidsetAutoRepeatAction(boolean isAutoRepeatAction)Sets the auto-repeat action indication.voidsetAutoRepeatActionIntervals(int initial, int subsequent)Sets the intervals for the auto-repeat action mode.voidsetCommandButtonKind(JCommandButton.CommandButtonKind commandButtonKind)Sets the kind for this button.voidsetDisabledIcon(org.pushingpixels.neon.api.icon.ResizableIcon disabledIcon)Sets the disabled icon for this button.voidsetEnabled(boolean b)voidsetExtraText(java.lang.String extraText)Sets the extra text for this button.voidsetFireActionOnRollover(boolean isFireActionOnRollover)Sets action-on-rollover mode.voidsetFlat(boolean isFlat)Sets the flat appearance of this button.voidsetGapScaleFactor(double gapScaleFactor)Sets new gap scale factor for the content of this button.voidsetHGapScaleFactor(double hgapScaleFactor)Sets new horizontal gap scale factor for the content of this button.voidsetHorizontalAlignment(int alignment)Sets new horizontal alignment for the content of this button.voidsetIcon(org.pushingpixels.neon.api.icon.ResizableIcon defaultIcon)Sets new icon for this button.voidsetIconDimension(int dimension)Updates the dimension of the icon of the associated command button in theCommandButtonPresentationState.FIT_TO_ICONstate.voidsetLocationOrderKind(JCommandButton.CommandButtonLocationOrderKind locationOrderKind)Sets the location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips.voidsetPopupCallback(PopupPanelCallback popupCallback)Sets new popup callback forthisbutton.voidsetPopupHorizontalGravity(CommandButtonPresentationModel.PopupHorizontalGravity popupHorizontalGravity)Sets the popup horizontal gravity for this button.voidsetPopupKeyTip(java.lang.String popupKeyTip)Sets the key tip for the popup area of this button.voidsetPopupModel(PopupButtonModel newModel)Sets the new popup model for this button.voidsetPopupOrientationKind(CommandButtonPresentationModel.PopupOrientationKind popupOrientationKind)Sets the popup orientation for this button.voidsetPopupRichTooltip(RichTooltip richTooltip)Sets the rich tooltip for the popup area of this button.voidsetPresentationState(CommandButtonPresentationState state)Sets new presentation state forthisbutton.voidsetText(java.lang.String text)Sets the new text for this button.voidsetToolTipText(java.lang.String text)voidsetVGapScaleFactor(double vgapScaleFactor)Sets new vertical gap scale factor for the content of this button.voidupdateUI()-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
-
-
-
Field Detail
-
DEFAULT_HORIZONTAL_ALIGNMENT
public static final int DEFAULT_HORIZONTAL_ALIGNMENT
- See Also:
- Constant Field Values
-
DEFAULT_GAP_SCALE_FACTOR
public static final double DEFAULT_GAP_SCALE_FACTOR
- See Also:
- Constant Field Values
-
uiClassID
public static final java.lang.String uiClassID
The UI class ID string.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCommandButton
public JCommandButton(Projection<JCommandButton,? extends Command,CommandButtonPresentationModel> projection)
-
-
Method Detail
-
getUI
public org.pushingpixels.flamingo.internal.ui.common.CommandButtonUI getUI()
Returns the UI delegate for this button.- Overrides:
getUIin classjavax.swing.JComponent- Returns:
- The UI delegate for this button.
-
getProjection
public CommandButtonProjection<? extends Command> getProjection()
-
setPresentationState
public void setPresentationState(CommandButtonPresentationState state)
Sets new presentation state forthisbutton. Fires apresentationStateproperty change event.- Parameters:
state- New presentation state.- See Also:
getPresentationState()
-
getIcon
public org.pushingpixels.neon.api.icon.ResizableIcon getIcon()
Returns the associated icon.- Returns:
- The associated icon.
- See Also:
getDisabledIcon(),setIcon(ResizableIcon)
-
setIcon
public void setIcon(org.pushingpixels.neon.api.icon.ResizableIcon defaultIcon)
Sets new icon for this button. Fires aniconproperty change event.- Parameters:
defaultIcon- New default icon for this button.- See Also:
setDisabledIcon(ResizableIcon),getIcon()
-
setDisabledIcon
public void setDisabledIcon(org.pushingpixels.neon.api.icon.ResizableIcon disabledIcon)
Sets the disabled icon for this button.- Parameters:
disabledIcon- Disabled icon for this button.- See Also:
setIcon(ResizableIcon),getDisabledIcon()
-
getDisabledIcon
public org.pushingpixels.neon.api.icon.ResizableIcon getDisabledIcon()
Returns the associated disabled icon.- Returns:
- The associated disabled icon.
- See Also:
setDisabledIcon(ResizableIcon),getIcon()
-
getPresentationState
public CommandButtonPresentationState getPresentationState()
Return the current presentation state ofthisbutton.- Returns:
- The current presentation state of
thisbutton. - See Also:
setPresentationState(CommandButtonPresentationState)
-
getExtraText
public java.lang.String getExtraText()
Returns the extra text of this button.- Returns:
- Extra text of this button.
- See Also:
setExtraText(String)
-
setExtraText
public void setExtraText(java.lang.String extraText)
Sets the extra text for this button. Fires anextraTextproperty change event.- Parameters:
extraText- Extra text for this button.- See Also:
getExtraText()
-
getText
public java.lang.String getText()
Returns the text of this button.- Returns:
- The text of this button.
- See Also:
setText(String)
-
setText
public void setText(java.lang.String text)
Sets the new text for this button. Fires atextproperty change event.- Parameters:
text- The new text for this button.- See Also:
getText()
-
setIconDimension
public void setIconDimension(int dimension)
Updates the dimension of the icon of the associated command button in theCommandButtonPresentationState.FIT_TO_ICONstate. Fires aniconDimensionproperty change event.- Parameters:
dimension- New dimension of the icon of the associated command button in theCommandButtonPresentationState.FIT_TO_ICONstate.- See Also:
getIconDimension()
-
getIconDimension
public int getIconDimension()
Returns the dimension of the icon of the associated command button in theCommandButtonPresentationState.FIT_TO_ICONstate.- Returns:
- The dimension of the icon of the associated command button in the
CommandButtonPresentationState.FIT_TO_ICONstate. - See Also:
setIconDimension(int)
-
isFlat
public boolean isFlat()
Returns indication whether this button has flat appearance.- Returns:
trueif this button has flat appearance,falseotherwise.- See Also:
setFlat(boolean)
-
setFlat
public void setFlat(boolean isFlat)
Sets the flat appearance of this button. Fires aflatproperty change event.- Parameters:
isFlat- Iftrue, this button will have flat appearance, otherwise this button will not have flat appearance.- See Also:
isFlat()
-
getActionModel
public ActionButtonModel getActionModel()
Returns the action model for this button.- Returns:
- The action model for this button.
- See Also:
setActionModel(ActionButtonModel)
-
setActionModel
public void setActionModel(ActionButtonModel newModel)
Sets the new action model for this button. Fires anactionModelproperty change event.- Parameters:
newModel- The new action model for this button.- See Also:
getActionModel()
-
addCommandListener
public void addCommandListener(CommandAction l)
Adds the specified command listener to this button.- Parameters:
l- Command listener to add.- See Also:
removeCommandListener(CommandAction)
-
removeCommandListener
public void removeCommandListener(CommandAction l)
Removes the specified command listener from this button.- Parameters:
l- Command listener to remove.- See Also:
addCommandListener(CommandAction)
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Adds the specified change listener to this button.- Parameters:
l- Change listener to add.- See Also:
removeChangeListener(ChangeListener)
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Removes the specified change listener from this button.- Parameters:
l- Change listener to remove.- See Also:
addChangeListener(ChangeListener)
-
fireStateChanged
protected void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created.- See Also:
EventListenerList
-
fireActionPerformed
protected void fireActionPerformed(java.awt.event.ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using theeventparameter.- Parameters:
event- theActionEventobject- See Also:
EventListenerList
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment)
Sets new horizontal alignment for the content of this button. Fires ahorizontalAlignmentproperty change event.- Parameters:
alignment- New horizontal alignment for the content of this button.- See Also:
getHorizontalAlignment()
-
getHorizontalAlignment
public int getHorizontalAlignment()
Returns the horizontal alignment for the content of this button.- Returns:
- The horizontal alignment for the content of this button.
- See Also:
setHorizontalAlignment(int)
-
setHGapScaleFactor
public void setHGapScaleFactor(double hgapScaleFactor)
Sets new horizontal gap scale factor for the content of this button. Fires anhgapScaleFactorproperty change event.- Parameters:
hgapScaleFactor- New horizontal gap scale factor for the content of this button.- See Also:
getHGapScaleFactor(),setVGapScaleFactor(double),setGapScaleFactor(double)
-
setVGapScaleFactor
public void setVGapScaleFactor(double vgapScaleFactor)
Sets new vertical gap scale factor for the content of this button. Fires avgapScaleFactorproperty change event.- Parameters:
vgapScaleFactor- New vertical gap scale factor for the content of this button.- See Also:
getVGapScaleFactor(),setHGapScaleFactor(double),setGapScaleFactor(double)
-
setGapScaleFactor
public void setGapScaleFactor(double gapScaleFactor)
Sets new gap scale factor for the content of this button.- Parameters:
gapScaleFactor- New gap scale factor for the content of this button.- See Also:
getHGapScaleFactor(),getVGapScaleFactor()
-
getHGapScaleFactor
public double getHGapScaleFactor()
Returns the horizontal gap scale factor for the content of this button.- Returns:
- The horizontal gap scale factor for the content of this button.
- See Also:
setHGapScaleFactor(double),setGapScaleFactor(double),getVGapScaleFactor()
-
getVGapScaleFactor
public double getVGapScaleFactor()
Returns the vertical gap scale factor for the content of this button.- Returns:
- The vertical gap scale factor for the content of this button.
- See Also:
setVGapScaleFactor(double),setGapScaleFactor(double),getHGapScaleFactor()
-
doActionClick
public void doActionClick()
Programmatically perform an action "click". This does the same thing as if the user had pressed and released the action area of the button.
-
setActionRichTooltip
public void setActionRichTooltip(RichTooltip richTooltip)
Sets the rich tooltip for the action area of this button.- Parameters:
richTooltip- Rich tooltip for the action area of this button.- See Also:
getRichTooltip(MouseEvent)
-
setToolTipText
public void setToolTipText(java.lang.String text)
- Overrides:
setToolTipTextin classjavax.swing.JComponent
-
getLocationOrderKind
public JCommandButton.CommandButtonLocationOrderKind getLocationOrderKind()
Returns the location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips.- Returns:
- The location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips.
- See Also:
setLocationOrderKind(CommandButtonLocationOrderKind)
-
setLocationOrderKind
public void setLocationOrderKind(JCommandButton.CommandButtonLocationOrderKind locationOrderKind)
Sets the location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips. Fires alocationOrderKindproperty change event.- Parameters:
locationOrderKind- The location order kind for buttons placed in command button strips or for buttons that need the visuals of segmented strips.- See Also:
getLocationOrderKind()
-
getActionKeyTip
public java.lang.String getActionKeyTip()
Returns the key tip for the action area of this button.- Returns:
- The key tip for the action area of this button.
- See Also:
setActionKeyTip(String)
-
setActionKeyTip
public void setActionKeyTip(java.lang.String actionKeyTip)
Sets the key tip for the action area of this button. Fires anactionKeyTipproperty change event.- Parameters:
actionKeyTip- The key tip for the action area of this button.- See Also:
getActionKeyTip()
-
getCommandButtonKind
public JCommandButton.CommandButtonKind getCommandButtonKind()
Returns the command button kind of this button.- Returns:
- Command button kind of this button.
- See Also:
setCommandButtonKind(CommandButtonKind)
-
setCommandButtonKind
public void setCommandButtonKind(JCommandButton.CommandButtonKind commandButtonKind)
Sets the kind for this button. Fires acommandButtonKindproperty change event.- Parameters:
commandButtonKind- The new button kind.- See Also:
getCommandButtonKind()
-
getPopupOrientationKind
public CommandButtonPresentationModel.PopupOrientationKind getPopupOrientationKind()
Returns the popup orientation kind of this button.- Returns:
- Popup orientation kind of this button.
- See Also:
setPopupOrientationKind(CommandButtonPresentationModel.PopupOrientationKind)
-
setPopupOrientationKind
public void setPopupOrientationKind(CommandButtonPresentationModel.PopupOrientationKind popupOrientationKind)
Sets the popup orientation for this button. Fires apopupOrientationKindproperty change event.- Parameters:
popupOrientationKind- The new popup orientation kind.- See Also:
getPopupOrientationKind()
-
getPopupHorizontalGravity
public CommandButtonPresentationModel.PopupHorizontalGravity getPopupHorizontalGravity()
Returns the popup horizontal gravity of this button.- Returns:
- Popup horizontal gravity of this button.
- See Also:
setPopupHorizontalGravity(CommandButtonPresentationModel.PopupHorizontalGravity)
-
setPopupHorizontalGravity
public void setPopupHorizontalGravity(CommandButtonPresentationModel.PopupHorizontalGravity popupHorizontalGravity)
Sets the popup horizontal gravity for this button. Fires apopupHorizontalGravityproperty change event.- Parameters:
popupHorizontalGravity- The new popup horizontal gravity.- See Also:
getPopupHorizontalGravity()
-
updateUI
public void updateUI()
- Overrides:
updateUIin classjavax.swing.JComponent
-
getUIClassID
public java.lang.String getUIClassID()
- Overrides:
getUIClassIDin classjavax.swing.JComponent
-
getPopupCallback
public PopupPanelCallback getPopupCallback()
Returns the associated popup callback.- Returns:
- The associated popup callback.
- See Also:
setPopupCallback(PopupPanelCallback)
-
setPopupCallback
public void setPopupCallback(PopupPanelCallback popupCallback)
Sets new popup callback forthisbutton.- Parameters:
popupCallback- New popup callback forthisbutton.- See Also:
getPopupCallback()
-
setAutoRepeatAction
public void setAutoRepeatAction(boolean isAutoRepeatAction)
Sets the auto-repeat action indication.- Parameters:
isAutoRepeatAction- Iftrue, pressing the button will activate auto-repeat action mode. When the button is not in the auto-repeat action mode, the registered action listeners are activated when the mouse is released (just as with the baseAbstractButton). When the button is in auto-repeat mode, the registered action listeners are activated when the mouse is pressed. In addition, is the mouse is still pressed aftergetAutoRepeatInitialInterval(), the action listeners will be activated everygetAutoRepeatSubsequentInterval()until the button is disabled or the mouse is released.- See Also:
setAutoRepeatActionIntervals(int, int),isAutoRepeatAction()
-
setAutoRepeatActionIntervals
public void setAutoRepeatActionIntervals(int initial, int subsequent)Sets the intervals for the auto-repeat action mode.- Parameters:
initial- The initial interval for invoking the registered action listeners in the auto-repeat action mode.subsequent- The subsequent interval for invoking the registered action listeners in the auto-repeat action mode.- See Also:
setAutoRepeatAction(boolean),isAutoRepeatAction(),getAutoRepeatInitialInterval(),getAutoRepeatSubsequentInterval()
-
isAutoRepeatAction
public boolean isAutoRepeatAction()
Returns indication whether the button is in auto-repeat action mode.- Returns:
trueif the button is in auto-repeat action mode,falseotherwise.- See Also:
setAutoRepeatAction(boolean),setAutoRepeatActionIntervals(int, int),getAutoRepeatInitialInterval(),getAutoRepeatSubsequentInterval()
-
getAutoRepeatInitialInterval
public int getAutoRepeatInitialInterval()
Returns the initial interval for invoking the registered action listeners in the auto-repeat action mode.- Returns:
- The initial interval for invoking the registered action listeners in the auto-repeat action mode.
- See Also:
setAutoRepeatActionIntervals(int, int),setAutoRepeatAction(boolean),isAutoRepeatAction(),getAutoRepeatSubsequentInterval()
-
getAutoRepeatSubsequentInterval
public int getAutoRepeatSubsequentInterval()
Returns the subsequent interval for invoking the registered action listeners in the auto-repeat action mode.- Returns:
- The subsequent interval for invoking the registered action listeners in the auto-repeat action mode.
- See Also:
setAutoRepeatActionIntervals(int, int),setAutoRepeatAction(boolean),isAutoRepeatAction(),getAutoRepeatInitialInterval()
-
setFireActionOnRollover
public void setFireActionOnRollover(boolean isFireActionOnRollover)
Sets action-on-rollover mode. When this mode is on, button will fire action events when it gets rollover (instead of press). Combine withsetAutoRepeatAction(boolean)passingtrueto get auto-repeat action fired on rollover (useful for quicker manipulation of scroller buttons, for example).- Parameters:
isFireActionOnRollover- Iftrue, the button is moved into the action-on-rollover mode.- See Also:
isFireActionOnRollover()
-
isFireActionOnRollover
public boolean isFireActionOnRollover()
Returns indication whether this button is in action-on-rollover mode.- Returns:
trueif this button is in action-on-rollover mode,falseotherwise.- See Also:
setFireActionOnRollover(boolean)
-
getPopupModel
public PopupButtonModel getPopupModel()
Returns the popup model of this button.- Returns:
- The popup model of this button.
- See Also:
setPopupModel(PopupButtonModel)
-
setPopupModel
public void setPopupModel(PopupButtonModel newModel)
Sets the new popup model for this button. Fires apopupModelproperty change event.- Parameters:
newModel- The new popup model for this button.- See Also:
getPopupModel()
-
setEnabled
public void setEnabled(boolean b)
- Overrides:
setEnabledin classjavax.swing.JComponent
-
firePopupActionPerformed
protected void firePopupActionPerformed(java.awt.event.ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using theeventparameter.- Parameters:
event- theActionEventobject- See Also:
EventListenerList
-
setPopupRichTooltip
public void setPopupRichTooltip(RichTooltip richTooltip)
Sets the rich tooltip for the popup area of this button.- Parameters:
richTooltip- Rich tooltip for the popup area of this button.- See Also:
getRichTooltip(MouseEvent),setActionRichTooltip(RichTooltip)
-
getRichTooltip
public RichTooltip getRichTooltip(java.awt.event.MouseEvent event)
- Specified by:
getRichTooltipin classRichTooltipManager.JTrackableComponent
-
getPopupKeyTip
public java.lang.String getPopupKeyTip()
Returns the key tip for the popup area of this button.- Returns:
- The key tip for the popup area of this button.
- See Also:
setPopupKeyTip(String),getActionKeyTip()
-
setPopupKeyTip
public void setPopupKeyTip(java.lang.String popupKeyTip)
Sets the key tip for the popup area of this button. Fires apopupKeyTipproperty change event.- Parameters:
popupKeyTip- The key tip for the popup area of this button.- See Also:
getPopupKeyTip(),setActionKeyTip(String)
-
doPopupClick
public void doPopupClick()
Programmatically perform a "click" on the popup area. This does the same thing as if the user had pressed and released the popup area of the button.
-
isPopupVisible
public boolean isPopupVisible()
-
addRolloverActionListener
public void addRolloverActionListener(RolloverActionListener l)
Adds a rollover action listener that will be called when the rollover state of this button becomes active.- Parameters:
l- The rollover action listener to add.- See Also:
removeRolloverActionListener(RolloverActionListener)
-
removeRolloverActionListener
public void removeRolloverActionListener(RolloverActionListener l)
Removes the specified rollover action listener.- Parameters:
l- The listener to remove.- See Also:
addRolloverActionListener(RolloverActionListener)
-
doActionRollover
public void doActionRollover()
Programmatically perform a "rollover" on the action area. This does the same thing as if the user had moved the mouse over the action area of the button.
-
-