public abstract class RadioButton<O extends OutputManager<?>> extends AbstractContainer<O> implements DataContainer, WidgetWithConfig<RadioSetConfig>, MnemonicTrait<O>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoResize
Automatic size change enabling flag.
|
protected RadioSetConfig |
config
Reference to config.
|
protected boolean |
focused
Pseudo-focus flag.
|
private int |
itemId
button id
|
private MnemonicInfo |
mnemonic
Mnemonic information
|
private boolean |
selected
Selection flag.
|
private java.lang.String |
text
Button text.
|
private BaseDataType |
value
The value to be returned as the RadioButton value.
|
protected double |
width
The width of the button.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
RadioButton(RadioSetConfig config,
java.lang.String label,
BaseDataType value)
Use this constructor when you want to set both the label and the value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(RadioSetConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
RadioSetConfig |
config()
Provide access to the attributes stored in the widget.
|
abstract void |
draw()
Called by this RadioButton's parent container.
|
abstract void |
drawCaret()
Draw cursor at the correct position.
|
int |
getItemId()
Get button id.
|
MnemonicInfo |
getMnemonic()
MnemonicInfo instance getter.
|
java.lang.String |
getText()
Get label text.
|
BaseDataType |
getValue()
Returns the BaseDataType instance representing the current value.
|
boolean |
hasFocusable(Widget<O> exclude)
Reports if this widget is focusable.
|
double |
height()
Return height of the radio button.
|
void |
initialize(WidgetId id,
RadioSetConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
boolean |
isEnabled()
Check if widget is enabled.
|
boolean |
isFocused()
Get current state of pseudo-focus flag.
|
boolean |
isModified()
Getting the modification state of the widget.
|
boolean |
isSelected()
Get current selection state.
|
Point |
location()
Get widget location relative to container.
|
NativePoint |
physicalLocation()
Get widget physical location relative to container, expressed in units native to UI type.
|
void |
processEvent(Event evt)
Main event processing entry point.
|
void |
replace(RadioButton<O> newButton)
Replace this radio-button with the new one.
|
void |
setFocused(boolean focused)
Set pseudo-focus flag.
|
void |
setItemId(int id)
Set button id.
|
void |
setLocation(double x,
double y)
Set widget relative location.
|
void |
setMnemonic(MnemonicInfo mnemonic)
MnemonicInfo instance setter.
|
void |
setPhysicalLocation(int x,
int y)
Set widget relative physical location.
|
void |
setSelected(boolean state)
Sets the state of the button.
|
(package private) void |
setText(java.lang.String text)
Set label text.
|
void |
setValue(BaseDataType value)
Sets the BaseDataType instance representing the current value.
|
void |
setWidthChars(double newWidth)
Set up the width of the button dynamically.
|
double |
width()
Return the width of the radio button.
|
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, destroy, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setMousePointer, setParent, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChangedValuecreateMnemonic, getColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, setColumnMnemonic, updateMnemonicwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setMousePointer, setParent, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowprivate BaseDataType value
protected double width
protected boolean autoResize
private java.lang.String text
private boolean selected
protected boolean focused
private int itemId
protected RadioSetConfig config
private MnemonicInfo mnemonic
public RadioButton(RadioSetConfig config, java.lang.String label, BaseDataType value)
config - Reference to config.label - The button's label which can clarify the button purpose.value - The data which is the button's value.public void initialize(WidgetId id, RadioSetConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<RadioSetConfig>id - The widget's ID.cfg - The config used to initialize this widget.public RadioSetConfig config()
config in interface Widget<O extends OutputManager<?>>config in interface ConfigOwner<RadioSetConfig>config in class AbstractWidget<O extends OutputManager<?>>public void afterConfigUpdate(RadioSetConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<RadioSetConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public java.lang.String getText()
getText in interface DataContainervoid setText(java.lang.String text)
text - Label text.public BaseDataType getValue()
getValue in interface DataContainerpublic boolean isModified()
isModified in interface DataContainerfalse and is never called.public void setValue(BaseDataType value)
setValue in interface DataContainervalue - The value representing the current widget value.public void replace(RadioButton<O> newButton)
newButton - The new radio button to be used instead of the current one.public Point location()
location in interface Widget<O extends OutputManager<?>>location in class AbstractWidget<O extends OutputManager<?>>public NativePoint physicalLocation()
physicalLocation in interface Widget<O extends OutputManager<?>>physicalLocation in class AbstractWidget<O extends OutputManager<?>>public void setLocation(double x,
double y)
setLocation in interface Widget<O extends OutputManager<?>>setLocation in class AbstractWidget<O extends OutputManager<?>>x - Widget X.y - Widget Y.public void setPhysicalLocation(int x,
int y)
setPhysicalLocation in interface Widget<O extends OutputManager<?>>setPhysicalLocation in class AbstractWidget<O extends OutputManager<?>>x - Widget physical X.y - Widget physical Y.public double width()
width in interface Widget<O extends OutputManager<?>>width in class AbstractContainer<O extends OutputManager<?>>public double height()
height in interface Widget<O extends OutputManager<?>>height in class AbstractContainer<O extends OutputManager<?>>public void setWidthChars(double newWidth)
newWidth - The new button width in the character units.public abstract void draw()
draw in interface Widget<O extends OutputManager<?>>draw in class AbstractContainer<O extends OutputManager<?>>public abstract void drawCaret()
drawCaret in interface Widget<O extends OutputManager<?>>drawCaret in class AbstractWidget<O extends OutputManager<?>>Widget.drawCaret()public boolean isFocused()
public void setFocused(boolean focused)
focused - New state of the flag.public boolean hasFocusable(Widget<O> exclude)
hasFocusable in interface Container<O extends OutputManager<?>>hasFocusable in class AbstractContainer<O extends OutputManager<?>>exclude - A widget to ignore or null if any focusable widget will do.true if this widget is not the excluded widget.public void setSelected(boolean state)
state - New state of the button.public boolean isSelected()
true if button is selected.public void processEvent(Event evt)
processEvent in interface Widget<O extends OutputManager<?>>processEvent in class AbstractWidget<O extends OutputManager<?>>evt - Event to handle.public boolean isEnabled()
isEnabled in interface Widget<O extends OutputManager<?>>isEnabled in class AbstractWidget<O extends OutputManager<?>>true if widget is enabled.public int getItemId()
public void setItemId(int id)
id - New button id.public MnemonicInfo getMnemonic()
The implementors should simply return the value of the mnemonic class field. No additional processing logic is advised.
getMnemonic in interface MnemonicTrait<O extends OutputManager<?>>public void setMnemonic(MnemonicInfo mnemonic)
The implementors should simply assign the parameter value to the mnemonic class field. No additional processing logic is advised.
setMnemonic in interface MnemonicTrait<O extends OutputManager<?>>mnemonic - Mnemonic info.