org.eclipse.swt.graphics.Device.release()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.eclipse.swt.graphics.Device.release()方法的一些代码示例,展示了Device.release()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.release()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Device
类名称:Device
方法名:release

Device.release介绍

[英]Releases any internal resources back to the operating system and clears all fields except the device handle.

When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in release. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by destroy.

This method is called before destroy.

If subclasses reimplement this method, they must call the super implementation.
[中]将所有内部资源释放回操作系统,并清除除设备句柄以外的所有字段。
当设备被销毁时,代表程序员获取的资源需要返回到操作系统。例如,如果设备分配了一种字体用作系统字体,该字体将在release中释放。此外,为了帮助垃圾收集器并最大限度地减少程序员保留对已处置设备的引用时未回收的内存量,除句柄外的所有字段都为零。句柄是destroy所需要的。
destroy之前调用此方法。
如果子类重新实现此方法,则它们必须调用super实现。

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Releases any internal state prior to destroying this printer.
 * This method is called internally by the dispose
 * mechanism of the <code>Device</code> class.
 */
@Override
protected void release() {
  super.release();
  data = null;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**     
 * Releases any internal state prior to destroying this printer.
 * This method is called internally by the dispose
 * mechanism of the <code>Device</code> class.
 */
protected void release () {
  super.release();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose() {
 synchronized( deviceLock ) {
  if( !isDisposed() ) {
   checkDevice();
   release();
   destroy();
   disposed = true;
  }
 }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose () {
  synchronized (Device.class) {
    if (isDisposed()) return;
    checkDevice ();
    release ();
    destroy ();
    disposed = true;
    if (tracking) {
      synchronized (trackingLock) {
        printErrors ();
        objects = null;
        errors = null;
        trackingLock = null;
      }
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose () {
  synchronized (Device.class) {
    if (isDisposed()) return;
    checkDevice ();
    release ();
    destroy ();
    deregister (this);
    xDisplay = 0;
    disposed = true;
    if (tracking) {
      synchronized (trackingLock) {
        objects = null;
        errors = null;
        trackingLock = null;
      }
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose () {
  synchronized (Device.class) {
    if (isDisposed()) return;
    checkDevice ();
    release ();
    destroy ();
    deregister (this);
    xDisplay = 0;
    disposed = true;
    if (tracking) {
      synchronized (trackingLock) {
        objects = null;
        errors = null;
        trackingLock = null;
      }
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose () {
  synchronized (Device.class) {
    if (isDisposed()) return;
    checkDevice ();
    release ();
    destroy ();
    deregister (this);
    xDisplay = 0;
    disposed = true;
    if (tracking) {
      synchronized (trackingLock) {
        objects = null;
        errors = null;
        trackingLock = null;
      }
    }
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Disposes of the operating system resources associated with
 * the receiver. After this method has been invoked, the receiver
 * will answer <code>true</code> when sent the message
 * <code>isDisposed()</code>.
 *
 * @see #release
 * @see #destroy
 * @see #checkDevice
 */
public void dispose () {
  synchronized (Device.class) {
    if (isDisposed()) return;
    checkDevice ();
    release ();
    destroy ();
    disposed = true;
    if (tracking) {
      synchronized (trackingLock) {
        printErrors ();
        objects = null;
        errors = null;
        trackingLock = null;
      }
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

synchronizer = null;
releaseDisplay ();
super.release ();

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

synchronizer = null;
releaseDisplay ();
super.release ();

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

synchronizer = null;
releaseDisplay ();
super.release ();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

synchronizer = null;
releaseDisplay ();
super.release ();

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

appMenuBar = null;
releaseDisplay ();
super.release ();

相关文章