Exemplo n.º 1
0
 public void onActivate(boolean activate_or_deactivate) {
   if (!canDeliverEvents()) return;
   Dispatch2 owner = mOwner.get();
   if (owner != null) {
     // re-check the window activate state
     if (getWindowActive() == activate_or_deactivate) {
       if (activate_or_deactivate)
         TVP.EventManager.postEvent(
             owner, owner, "onActivate", 0, EventManager.EPT_IMMEDIATE, TJS.NULL_ARG);
       else
         TVP.EventManager.postEvent(
             owner, owner, "onDeactivate", 0, EventManager.EPT_IMMEDIATE, TJS.NULL_ARG);
     }
   }
 }
Exemplo n.º 2
0
 public void onOrientationChanged() {
   if (!canDeliverEvents()) return;
   Dispatch2 owner = mOwner.get();
   if (owner != null) {
     TVP.EventManager.postEvent(
         owner, owner, "onOrientationChanged", 0, EventManager.EPT_IMMEDIATE, TJS.NULL_ARG);
   }
 }
Exemplo n.º 3
0
 public void onFileDrop(final Variant array) {
   if (!canDeliverEvents()) return;
   Dispatch2 owner = mOwner.get();
   if (owner != null) {
     Variant[] arg = new Variant[1];
     arg[0] = array;
     TVP.EventManager.postEvent(owner, owner, "onFileDrop", 0, EventManager.EPT_IMMEDIATE, arg);
   }
 }
Exemplo n.º 4
0
 public void onClose() {
   if (!canDeliverEvents()) return;
   Dispatch2 owner = mOwner.get();
   if (owner != null) {
     Variant[] arg = new Variant[1];
     arg[0] = new Variant(1); // true
     TVP.EventManager.postEvent(owner, owner, "onCloseQuery", 0, EventManager.EPT_IMMEDIATE, arg);
   }
 }
Exemplo n.º 5
0
  public void onKeyPress(char key) {
    if (!canDeliverEvents()) return;
    Dispatch2 owner = mOwner.get();
    if (owner != null) {
      Variant[] arg = new Variant[1];
      arg[0] = new Variant(String.valueOf(key));
      TVP.EventManager.postEvent(owner, owner, "onKeyPress", 0, EventManager.EPT_IMMEDIATE, arg);
    }

    LayerManager manager = getLayerManagerAt(mPrimaryLayerManagerIndex);
    if (manager == null) return;
    manager.notifyKeyPress(key);
  }
Exemplo n.º 6
0
  public void onKeyUp(int key, int shift) {
    if (!canDeliverEvents()) return;
    Dispatch2 owner = mOwner.get();
    if (owner != null) {
      Variant[] arg = new Variant[2];
      arg[0] = new Variant(key);
      arg[1] = new Variant(shift);
      TVP.EventManager.postEvent(owner, owner, "onKeyUp", 0, EventManager.EPT_IMMEDIATE, arg);
    }

    LayerManager manager = getLayerManagerAt(mPrimaryLayerManagerIndex);
    if (manager == null) return;
    manager.notifyKeyUp(key, shift);
  }
Exemplo n.º 7
0
  public void onDoubleClick(int x, int y) throws TJSException {
    if (!canDeliverEvents()) return;
    Dispatch2 owner = mOwner.get();
    if (owner != null) {
      Variant[] arg = new Variant[2];
      arg[0] = new Variant(x);
      arg[1] = new Variant(y);
      TVP.EventManager.postEvent(owner, owner, "onDoubleClick", 0, EventManager.EPT_IMMEDIATE, arg);
    }

    Point pos = new Point(x, y);
    if (!transformToPrimaryLayerManager(pos)) return;
    LayerManager manager = getLayerManagerAt(mPrimaryLayerManagerIndex);
    if (manager == null) return;
    manager.notifyDoubleClick(pos.x, pos.y);
  }
Exemplo n.º 8
0
  public void onMouseWheel(int shift, int delta, int x, int y) {
    if (!canDeliverEvents()) return;
    Dispatch2 owner = mOwner.get();
    if (owner != null) {
      Variant[] arg = new Variant[4];
      arg[0] = new Variant(shift);
      arg[1] = new Variant(delta);
      arg[2] = new Variant(x);
      arg[3] = new Variant(y);
      TVP.EventManager.postEvent(owner, owner, "onMouseWheel", 0, EventManager.EPT_IMMEDIATE, arg);
    }

    Point pos = new Point(x, y);
    if (!transformToPrimaryLayerManager(pos)) return;
    LayerManager manager = getLayerManagerAt(mPrimaryLayerManagerIndex);
    if (manager == null) return;
    manager.notifyMouseWheel(shift, delta, pos.x, pos.y);
  }