本文整理汇总了Java中com.google.gwt.dom.client.Style.Cursor.NW_RESIZE属性的典型用法代码示例。如果您正苦于以下问题:Java Cursor.NW_RESIZE属性的具体用法?Java Cursor.NW_RESIZE怎么用?Java Cursor.NW_RESIZE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.dom.client.Style.Cursor
的用法示例。
在下文中一共展示了Cursor.NW_RESIZE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cursor
private Cursor cursor(double x, double y) {
if (x <= 6) {
if (y <= 6)
return Cursor.NW_RESIZE;
else if (y >= getHeight() - 6)
return Cursor.SW_RESIZE;
else
return Cursor.W_RESIZE;
} else if (x >= getWidth() - 6) {
if (y <= 6)
return Cursor.NE_RESIZE;
else if (y >= getHeight() - 6)
return Cursor.SE_RESIZE;
else
return Cursor.E_RESIZE;
} else if (y <= 6) {
return Cursor.N_RESIZE;
} else if (y >= getHeight() - 6) {
return Cursor.S_RESIZE;
} else {
return Cursor.MOVE;
}
}
示例2: updateCursor
/**
* Static helper method to change the cursor for a given element when resizing is enabled.
*
* @param dm The code describing the position of the element in question
* @param element The {@link com.google.gwt.dom.client.Element} to set the cursor on
*/
protected static void updateCursor(int dm, com.google.gwt.dom.client.Element element) {
Cursor cursor;
switch (dm) {
case 0:
cursor = Cursor.NW_RESIZE;
break;
case 1:
cursor = Cursor.N_RESIZE;
break;
case 2:
cursor = Cursor.NE_RESIZE;
break;
case 3:
cursor = Cursor.W_RESIZE;
break;
case 5:
cursor = Cursor.E_RESIZE;
break;
case 6:
cursor = Cursor.SW_RESIZE;
break;
case 7:
cursor = Cursor.S_RESIZE;
break;
case 8:
cursor = Cursor.SE_RESIZE;
break;
default:
cursor = Cursor.AUTO;
break;
}
element.getStyle().setCursor(cursor);
}