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); } } }
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); } }
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); } }
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); } }
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); }
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); }
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); }
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); }