本文整理汇总了Java中org.eclipse.swt.SWT.CURSOR_HAND属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.CURSOR_HAND属性的具体用法?Java SWT.CURSOR_HAND怎么用?Java SWT.CURSOR_HAND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.CURSOR_HAND属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHandCursorListener
protected static Listener getHandCursorListener(Display display) {
if (handCursorListener == null) {
handCursor = new Cursor(display, SWT.CURSOR_HAND);
handCursorListener = new Listener() {
@Override
public void handleEvent(Event event) {
if (event.type == SWT.MouseEnter) {
((Control) event.widget).setCursor(handCursor);
}
if (event.type == SWT.MouseExit) {
((Control) event.widget).setCursor(null);
}
}
};
}
return handCursorListener;
}
示例2: embedCursorToCursor
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;
}