本文整理汇总了Java中org.intellij.lang.annotations.JdkConstants.CursorType方法的典型用法代码示例。如果您正苦于以下问题:Java JdkConstants.CursorType方法的具体用法?Java JdkConstants.CursorType怎么用?Java JdkConstants.CursorType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.intellij.lang.annotations.JdkConstants
的用法示例。
在下文中一共展示了JdkConstants.CursorType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResizeCursor
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
@JdkConstants.CursorType
public static int getResizeCursor(final int resizeMask) {
if (resizeMask == (WEST_MASK | NORTH_MASK)) {
return Cursor.NW_RESIZE_CURSOR;
}
else if (resizeMask == NORTH_MASK) {
return Cursor.N_RESIZE_CURSOR;
}
else if (resizeMask == (EAST_MASK | NORTH_MASK)) {
return Cursor.NE_RESIZE_CURSOR;
}
else if (resizeMask == WEST_MASK) {
return Cursor.W_RESIZE_CURSOR;
}
else if (resizeMask == EAST_MASK) {
return Cursor.E_RESIZE_CURSOR;
}
else if (resizeMask == (WEST_MASK | SOUTH_MASK)) {
return Cursor.SW_RESIZE_CURSOR;
}
else if (resizeMask == SOUTH_MASK) {
return Cursor.S_RESIZE_CURSOR;
}
else if (resizeMask == (EAST_MASK | SOUTH_MASK)) {
return Cursor.SE_RESIZE_CURSOR;
}
else {
throw new IllegalArgumentException("unknown resizeMask: " + resizeMask);
}
}
示例2: setCursor
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public static void setCursor(final Editor view, @JdkConstants.CursorType int type) {
final Cursor cursor = type == Cursor.TEXT_CURSOR && view instanceof EditorEx ?
UIUtil.getTextCursor(((EditorEx)view).getBackgroundColor()) : Cursor.getPredefinedCursor(type);
view.getContentComponent().setCursor(cursor);
}
示例3: getCursorType
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
/**
* @param view the component to move/resize
* @param location the current mouse position on a screen
* @return cursor type for the specified location on the specified view or CUSTOM_CURSOR if cursor type is not supported
*/
@JdkConstants.CursorType
abstract int getCursorType(Component view, Point location);