예제 #1
0
 public void clearInputEvents() {
   TVP.EventManager.cancelInputEvents(this);
 }
예제 #2
0
  public void invalidate() throws VariantException, TJSException {
    // remove from list
    TVP.WindowList.unregisterWindowToList((WindowNI) this);

    // remove all events
    TVP.EventManager.cancelSourceEvents(mOwner.get());
    TVP.EventManager.cancelInputEvents(this);

    // clear all window update events
    TVP.EventManager.removeWindowUpdate(this);

    // free DrawBuffer
    // if( mDrawBuffer != null ) mDrawBuffer = null;

    // disconnect all VideoOverlay objects
    try {
      mVideoOverlay.safeLock();
      int count = mVideoOverlay.getSafeLockedObjectCount();
      for (int i = 0; i < count; i++) {
        VideoOverlayNI item = mVideoOverlay.getSafeLockedObjectAt(i);
        if (item == null) continue;
        item.disconnect();
      }
    } finally {
      mVideoOverlay.safeUnlock();
    }

    // invalidate all registered objects
    mObjectVectorLocked = true;
    final int count = mObjectVector.size();
    for (int i = 0; i < count; i++) {
      // invalidate each --
      // objects may throw an exception while invalidating,
      // but here we cannot care for them.
      VariantClosure clo = mObjectVector.get(i);
      try {
        clo.invalidate(0, null, null);
        clo = null;
      } catch (TJSException e) {
        DebugClass.addLog(e.getMessage()); // just in case, log the error
      }
    }

    // invalidate menu object
    if (mMenuItemObject != null) {
      mMenuItemObject.invalidate(0, null, mMenuItemObject);
      mMenuItemObject = null;
    }

    // remove all events (again)
    // TVPCancelSourceEvents( mOwner );
    // TVPCancelInputEvents( this );

    // clear all window update events (again)
    // TVPRemoveWindowUpdate( this );

    // release draw device
    // setDrawDeviceObject( new Variant() );

    super.invalidate();
    /* NOTE: at this point, Owner is still non-null.
    Caller must ensure that the Owner being null at the end of the
    invalidate chain. */

    if (mForm != null) {
      mForm.invalidateClose();
      mForm = null;
    }

    // remove all events
    TVP.EventManager.cancelSourceEvents(mOwner.get());
    TVP.EventManager.cancelInputEvents(this);

    // Set Owner null
    mOwner.clear();
  }