public class RadioSetGuiImpl extends RadioSet<GuiOutputManager>
RadioButton objects.
This is GUI specific implementation of the widget.
| Modifier and Type | Field and Description |
|---|---|
private CoordinatesConversion |
cc
Coordinate converter
|
private boolean |
firstStateCheck
Flag to keep track first time state check when widget become realized.
|
private GuiColorResolver |
gc
Color resolver
|
private GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
private int |
rightPadding
The padding of radio-buttons to the right-side.
|
private boolean |
selecting
Selection in progress flag.
|
configlisteners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
RadioSetGuiImpl(WidgetId id,
WidgetConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustCurrentButton()
Make the selected button the current one.
|
MnemonicInfo |
createMnemonic()
Creates new
MnemonicInfoGuiImpl instance. |
void |
draw()
Draws RadioSet widget in GUI mode.
|
private void |
drawInt()
Draws radio-set widget.
|
protected double |
getButtonsExpandWidth(ControlSetItem[] items)
Gets button width for expand mode.
|
protected double |
getButtonsExtraDistance()
Gets extra distance between radio-buttons.
|
protected double |
getListHeightChars()
Gets the list height in character units for radio-set.
|
protected double |
getListWidthChars()
Gets the list width in character units for radio-set.
|
private int |
getRadioButtonIndex(java.awt.event.MouseEvent mEvt)
Locates the radio-button index for the given mouse event coordinates inside radio-set.
|
(package private) int |
getRightPadding()
Get the right-padding width to be added to each button, in horizontal mode.
|
byte |
getState()
Gets the current state of this component's data.
|
double |
height()
Returns the height of the radio-set widget.
|
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 |
isDroppable()
Checks if the given widget is able to be the target of the drop operation.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event occurred for this widget.
|
void |
processKeyEvent(KeyInput keyEvent)
This overriding is used to move the focus from this widget to the
next/previous one, rather than moving between radio buttons inside the
current radio-set.
|
boolean |
processMnemonic(int key)
Process the given key, if this widget's mnemonic matches the key.
|
void |
refreshItemsImpl(int selectedId,
boolean selectedDisabled)
Refresh widget look using new set of buttons, after the concrete implementation has done any
other needed calculations.
|
boolean |
supportsCustomMousePointer()
Check if the widget supports LOAD-MOUSE-POINTER() method
|
double |
width()
Returns the width of the radio-set widget.
|
afterConfigUpdate, canMovetoTop, currentFocus, defaultFocus, focusTraversable, getCharWidth, getIndex, getSelected, getSelection, getText, getValue, getVisiblePart, isModified, manageSystemActions, onFocusGained, onFocusLost, reflectAncestorChange, refreshItems, reset, selectButton, setInitial, setValue, setWidthCharsconfig, destroy, getColon, getColumnLabelText, getColumnMnemonic, getLabelInstance, getLabelText, getMnemonic, getTo, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, setColumnMnemonic, setHidden, setLabelInstance, setMnemonic, setNoLabels, setVisible, setWasVisible, wasVisibleadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, cycleFocus, deregisterSelectedWidget, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, 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, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, 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, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, showPopupMenu, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChangedValueacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, completeTrigger, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getTriggerWidget, getTriggerWidget, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, windowmouseEntered, mouseExited, mouseReleasedgetMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonicwidgetsAsListprivate GuiDriver gd
private GuiColorResolver gc
private GuiFontResolver gf
private CoordinatesConversion cc
private boolean selecting
private boolean firstStateCheck
private int rightPadding
public RadioSetGuiImpl(WidgetId id, WidgetConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.RadioSetConfig) to finish the widget initialization.
id - The widget's ID.cfg - Configuration data.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>initialize in class RadioSet<GuiOutputManager>id - The widget's ID.cfg - The config used to initialize this widget.public void refreshItemsImpl(int selectedId,
boolean selectedDisabled)
In GUI, this computes the right-padding to be added to each radio-button.
refreshItemsImpl in class RadioSet<GuiOutputManager>selectedId - The selected button ID; -1 if none selected.selectedDisabled - Flag indicating if the selected button is disabled.public byte getState()
getState in interface Widget<GuiOutputManager>getState in class AbstractWidget<GuiOutputManager>ScreenBuffer.UNINITIALIZED).public double width()
width in interface Widget<GuiOutputManager>width in class AbstractContainer<GuiOutputManager>public double height()
height in interface Widget<GuiOutputManager>height in class AbstractContainer<GuiOutputManager>public void draw()
draw in interface Widget<GuiOutputManager>draw in class RadioSet<GuiOutputManager>public boolean processMnemonic(int key)
processMnemonic in interface Widget<GuiOutputManager>processMnemonic in class AbstractWidget<GuiOutputManager>key - The pressed mnemonic key code.true if this widget accepted this mnemonic key. Not enabled or not
visible widget will not accept it.public MnemonicInfo createMnemonic()
MnemonicInfoGuiImpl instance.MnemonicInfoGuiImpl instance.public void processKeyEvent(KeyInput keyEvent)
processKeyEvent in interface Widget<GuiOutputManager>processKeyEvent in class RadioSet<GuiOutputManager>keyEvent - The key event to be processed.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class AbstractWidget<GuiOutputManager>e - The mouse event.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>public boolean supportsCustomMousePointer()
supportsCustomMousePointer in interface Widget<GuiOutputManager>supportsCustomMousePointer in class AbstractWidget<GuiOutputManager>true if the widget supports
LOAD-MOUSE-POINTER() methodpublic boolean isDroppable()
TRUE if this widget can be droppable at this time,
FALSE otherwise.protected double getButtonsExpandWidth(ControlSetItem[] items)
getButtonsExpandWidth in class RadioSet<GuiOutputManager>items - Radio-button set to check.protected double getButtonsExtraDistance()
getButtonsExtraDistance in class RadioSet<GuiOutputManager>protected double getListHeightChars()
getListHeightChars in class RadioSet<GuiOutputManager>protected double getListWidthChars()
getListWidthChars in class RadioSet<GuiOutputManager>protected void adjustCurrentButton()
adjustCurrentButton in class RadioSet<GuiOutputManager>int getRightPadding()
rightPadding value.private void drawInt()
private int getRadioButtonIndex(java.awt.event.MouseEvent mEvt)
mEvt - The mouse event to be checked.null
if none.