本文整理匯總了Java中org.eclipse.swt.widgets.Display.getSystemCursor方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.getSystemCursor方法的具體用法?Java Display.getSystemCursor怎麽用?Java Display.getSystemCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Display
的用法示例。
在下文中一共展示了Display.getSystemCursor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: embedCursorToCursor
import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
static Cursor embedCursorToCursor(CursorFrame cursorFrame) {
int id = SWT.CURSOR_ARROW;
switch (cursorFrame.getCursorType()) {
case DEFAULT: id = SWT.CURSOR_ARROW; break;
case CROSSHAIR: id = SWT.CURSOR_CROSS; break;
case TEXT: id = SWT.CURSOR_IBEAM; break;
case WAIT: id = SWT.CURSOR_WAIT; break;
case SW_RESIZE: id = SWT.CURSOR_SIZESW; break;
case SE_RESIZE: id = SWT.CURSOR_SIZESE; break;
case NW_RESIZE: id = SWT.CURSOR_SIZENW; break;
case NE_RESIZE: id = SWT.CURSOR_SIZENE; break;
case N_RESIZE: id = SWT.CURSOR_SIZEN; break;
case S_RESIZE: id = SWT.CURSOR_SIZES; break;
case W_RESIZE: id = SWT.CURSOR_SIZEW; break;
case E_RESIZE: id = SWT.CURSOR_SIZEE; break;
case OPEN_HAND:
case CLOSED_HAND:
case HAND: id = SWT.CURSOR_HAND; break;
case MOVE: id = SWT.CURSOR_SIZEALL; break;
case DISAPPEAR:
// NOTE: Not implemented
break;
case H_RESIZE: id = SWT.CURSOR_SIZEWE; break;
case V_RESIZE: id = SWT.CURSOR_SIZENS; break;
case NONE:
return null;
case IMAGE:
// RT-27939: custom cursors are not implemented
// return createCustomCursor((ImageCursorFrame) cursorFrame);
}
Display display = Display.getCurrent();
return display != null ? display.getSystemCursor(id) : null;
}