talx x1.0.5

keyboard.constraint
Class PassOnLogicalCaretPosition

java.lang.Object
  extended byconstraint.LayeredConstraint
      extended bykeyboard.constraint.PassOnLogicalCaretPosition
All Implemented Interfaces:
Constraint, ConstraintConstants, KeyboardConstants, StateConstants

public class PassOnLogicalCaretPosition
extends LayeredConstraint
implements KeyboardConstants

Succeeds when the caret is in the correct position. This constraint works with the keyboard training panel. The value can contain the following tokens:

If more than one token is supplied, then the constraint succeeds only if all conditions are met. For example, value="bottom eol" will only succeed when the cursor is in the last character position on the bottom line. To succeed when the cursor is in the last character position, OR on the botton line, use two copies of this constraint, one for each token.
Additionally, the value can contain the token Strict in the value. If the value contains Strict and the caret reaches the correct position, this constraint checks the ERROR_DETECTED variable in the task properties. If there was an error detected, the task fails. If no error was detected, or the value does not contain strict, then the task succeeds when the caret reaches the correct position.
The completion string produced by this constraint consists of the following tokens:
  1. The constraint class name
  2. The value of the constraint
  3. the list of errors detected by other constraints


Field Summary
 
Fields inherited from interface keyboard.KeyboardConstants
BACK, BOTTOM, BUTTON_COLOR, BUTTON_COMMAND, BUTTON_TEXT, BUTTON_TEXT_ATTRIBUTES, BUTTON_TEXT_COLOR, BUTTON_TEXT_FONT_FACE, BUTTON_TEXT_SIZE, DELAY, DOWN, END, END_OF_LINE, ERROR_DETECTED, FINGER, FIRST, FRONT, HOME, INSTRUCTION_POSITION_TO_COORDS, KEYMAP, KEYMAP_COORDS_TO_PANEL_COORDS, LAST, LEFT, NO_BEEP, NO_DELETE, NO_ERROR, NO_WRAP, PAGE_DOWN, PAGE_UP, POSITION, PRESS, RIGHT, SPEED, START_OF_LINE, STRICT, TARGET_BACKGROUND_COLOR, TARGET_HIGHLIGHT, TARGET_HIGHLIGHT_CIRCLE_COLOR, TARGET_HIGHLIGHT_COLOR, TARGET_HIGHLIGHT_TEXT_COLOR, TARGET_POSITION_TO_COORDS, TARGET_TEXT, TARGET_TEXT_ATTRIBUTES, TARGET_TEXT_COLOR, TARGET_TEXT_FONT_FACE, TARGET_TEXT_SIZE, TOP, UP, USER_BACKGROUND_COLOR, USER_CARET, USER_CARET_BLINK_RATE, USER_CARET_COLOR, USER_CARET_HIGHLIGHT_COLOR, USER_CARET_WIDTH, USER_HIGHLIGHT, USER_HIGHLIGHT_CIRCLE_COLOR, USER_HIGHLIGHT_COLOR, USER_HIGHLIGHT_TEXT_COLOR, USER_POSITION_ABOVE, USER_POSITION_BELOW, USER_POSITION_TO_COORDS, USER_TEXT, USER_TEXT_ATTRIBUTES, USER_TEXT_COLOR, USER_TEXT_FONT_FACE, USER_TEXT_SIZE
 
Fields inherited from interface constraint.ConstraintConstants
ACTION_COMMAND_KEY, ACTION_TYPE_SOUND_FINISHED, COMPONENT_FINGER_POSITION, COMPONENT_FINGER_PRESS_POSITION, COMPONENT_HORIZONTAL_ARROW_POSITION, COMPONENT_INSTRUCTION_BACKGROUND_COLOR, COMPONENT_INSTRUCTION_TEXT, COMPONENT_INSTRUCTION_TEXT_ATTRIBUTES, COMPONENT_INSTRUCTION_TEXT_COLOR, COMPONENT_INSTRUCTION_TEXT_FONT_FACE, COMPONENT_INSTRUCTION_TEXT_SIZE, COMPONENT_MOUSE_FINGER_POSITION, COMPONENT_SOUND, COMPONENT_SOUND_IS_PLAYING, COMPONENT_SOUND_QUIT, COMPONENT_TIMER, COMPONENT_VERTICAL_ARROW_POSITION, DIALOG, HIDE_BULLSEYE, LESSON_STOP_ACTION, MOUSE_BULLSEYE, MOUSE_FINGER_IMAGE, NO_TOKEN, PREVIOUS_TASK_COMPLETION_REASON, PROGRESS_PANEL_VISIBLITY, SHOW_BULLSEYE, SKIP_TASK_ACTION, TAL_DIALOG, TASK_FAIL_COUNT, TASK_STATUS, TASK_SUCCEED_COUNT, YES_TOKEN
 
Fields inherited from interface controller.StateConstants
ACTION, ACTION_TYPE_CONTINUE, ACTION_TYPE_GOTO, ACTION_TYPE_IGNORE, ACTION_TYPE_PANIC, ACTION_TYPE_QUIT, ACTION_TYPE_RESTART, ACTION_TYPE_REVIEW, ACTION_TYPE_SKIP_DRILL, ACTION_TYPE_SKIP_SKILL, ACTION_TYPE_SKIP_TASK, ACTION_TYPE_TASK_STARTED, ACTION_TYPE_TRAIN, CALLBACK_COMMAND, FIRST_CALLBACK, FOURTH_CALLBACK, SECOND_CALLBACK, THIRD_CALLBACK
 
Constructor Summary
PassOnLogicalCaretPosition()
           
 
Method Summary
protected  boolean correctCaretPosition(TaskProperties tp)
           
 void doAction(TaskProperties tp)
          Performs the constraint's action.
 int getLevel()
          Returns the level of callback for this constraint.
 int[] getMonitoredKeyEvents()
          Returns KEY_RELEASED.
 int[] getMonitoredMouseEvents()
          Returns MOUSE_RELEASED.
 
Methods inherited from class constraint.LayeredConstraint
getIntValue, getType, getValue, process, processInit, setValue, toString, valueContains
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PassOnLogicalCaretPosition

public PassOnLogicalCaretPosition()
Method Detail

correctCaretPosition

protected boolean correctCaretPosition(TaskProperties tp)

getMonitoredMouseEvents

public int[] getMonitoredMouseEvents()
Returns MOUSE_RELEASED.

Overrides:
getMonitoredMouseEvents in class LayeredConstraint

getMonitoredKeyEvents

public int[] getMonitoredKeyEvents()
Returns KEY_RELEASED.

Overrides:
getMonitoredKeyEvents in class LayeredConstraint

getLevel

public int getLevel()
Description copied from class: LayeredConstraint
Returns the level of callback for this constraint. The available callback levels are:
  1. Used for constraints that react to interface changes.
  2. Used for constraints that react to changes made by level 1 constraints.
  3. Used for constraints that react to changes made by level 1 and 2 constraints. Constraints at this level should not make changes to apparati that other constraints may be monitoring.
  4. Used for constraints that require considerable overhead during callback. Constraints at this level are likely to not have their callbacks activated during heavy user input. Thus, this level can be used by constraints that only want to update during idle time.
A return value of less than 1 is interpreted as level one. A return value of more than 4 is interpreted as level four.

Specified by:
getLevel in class LayeredConstraint

doAction

public void doAction(TaskProperties tp)
Description copied from class: LayeredConstraint
Performs the constraint's action. When a monitored event is seen, and the constraint's callback level is reached, this method is called.

Specified by:
doAction in class LayeredConstraint

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.