org.tentackle.ui
Class FormButton
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
org.tentackle.ui.FormButton
- All Implemented Interfaces:
- ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants
- Direct Known Subclasses:
- GCButton
public class FormButton
- extends JButton
A Button which is aware of forms.
- Author:
- harald
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.AbstractButton |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
|
Method Summary |
protected void |
fireActionPerformed(ActionEvent event)
Notifies all listeners that have registered interest for
notification on this event type. |
String |
getHelpURL()
Gets the help url. |
boolean |
isActionPerformedDelayed()
Returns whether a button press should be processed delayed or immediately. |
boolean |
isClickOnEnter()
Gets the behaviour when user presses the Enter-Key |
boolean |
isFormTraversable()
Returns whether this button is form traversable.
|
protected void |
processFocusEvent(FocusEvent e)
Processes focus events occurring on this component by
dispatching them to any registered
FocusListener objects. |
protected void |
processKeyEvent(KeyEvent e)
Overrides processKeyEvent to process events. |
void |
setActionPerformedDelayed(boolean delayActionPerformed)
Sets whether a button press should be processed delayed or immediately. |
void |
setClickOnEnter(boolean clickOnEnter)
Sets the behaviour when user presses the Enter-Key if button has focus. |
void |
setFormTraversable(boolean formTraversable)
Sets whether this button is form traversable.
If the button is traversable it will receive focus according
to the keyboard focus policy. |
void |
setHelpURL(String helpURL)
Sets the help url. |
| Methods inherited from class javax.swing.AbstractButton |
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition |
| 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
FormButton
public FormButton()
- Creates a button with no set text or icon.
FormButton
public FormButton(Icon icon)
- Creates a button with an icon.
- Parameters:
icon - the Icon image to display on the button
FormButton
public FormButton(String text)
- Creates a button with text.
- Parameters:
text - the text of the button
FormButton
public FormButton(Action a)
- Creates a button where properties are taken from the
Action supplied.
- Parameters:
a - the Action used to specify the new button- Since:
- 1.3
FormButton
public FormButton(String text,
Icon icon)
- Creates a button with initial text and an icon.
- Parameters:
text - the text of the buttonicon - the Icon image to display on the button
fireActionPerformed
protected void fireActionPerformed(ActionEvent event)
- Notifies all listeners that have registered interest for
notification on this event type. The event instance
is lazily created using the
event
parameter.
Overridden to make sure that actionPerformed is executed
*after* focusLost has been processed by the opposite component!
- Overrides:
fireActionPerformed in class AbstractButton
- Parameters:
event - the ActionEvent object- See Also:
EventListenerList
processFocusEvent
protected void processFocusEvent(FocusEvent e)
- Processes focus events occurring on this component by
dispatching them to any registered
FocusListener objects.
This method is not called unless focus events are
enabled for this component. Focus events are enabled
when one of the following occurs:
- A
FocusListener object is registered
via addFocusListener.
- Focus events are enabled via
enableEvents.
If focus events are enabled for a Component,
the current KeyboardFocusManager determines
whether or not a focus event should be dispatched to
registered FocusListener objects. If the
events are to be dispatched, the KeyboardFocusManager
calls the Component's dispatchEvent
method, which results in a call to the Component's
processFocusEvent method.
If focus events are enabled for a Component, calling
the Component's dispatchEvent method
with a FocusEvent as the argument will result in a
call to the Component's processFocusEvent
method regardless of the current KeyboardFocusManager.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
Overridden due to tooltip display
- Overrides:
processFocusEvent in class Component
- Parameters:
e - the focus event- See Also:
FocusEvent,
FocusListener,
KeyboardFocusManager,
Component.addFocusListener(java.awt.event.FocusListener),
Component.enableEvents(long),
Component.dispatchEvent(java.awt.AWTEvent)
processKeyEvent
protected void processKeyEvent(KeyEvent e)
- Overrides
processKeyEvent to process events.
Overridden due to navigation by keys
- Overrides:
processKeyEvent in class JComponent
- Parameters:
e - the key event- See Also:
KeyEvent,
KeyListener,
KeyboardFocusManager,
DefaultKeyboardFocusManager,
Component.processEvent(java.awt.AWTEvent),
Component.dispatchEvent(java.awt.AWTEvent),
Component.addKeyListener(java.awt.event.KeyListener),
Component.enableEvents(long),
Component.isShowing()
setClickOnEnter
public void setClickOnEnter(boolean clickOnEnter)
- Sets the behaviour when user presses the Enter-Key if button has focus.
- Parameters:
clickOnEnter - true if pressing the VK_ENTER performs a click, false if transfer focus (default)
isClickOnEnter
public boolean isClickOnEnter()
- Gets the behaviour when user presses the Enter-Key
- Returns:
- true if pressing the VK_ENTER performs a click, false if transfer focus
getHelpURL
public String getHelpURL()
- Gets the help url.
- Returns:
- the help url
setHelpURL
public void setHelpURL(String helpURL)
- Sets the help url.
- Parameters:
helpURL - the help url
isActionPerformedDelayed
public boolean isActionPerformedDelayed()
- Returns whether a button press should be processed delayed or immediately.
- Returns:
- true if delayed (default), false if immediately (like JButton).
setActionPerformedDelayed
public void setActionPerformedDelayed(boolean delayActionPerformed)
- Sets whether a button press should be processed delayed or immediately.
- Parameters:
delayActionPerformed - true if delayed (set to end of event queue, default!), false if immediately
isFormTraversable
public boolean isFormTraversable()
- Returns whether this button is form traversable.
- Returns:
- true if traversable, false if not (default)
setFormTraversable
public void setFormTraversable(boolean formTraversable)
- Sets whether this button is form traversable.
If the button is traversable it will receive focus according
to the keyboard focus policy.
- Parameters:
formTraversable - true if traversable, false if not (default)- See Also:
FormFocusTraversalPolicy
Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de