.. role:: ts-api-decorator

########
Operator
########

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: Operator

      The ``Operator`` class is the base class for all operators. A name is required for all operators, and
      the name is used to identify the operator in the ``cee.OperatorStack``.

      Operators contain optional methods that correspond to the different events that may occur in the view. 
      When an operator is set on a ``View``, the operator can interact with its ownerView, but only that view.
      The ``cee.Viewer`` sets the events listeners internally, and then fires the corresponding Operator event 
      handler method when the event is recieved.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.Operator.constructor`



.. container:: api-index-section

   .. rubric:: Accessors

   .. rst-class:: api-index-list-item api-kind-accessor api-parent-kind-class

   * :js:attr:`~cee.Operator.name`
   * :js:attr:`~cee.Operator.ownerView`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.Operator.onAddedToView`
   * :js:meth:`~cee.Operator.onClick`
   * :js:meth:`~cee.Operator.onDblClick`
   * :js:meth:`~cee.Operator.onKeyDown`
   * :js:meth:`~cee.Operator.onKeyUp`
   * :js:meth:`~cee.Operator.onMouseDown`
   * :js:meth:`~cee.Operator.onMouseMove`
   * :js:meth:`~cee.Operator.onMouseUp`
   * :js:meth:`~cee.Operator.onPointerDown`
   * :js:meth:`~cee.Operator.onPointerMove`
   * :js:meth:`~cee.Operator.onPointerUp`
   * :js:meth:`~cee.Operator.onRemovedFromView`
   * :js:meth:`~cee.Operator.onTouchEnd`
   * :js:meth:`~cee.Operator.onTouchMove`
   * :js:meth:`~cee.Operator.onTouchStart`
   * :js:meth:`~cee.Operator.onWheel`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: Operator.constructor( name)

      :param name: None
      :type name: string


      :rtype: Operator



Accessors
=========

.. container:: ts-api-section

   .. js:function:: Operator.name()



      The name of the operator. 
      Built-in operator names can be referenced by the ``StandardOperator`` enum.


      :rtype: string



.. container:: ts-api-section

   .. js:function:: Operator.ownerView()



      Returns the ``View`` that this operator is set on.
      If the operator is not on a view's ``cee.OperatorStack``, null is returned.


      :rtype: View



Methods
=======

.. rst-class:: ts-api-section

onAddedToView
-------------

.. js:method:: Operator.onAddedToView()



   :rtype: void

.. rst-class:: ts-api-section

onClick
-------

.. js:method:: Operator.onClick( event)

   :param event: None
   :type event: MouseEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onDblClick
----------

.. js:method:: Operator.onDblClick( event)

   :param event: None
   :type event: MouseEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onKeyDown
---------

.. js:method:: Operator.onKeyDown( event)

   :param event: None
   :type event: KeyboardEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onKeyUp
-------

.. js:method:: Operator.onKeyUp( event)

   :param event: None
   :type event: KeyboardEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onMouseDown
-----------

.. js:method:: Operator.onMouseDown( event)

   :param event: None
   :type event: MouseEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onMouseMove
-----------

.. js:method:: Operator.onMouseMove( event)

   :param event: None
   :type event: MouseEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onMouseUp
---------

.. js:method:: Operator.onMouseUp( event)

   :param event: None
   :type event: MouseEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onPointerDown
-------------

.. js:method:: Operator.onPointerDown( event)

   :param event: None
   :type event: PointerEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onPointerMove
-------------

.. js:method:: Operator.onPointerMove( event)

   :param event: None
   :type event: PointerEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onPointerUp
-----------

.. js:method:: Operator.onPointerUp( event)

   :param event: None
   :type event: PointerEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onRemovedFromView
-----------------

.. js:method:: Operator.onRemovedFromView()



   :rtype: void

.. rst-class:: ts-api-section

onTouchEnd
----------

.. js:method:: Operator.onTouchEnd( event)

   :param event: None
   :type event: TouchEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onTouchMove
-----------

.. js:method:: Operator.onTouchMove( event)

   :param event: None
   :type event: TouchEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onTouchStart
------------

.. js:method:: Operator.onTouchStart( event)

   :param event: None
   :type event: TouchEvent


   :rtype: OperatorEventStatus

.. rst-class:: ts-api-section

onWheel
-------

.. js:method:: Operator.onWheel( event)

   :param event: None
   :type event: WheelEvent


   :rtype: OperatorEventStatus

