public class ChooseHandler<O extends OutputManager<?>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
chooseActive
Set to
true when CHOOSE processing is active. |
private Color |
chooseColor
Selected item color.
|
private ChooseData |
chooseData
CHOOSE data.
|
private Widget<O>[] |
compList
List of components involved in choose.
|
private Widget<O> |
focusedCol
Component focused during processing of choose in the ROW mode.
|
private int |
index
Current selected field.
|
private boolean |
initial
This flag is reset when CHOOSE processes first typed key.
|
private boolean |
internalGo
Set to
true if CHOOSE processing was finished
by generating internal GO event. |
private Frame<O> |
owner
Owner frame.
|
Constructor and Description |
---|
ChooseHandler(Frame<O> owner)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
drawChoice(int num,
boolean highlight)
Draws one of the choice fields either highlighted or not.
|
void |
drawIfActive()
Draw choice if CHOOSE processing is active.
|
int |
enterChoose(Widget<O>[] list,
ChooseData data,
int focusOn)
Initialize CHOOSE processing mode.
|
Widget<O> |
focusedCol()
Get focused column widget.
|
ChooseData |
getChooseData()
Obtain current CHOOSE mode data.
|
java.lang.String |
getChooseHelp()
Return the help text for the selected component using the CHOOSE index.
|
int |
index()
Get current CHOOSE index.
|
private void |
invalidInput()
Standard processing for invalid input (a key that should not be pressed
during this particular CHOOSE execution).
|
boolean |
isChooseActive()
Get current state of the choose activation flag.
|
boolean |
isFieldMode()
Check if CHOOSE is in field mode.
|
boolean |
isInChoose(Widget<O> widget)
Check to see if a widget is part of an ongoing CHOOSE.
|
boolean |
isInternalGo()
Return
true if last CHOOSe operation was finished by
internal GO event. |
ChooseData |
leaveChoose()
Stop CHOOSE mode.
|
private int |
locateField(char c)
Locate field using characters typed by user.
|
private int |
locateFieldByPrefix(java.lang.String prefix)
Locate field for specified keys.
|
private int |
nextField(int key)
Select next field.
|
private int |
nextRow(int key)
Select next row in down frame.
|
private int |
prevField(int key)
Select previous field.
|
private int |
prevRow(int key)
Select previous row in down frame.
|
void |
processKeyEvent(KeyInput event)
Process keys in CHOOSE mode.
|
boolean |
setChooseAt(Widget<O> widget)
Positions the CHOOSE at the specified widget if possible and returns
the indication of success or failure.
|
private boolean chooseActive
true
when CHOOSE processing is active.private boolean internalGo
true
if CHOOSE processing was finished
by generating internal GO event.private Color chooseColor
private ChooseData chooseData
private Widget<O extends OutputManager<?>>[] compList
private Widget<O extends OutputManager<?>> focusedCol
private int index
private boolean initial
private Frame<O extends OutputManager<?>> owner
public void drawIfActive()
public ChooseData getChooseData()
public java.lang.String getChooseHelp()
null
if not in CHOOSEpublic void processKeyEvent(KeyInput event)
event
- Key event to process.public int enterChoose(Widget<O>[] list, ChooseData data, int focusOn)
list
- List of components.data
- Choose data.focusOn
- ID of the widget to start from.public boolean isChooseActive()
public boolean isInChoose(Widget<O> widget)
widget
- Widget to check.true
if the widget is part of a CHOOSEpublic ChooseData leaveChoose()
public boolean setChooseAt(Widget<O> widget)
widget
- Widget to set current CHOOSE position at.true
if the widget is part of an active CHOOSEprivate void drawChoice(int num, boolean highlight)
num
- field indexhighlight
- true
if highlighting is to be onprivate void invalidInput()
private int locateField(char c)
c
- character typed by user.private int locateFieldByPrefix(java.lang.String prefix)
prefix
- Initial characters of the item value.private int nextField(int key)
key
- Key which triggered this selection.private int nextRow(int key)
key
- Key which triggered this selection.private int prevField(int key)
key
- Key which triggered this selection.private int prevRow(int key)
key
- Key which triggered this selection.public int index()
public boolean isInternalGo()
true
if last CHOOSe operation was finished by
internal GO event.internalGo
flag.public boolean isFieldMode()
true
if field mode is active.