|
||||||||||
| 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
dsto.dfc.swing.forms.AbstractFormEditorComponent
dsto.dfc.swing.controls.RadioBox
public class RadioBox
A control that presents a multiple choice selection as a set of
radio buttons. Supports auto-setup of choices when possible values
are defined by an EnumerationValue and is also a
FormEditor.
| Nested Class Summary |
|---|
| 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 | |
|---|---|
static int |
LAYOUT_HORIZONTAL
Lay out radio buttons horizontally. |
static int |
LAYOUT_VERTICAL
Lay out radio buttons vertically. |
| Fields inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
|---|
description |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
RadioBox()
Create radio box with no selectable options. |
|
RadioBox(Object[] possibleValues)
|
|
RadioBox(Object[] possibleValues,
int orientation)
Create a new radio box. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
void |
commitEdits()
Default implementation does nothing. |
protected void |
createRadioButtons()
|
protected void |
destroyRadioButtons()
|
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
protected int |
findIndexInPossibleValues(Object value)
Find the index of a value in the array of possible values. |
int |
getButtonOrientation()
|
Object |
getEditorValue()
Get the current value from the form editor. |
String[] |
getPossibleStringValues()
|
Object[] |
getPossibleValues()
|
JRadioButton |
getSelectedButton()
|
String |
getSelectedStringValue()
|
boolean |
isDirectEdit()
True if the editor directly edits the value passed in with setValue (). |
void |
requestFocus()
|
void |
setButtonOrientation(int newValue)
Set the orientation of the radio buttons. |
void |
setEditorValue(Object newValue)
Set the editor value (ie the current selected value). |
void |
setEnabled(boolean enabled)
|
void |
setPossibleStringValues(String[] newValues)
Convenience method to present possibleValues property as a String array for visual bean builders. |
void |
setPossibleValues(Object[] newValues)
Set the possible values that can be selected from. |
void |
setSelectedStringValue(String value)
|
| Methods inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
|---|
addFormEditorListener, fireEditComitted, fireEditCommitRequested, fireEditCommitted, getEditorComponent, getEditorDescription, getPreferredValueType, removeFormEditorListener, setEditorDescription, setObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.beans.Customizer |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
public static final int LAYOUT_HORIZONTAL
public static final int LAYOUT_VERTICAL
| Constructor Detail |
|---|
public RadioBox()
setPossibleValues(java.lang.Object[]) or use editor values implementing the EnumerationValue interface to set the possible values.
public RadioBox(Object[] possibleValues)
public RadioBox(Object[] possibleValues,
int orientation)
possibleValues - The selectable values displayed as radio
buttons in the box. May be null.orientation - The orientation of the buttons (LAYOUT_VERTICAL or
LAYOUT_HORIZONTAL).| Method Detail |
|---|
public void setPossibleValues(Object[] newValues)
newValues - The new set of possible values.public Object[] getPossibleValues()
public void setPossibleStringValues(String[] newValues)
public String[] getPossibleStringValues()
public String getSelectedStringValue()
public void setSelectedStringValue(String value)
throws IllegalFormatException
IllegalFormatExceptionpublic void setButtonOrientation(int newValue)
newValue - Either LAYOUT_HORIZONTAL or LAYOUT_VERTICAL.public int getButtonOrientation()
public void dispose()
Disposable
dispose in interface Disposablepublic void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void requestFocus()
requestFocus in class JComponentpublic JRadioButton getSelectedButton()
protected void createRadioButtons()
protected void destroyRadioButtons()
protected int findIndexInPossibleValues(Object value)
public boolean isDirectEdit()
FormEditor
isDirectEdit in interface FormEditorisDirectEdit in class AbstractFormEditorComponent
public void setEditorValue(Object newValue)
throws IllegalFormatException
setEditorValue in interface FormEditorsetEditorValue in class AbstractFormEditorComponentnewValue - The new value. If newValue implements the EnumerationValue interface, then the possible values for this control
are automatically set to its enumValues property.
IllegalFormatException - if the value was not in the
correct format for display by this editor. The source specified
by the exception should be this FormEditor instance or a child.public Object getEditorValue()
FormEditor
getEditorValue in interface FormEditorgetEditorValue in class AbstractFormEditorComponentpublic void commitEdits()
AbstractFormEditorComponent
commitEdits in interface FormEditorcommitEdits in class AbstractFormEditorComponentpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||