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

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

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

Cursor.isDisposed介绍

[英]Returns true if the cursor has been disposed, and false otherwise.

This method gets the dispose state for the cursor. When a cursor has been disposed, it is an error to invoke any other method (except #dispose()) using the cursor.
[中]如果光标已被释放,则返回true,否则返回false
此方法获取游标的dispose状态。释放游标后,使用游标调用任何其他方法(除了#dispose())都是错误的。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

if ( ( (Cursor) object ).isDisposed() ) {
 return;

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Cursor {*DISPOSED*}";
  return "Cursor {" + handle + "}";
}

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
public String toString () {
  if (isDisposed()) return "Cursor {*DISPOSED*}";
  return "Cursor {" + handle + "}";
}

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Cursor {*DISPOSED*}";
  return "Cursor {" + handle + "}";
}

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Cursor {*DISPOSED*}";
  return "Cursor {" + handle + "}";
}

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
  if (isDisposed()) return "Cursor {*DISPOSED*}";
  return "Cursor {" + handle + "}";
}

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

/**
 * Returns a string containing a concise, human-readable
 * description of the receiver.
 *
 * @return a string representation of the receiver
 */
@Override
public String toString () {
 String result;
 if (isDisposed()) {
  result = "Cursor {*DISPOSED*}";
 } else {
  result = "Cursor {" + value + "}";
 }
 return result;
}

代码示例来源:origin: BiglySoftware/BiglyBT

public void setCursor(Cursor cursor) {
  if (isDisposed() || cursor == null || cursor.isDisposed()) {
    return;
  }
 label.setCursor(cursor);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

protected boolean isDisposed(Object resource) {
  if (resource instanceof Color) {
    return ((Color) resource).isDisposed();
  } else if (resource instanceof Font) {
    return ((Font) resource).isDisposed();
  } else if (resource instanceof Image) {
    return ((Image) resource).isDisposed();
  } else if (resource instanceof Cursor) {
    return ((Cursor) resource).isDisposed();
  }
  return false;
}

代码示例来源:origin: org.eclipse.e4.ui.css/swt

protected boolean isDisposed(Object resource) {
    if (resource instanceof Color) {
      return ((Color) resource).isDisposed();
    } else if (resource instanceof Font) {
      return ((Font) resource).isDisposed();
    } else if (resource instanceof Image) {
      return ((Image) resource).isDisposed();
    } else if (resource instanceof Cursor) {
      return ((Cursor) resource).isDisposed();
    }
    return false;
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public static void restoreDefaultCursor(Control control) {
    Cursor defaultCursor = (Cursor) control.getData(DEFAULT_CURSOR);
    if (defaultCursor != null) {
      control.setCursor(defaultCursor.isDisposed() ? control.getDisplay()
          .getSystemCursor(SWT.ARROW) : defaultCursor);
    }
  }
}

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument, or to the default cursor for that kind of control
 * if the argument is null.
 * <p>
 * When the mouse pointer passes over a control its appearance
 * is changed to match the control's cursor.
 * </p>
 *
 * @param cursor the new cursor (or null)
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  setCursor (cursor != null ? cursor.handle : 0);
}

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument, or to the default cursor for that kind of control
 * if the argument is null.
 * <p>
 * When the mouse pointer passes over a control its appearance
 * is changed to match the control's cursor.
 * </p>
 *
 * @param cursor the new cursor (or null)
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  setCursor (cursor != null ? cursor.handle : 0);
}

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument, or to the default cursor for that kind of control
 * if the argument is null.
 * <p>
 * When the mouse pointer passes over a control its appearance
 * is changed to match the control's cursor.
 * </p>
 *
 * @param cursor the new cursor (or null)
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  setCursor (cursor != null ? cursor.handle : 0);
}

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument.  Overridden to handle the null case since the 
 * StyledText widget uses an ibeam as its default cursor.
 *
 * @see Control#setCursor(Cursor)
 */
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (cursor == null) {
    Display display = getDisplay();
    int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM; 
    super.setCursor(display.getSystemCursor(type));
  } else {
    super.setCursor(cursor);
  }
}
/**

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument.  Overridden to handle the null case since the
 * StyledText widget uses an ibeam as its default cursor.
 *
 * @see Control#setCursor(Cursor)
 */
@Override
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (cursor == null) {
    Display display = getDisplay();
    int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
    super.setCursor(display.getSystemCursor(type));
  } else {
    super.setCursor(cursor);
  }
}
/**

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument.  Overridden to handle the null case since the
 * StyledText widget uses an ibeam as its default cursor.
 *
 * @see Control#setCursor(Cursor)
 */
@Override
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (cursor == null) {
    Display display = getDisplay();
    int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
    super.setCursor(display.getSystemCursor(type));
  } else {
    super.setCursor(cursor);
  }
}
/**

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument.  Overridden to handle the null case since the
 * StyledText widget uses an ibeam as its default cursor.
 *
 * @see Control#setCursor(Cursor)
 */
@Override
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (cursor == null) {
    Display display = getDisplay();
    int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
    super.setCursor(display.getSystemCursor(type));
  } else {
    super.setCursor(cursor);
  }
}
/**

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument.  Overridden to handle the null case since the
 * StyledText widget uses an ibeam as its default cursor.
 *
 * @see Control#setCursor(Cursor)
 */
@Override
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (cursor == null) {
    Display display = getDisplay();
    int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
    super.setCursor(display.getSystemCursor(type));
  } else {
    super.setCursor(cursor);
  }
}
/**

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

/**
 * Sets the receiver's cursor to the cursor specified by the
 * argument, or to the default cursor for that kind of control
 * if the argument is null.
 * <p>
 * When the mouse pointer passes over a control its appearance
 * is changed to match the control's cursor.
 * </p>
 *
 * @param cursor the new cursor (or null)
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> 
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setCursor (Cursor cursor) {
  checkWidget();
  if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
  this.cursor = cursor;
  if (!isEnabled()) return;
  if (!view.window().areCursorRectsEnabled()) return;
  display.setCursor (display.currentControl);
}

相关文章