本文整理匯總了Java中java.awt.Cursor.MOVE_CURSOR屬性的典型用法代碼示例。如果您正苦於以下問題:Java Cursor.MOVE_CURSOR屬性的具體用法?Java Cursor.MOVE_CURSOR怎麽用?Java Cursor.MOVE_CURSOR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.Cursor
的用法示例。
在下文中一共展示了Cursor.MOVE_CURSOR屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setCursor
static void setCursor(int c, Object display) {
Container d = (Container) display;
switch (c) {
case JmolConstants.CURSOR_HAND:
c = Cursor.HAND_CURSOR;
break;
case JmolConstants.CURSOR_MOVE:
c = Cursor.MOVE_CURSOR;
break;
case JmolConstants.CURSOR_ZOOM:
c = Cursor.N_RESIZE_CURSOR;
break;
case JmolConstants.CURSOR_CROSSHAIR:
c = Cursor.CROSSHAIR_CURSOR;
break;
case JmolConstants.CURSOR_WAIT:
c = Cursor.WAIT_CURSOR;
break;
default:
d.setCursor(Cursor.getDefaultCursor());
return;
}
d.setCursor(Cursor.getPredefinedCursor(c));
}
示例2: mouseMoved
public void mouseMoved(Point point) {
synchronized (mouseLock) {
if (mousePressedPosition != null)
mouseDragPosition = point;
Bounds bounds = getSelected(point);
int cursorType;
if (bounds == null)
cursorType = Cursor.DEFAULT_CURSOR;
else {
cursorType = Cursor.MOVE_CURSOR;
}
if (selection.getBounds().length == 1) {
boolean resizableX = selection.isResizeableX(diagram);
boolean resizableY = selection.isResizeableY(diagram);
if ((resizableX) && (isRightMove(point)))
cursorType = Cursor.E_RESIZE_CURSOR;
else if ((resizableX) && (isLeftMove(point)))
cursorType = Cursor.W_RESIZE_CURSOR;
else if ((resizableY) && (isTopMove(point)))
cursorType = Cursor.N_RESIZE_CURSOR;
else if ((resizableY) && (isBottomMove(point)))
cursorType = Cursor.S_RESIZE_CURSOR;
else if ((resizableY) && (resizableX)
&& (isRightBottomMove(point)))
cursorType = Cursor.SE_RESIZE_CURSOR;
else if ((resizableY) && (resizableX)
&& (isLeftBottomMove(point)))
cursorType = Cursor.SW_RESIZE_CURSOR;
else if ((resizableY) && (resizableX)
&& (isTopRightMove(point)))
cursorType = Cursor.NE_RESIZE_CURSOR;
else if ((resizableY) && (resizableX) && (isTopLeftMove(point)))
cursorType = Cursor.NW_RESIZE_CURSOR;
}
if (this.cursorType != cursorType) {
this.cursorType = cursorType;
this.setCursor(new Cursor(cursorType));
}
}
repaint();
}
示例3: getObject
protected Cursor getObject() {
return new Cursor(Cursor.MOVE_CURSOR);
}