|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JToggleButton
javax.swing.JRadioButton
org.tentackle.ui.FormRadioButton
public class FormRadioButton
A radio button aware of forms.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JRadioButton |
|---|
JRadioButton.AccessibleJRadioButton |
| Nested classes/interfaces inherited from class javax.swing.JToggleButton |
|---|
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel |
| Nested classes/interfaces inherited from class javax.swing.AbstractButton |
|---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| 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 |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
FormRadioButton()
Creates a radio button without text, unselected. |
|
FormRadioButton(String text)
Creates a radio button with text, unselected. |
|
FormRadioButton(String text,
boolean selected)
Creates a radio button with text and specifies whether or not it is initially selected. |
|
FormRadioButton(String text,
Icon icon,
boolean selected)
Creates a radio button with text and icon, and specifies whether or not it is initially selected. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent evt)
Invoked when an action occurs. |
void |
addValueListener(ValueListener l)
Adds a value listener that implements the binding between this component and the data. |
void |
fireValueChanged()
Fires all value listeners registered on this component invoking their valueChanged-handler.This method is invoked whenever the data has been changed and that change should be reflected in the view. |
void |
fireValueEntered()
Fires all listeners registered on this component invoking their valueEntered-handler.This method is invoked whenever the user edited the view and that change should be reflected in the data. |
Boolean |
getFormValue()
Retrieves the value from this component. The method is used to update the data if the view has changed because the user edited it. |
String |
getHelpURL()
Gets the online-help URL. |
Window |
getParentWindow()
Gets the parent window of this component. |
Color |
getSelectedColor()
Gets the color for "checked". |
String |
getToolTipText()
Returns the tooltip string that has been set with setToolTipText. |
Color |
getUnselectedColor()
Gets the color for "unchecked". |
void |
invalidateParentInfo()
Invalidates all container-relevant (cached) information for the hierarchy of this component's parents. For optimization purposes. |
boolean |
isCellEditorUsage()
Returns whether this component is used as a cell editor. |
boolean |
isChangeable()
Returns if this component is changeable. |
boolean |
isFireRunning()
Checks whether a fire-method is running. |
boolean |
isFormTraversable()
Returns whether this component is form traversable or not. |
boolean |
isHonourChangeable()
Returns whether this component should honour the changeable-attribute or not. |
boolean |
isValueChanged()
Checks whether the contents have been changed since the last savepoint. |
void |
prepareFocusLost()
Prepares for FOCUS_LOST. Gives this component the opportunity to invoke fireValueEntered() earlier than FOCUS_LOST is really received. |
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 |
removeValueListener(ValueListener l)
Remove a value listener. |
void |
requestFocusLater()
Requests the keyboard focus for this component by appending an event to the end of the event queue. Applications should not use requestFocus() or requestFocusInWindow() unless the order in which the events are processed is unimportant. |
void |
saveValue()
Sets a savepoint for the data of this component. Allows to decide whether the user has changed the data associated with this component or not. |
void |
setCellEditorUsage(boolean flag)
Sets a hint that this component is used as a cell editor. Some components behave differently in tables than in forms, for example. |
void |
setChangeable(boolean flag)
Set the component to be changeable. This is a unified abstraction and will be translated to setEditable or setEnabled, whatever is appropriate to this component. |
void |
setFireRunning(boolean running)
Sets a component's flag that a fire-method is currently running. Used by the framework to minimize valueChanged/valueEntered processing. |
void |
setFormTraversable(boolean formTraversable)
Sets whether this component is form traversable or not, i.e. |
void |
setFormValue(Object selected)
Sets a value in this component. The method is used to update the view if the data has changed. |
void |
setFormWrapWindow(FormWindow parent)
Sets the window that will fire a FormWrapEvent when this
components loses the keyboard focus. |
void |
setHelpURL(String helpURL)
Sets the online-help URL. If a help url is set for this component, a browser will be launched to show that url. |
void |
setHonourChangeable(boolean flag)
Sets whether this component should honour the changeable-attribute or not. The default is true. |
void |
setSelectedColor(Color selectedColor)
Sets the color when item is selected. If the selected color is set, the deselected color should be set too. |
void |
setUnselectedColor(Color unselectedColor)
Sets the color when item is unselected. If the unselected color is set, the selected color should be set too. |
void |
showHelp()
Displays online help for this component. Usually triggered by KeyEvent.VK_F1 or VK_HELP or a button. |
void |
transferFocus()
Transfers the focus to the next component, as though this Component were the focus owner. |
void |
transferFocusBackward()
Transfers the focus to the previous component, as though this Component were the focus owner. |
void |
triggerValueChanged()
Promotes the fact that value changed to all FormContainers this
component is a child of. |
boolean |
wasFocusGainedFromTransfer()
Returns whether the keyboard focus was gained due to FormComponent.transferFocus()
in the opposite component. |
boolean |
wasFocusGainedFromTransferBackward()
Returns whether the keyboard focus was gained due to FormComponent.transferFocusBackward()
in the opposite component. |
boolean |
wasTransferFocus()
Returns whether this component lost the keyboard focus due to FormComponent.transferFocus(). |
boolean |
wasTransferFocusBackward()
Returns whether this component lost the keyboard focus due to FormComponent.transferFocusBackward(). |
boolean |
wasTransferFocusByEnter()
Returns whether this component lost the keyboard focus due to KeyEvent.VK_ENTER. |
| Methods inherited from class javax.swing.JRadioButton |
|---|
getAccessibleContext, getUIClassID, paramString, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.tentackle.ui.FormComponent |
|---|
hasFocus |
| Constructor Detail |
|---|
public FormRadioButton(String text,
Icon icon,
boolean selected)
text - the text of the radio button.icon - the Icon image to displayselected - a boolean value indicating the initial selection
state. If true the radio button is selected
public FormRadioButton(String text,
boolean selected)
text - the text of the radio button.selected - a boolean value indicating the initial selection
state. If true the radio button is selectedpublic FormRadioButton(String text)
text - the text of the radio button.public FormRadioButton()
| Method Detail |
|---|
public Color getSelectedColor()
public void setSelectedColor(Color selectedColor)
selectedColor - the selected color, null if defaultpublic Color getUnselectedColor()
public void setUnselectedColor(Color unselectedColor)
unselectedColor - the unselected color, null if defaultpublic String getToolTipText()
setToolTipText.
Overridden to show tooltip in tooltipdisplay _or_ via mouse hover but _not_ both.
getToolTipText in class JComponentJComponent.TOOL_TIP_TEXT_KEYpublic void transferFocus()
java.awt.Component
transferFocus in interface FormComponenttransferFocus in class ComponentComponent.requestFocus()public void transferFocusBackward()
java.awt.Component
transferFocusBackward in interface FormComponenttransferFocusBackward in class ContainerComponent.requestFocus()protected void processKeyEvent(KeyEvent e)
processKeyEvent to process events.
Overridden to implement keyboard shortcuts.
processKeyEvent in class JComponente - the key eventKeyEvent,
KeyListener,
KeyboardFocusManager,
DefaultKeyboardFocusManager,
Component.processEvent(java.awt.AWTEvent),
Component.dispatchEvent(java.awt.AWTEvent),
Component.addKeyListener(java.awt.event.KeyListener),
Component.enableEvents(long),
Component.isShowing()protected void processFocusEvent(FocusEvent e)
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:
FocusListener object is registered
via addFocusListener.
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 for advanced focus handling
processFocusEvent in class Componente - the focus eventFocusEvent,
FocusListener,
KeyboardFocusManager,
Component.addFocusListener(java.awt.event.FocusListener),
Component.enableEvents(long),
Component.dispatchEvent(java.awt.AWTEvent)public void requestFocusLater()
FormComponent
requestFocusLater in interface FormComponentpublic void actionPerformed(ActionEvent evt)
java.awt.event.ActionListener
actionPerformed in interface ActionListenerpublic void addValueListener(ValueListener l)
FormComponent
addValueListener in interface FormComponentl - the value listener to addpublic void removeValueListener(ValueListener l)
FormComponent
removeValueListener in interface FormComponentl - the value listener to removepublic void fireValueChanged()
FormComponentvalueChanged-handler.
fireValueChanged in interface FormComponentpublic void fireValueEntered()
FormComponentvalueEntered-handler.
fireValueEntered in interface FormComponentpublic void setFormValue(Object selected)
FormComponent
setFormValue in interface FormComponentselected - a Boolean object, else the radiobutton is unselectedpublic Boolean getFormValue()
FormComponent
getFormValue in interface FormComponentBoolean.TRUE or Boolean.FALSEpublic void saveValue()
FormComponent
saveValue in interface FormComponentFormComponent.isValueChanged()public boolean isValueChanged()
FormComponent
isValueChanged in interface FormComponentFormComponent.saveValue()public void triggerValueChanged()
FormComponentFormContainers this
component is a child of.
triggerValueChanged in interface FormComponentpublic void setChangeable(boolean flag)
FormComponent
setChangeable in interface FormComponentflag - true the user can edit the data, false if show onlypublic boolean isChangeable()
FormComponent
isChangeable in interface FormComponentpublic void setHonourChangeable(boolean flag)
FormComponent
setHonourChangeable in interface FormComponentflag - true if honour the changeable attribute, false if notpublic boolean isHonourChangeable()
FormComponent
isHonourChangeable in interface FormComponentpublic void setFireRunning(boolean running)
FormComponent
setFireRunning in interface FormComponentrunning - true if some fire-method is runningpublic boolean isFireRunning()
FormComponent
isFireRunning in interface FormComponentpublic void prepareFocusLost()
FormComponent
prepareFocusLost in interface FormComponentpublic void setFormWrapWindow(FormWindow parent)
FormComponentFormWrapEvent when this
components loses the keyboard focus. When fired the reference
to the window is cleared.
setFormWrapWindow in interface FormComponentparent - the window (usually the parent window of this component).public String getHelpURL()
FormComponent
getHelpURL in interface FormComponentpublic void setHelpURL(String helpURL)
FormComponent
setHelpURL in interface FormComponenthelpURL - the help urlFormHelper.openHelpURL(Component)public void showHelp()
FormComponent
showHelp in interface FormComponentpublic Window getParentWindow()
FormComponent
getParentWindow in interface FormComponentpublic void invalidateParentInfo()
FormComponent
invalidateParentInfo in interface FormComponentpublic boolean wasTransferFocus()
FormComponentFormComponent.transferFocus().
wasTransferFocus in interface FormComponentpublic boolean wasTransferFocusBackward()
FormComponentFormComponent.transferFocusBackward().
wasTransferFocusBackward in interface FormComponentpublic boolean wasFocusGainedFromTransfer()
FormComponentFormComponent.transferFocus()
in the opposite component.
wasFocusGainedFromTransfer in interface FormComponentFormFocusTraversalPolicypublic boolean wasFocusGainedFromTransferBackward()
FormComponentFormComponent.transferFocusBackward()
in the opposite component.
wasFocusGainedFromTransferBackward in interface FormComponentFormFocusTraversalPolicypublic boolean wasTransferFocusByEnter()
FormComponentKeyEvent.VK_ENTER.
wasTransferFocusByEnter in interface FormComponentpublic void setCellEditorUsage(boolean flag)
FormComponent
setCellEditorUsage in interface FormComponentflag - true if component is a cell editor, false if not.public boolean isCellEditorUsage()
FormComponent
isCellEditorUsage in interface FormComponentpublic void setFormTraversable(boolean formTraversable)
FormComponent
setFormTraversable in interface FormComponentformTraversable - true if traversable, false if notpublic boolean isFormTraversable()
FormComponent
isFormTraversable in interface FormComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||