OperatorStack
- class cee.OperatorStack()
The
OperatorStack
manages activeOperator
set on a view. Any active operators will be called in a “Last In, First Called” order. An operator event listener method (i.e. onMouseDown, onWheel, onKeyDown, etc.) will return anOperatorEventStatus
to indicate whether the particular event should be propagated to the next operator in the stack, or if it should be stopped.While multiple operators can be added to the stack and respond to the same single event, the order of operators matters and it is important to understand an operator propagates different events. It is recommend that more global operators, such as the
NavigationOperator
, are added first, and more specific and local operators are added last. This way, local operations can be captured and handled before they are propagated to the more global operations, if so desired.
Accessors
activeOperators
hotKeyOperator
Accessors
- cee.activeOperators()
Returns the array of active
Operator
objects- Return type:
[Operator]
- cee.hotKeyOperator()
Sets the hot key operator for this operator stack. The hot key (Alt/Opt) can be held to temporarily use this operator without reordering the stack. The operator must already be in the stack to be used with the hot key. Other stack operators will not be called while the hot key is held. To remove the hot key operator designation, but keep the operator on the stack, set the hot key operator to null.
- Return type:
Operator
- cee.hotKeyOperator(operator)
- Arguments:
operator (
Operator
) – None
- Return type:
void
Methods
clear
- OperatorStack.clear()
Removes all operators from the stack
- Return type:
void
get
- OperatorStack.get(operatorName)
- Arguments:
operatorName (
string
) – None
Returns a reference to the operator object with the given name
- Return type:
Operator
indexOf
peek
- OperatorStack.peek()
Returns the operator at the top of the stack
- Return type:
Operator
pop
- OperatorStack.pop()
Removes an operator from the top of the stack
- Return type:
Operator
push
remove
set
- OperatorStack.set(operator, position)
- Arguments:
operator (
Operator
) – Noneposition (
number
) – None
Sets an operator to the 0 based index position on the stack. If there is already an operator in that position, it is replaced. If the operator is already on the stack, it is moved to the requested position.
- Return type:
boolean
size
- OperatorStack.size()
Returns the operator stack size
- Return type:
number