Package com.iizix.prop.ui.selection
Class RadioSelection
java.lang.Object
com.iizix.prop.ui.selection.RadioSelection
- All Implemented Interfaces:
IUIBooleanSelection,IUIIndexedSelection,IUISelection,IUISingleIndexedSelection
public class RadioSelection extends Object implements IUIBooleanSelection, IUISingleIndexedSelection
The boolean on/off (or selected/unselected) selection state.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface com.iizix.prop.ui.selection.IUISingleIndexedSelection
EMPTYConstructor Summary
ConstructorsConstructorDescriptionRadioSelection(IUIRadioComponent source, boolean isSelected, int selectedIndex) Constructor.Method Summary
Modifier and TypeMethodDescriptionbooleanEquals.Get the source component of the event.Get the source component of the event.intGets the first selected index.int[]Gets the selected indicies.Get the source component of the event.Get the source component of the event.Gets the UI component being the source of the event.booleanisOFF()Returns if the selection is "off".booleanisON()Returns if the selection is "on".booleanReturns the selection state.booleanReturns if the selection is not set.toString()Converts the selection to a string.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.iizix.prop.ui.selection.IUISelection
asAnimatedSingleIndexedSelection, asBooleanSelection, asCellSelection, asIndexedSelection, asSingleIndexedSelection, asTriStateSelectionMethods inherited from interface com.iizix.prop.ui.selection.IUISingleIndexedSelection
getFirstSelectedIndex
Constructor Details
RadioSelection
Constructor.- Parameters:
source- The component source.isSelected- The selection state.selectedIndex- The selected index, or -1 for none.
Method Details
getSource
Get the source component of the event.- Specified by:
getSourcein interfaceIUISelection- Returns:
- The source.
getUISource
Gets the UI component being the source of the event.- Specified by:
getUISourcein interfaceIUISelection- Returns:
- The UI component.
isSelected
public boolean isSelected()Returns the selection state.- Specified by:
isSelectedin interfaceIUIBooleanSelection- Returns:
- true if selected, false if unselected.
isUnselected
public boolean isUnselected()Returns if the selection is not set.- Specified by:
isUnselectedin interfaceIUIBooleanSelection- Returns:
- true if unselected, true if selected.
isON
public boolean isON()Returns if the selection is "on".- Specified by:
isONin interfaceIUIBooleanSelection- Returns:
- true if on, false otherwise.
isOFF
public boolean isOFF()Returns if the selection is "off".- Specified by:
isOFFin interfaceIUIBooleanSelection- Returns:
- true if off, true otherwise.
getBooleanSource
Get the source component of the event.- Specified by:
getBooleanSourcein interfaceIUIBooleanSelection- Returns:
- The boolean-type component.
getSelectedIndex
public int getSelectedIndex()Gets the first selected index.- Specified by:
getSelectedIndexin interfaceIUISingleIndexedSelection- Returns:
- The first index in the current selection, or -1 for none.
getSelectedIndicies
public int[] getSelectedIndicies()Gets the selected indicies.- Specified by:
getSelectedIndiciesin interfaceIUIIndexedSelection- Specified by:
getSelectedIndiciesin interfaceIUISingleIndexedSelection- Returns:
- A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection.
getIndexedSource
Get the source component of the event.- Specified by:
getIndexedSourcein interfaceIUIIndexedSelection- Specified by:
getIndexedSourcein interfaceIUISingleIndexedSelection- Returns:
- The indexed-type component.
getSingleIndexedSource
Get the source component of the event.- Specified by:
getSingleIndexedSourcein interfaceIUISingleIndexedSelection- Returns:
- The single-indexed-type component.
equals
Equals.toString
Converts the selection to a string.