下面列出了java.awt.Cursor#getName ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}
@Override
protected void setCursor(final Cursor cursor) {
if (cursor == currentCursor) {
return;
}
currentCursor = cursor;
if (cursor == null) {
nativeSetBuiltInCursor(Cursor.DEFAULT_CURSOR, null);
return;
}
if (cursor instanceof CCustomCursor) {
final CCustomCursor customCursor = (CCustomCursor) cursor;
final long imagePtr = customCursor.getImageData();
if (imagePtr != 0L) {
final Point hotSpot = customCursor.getHotSpot();
nativeSetCustomCursor(imagePtr, hotSpot.x, hotSpot.y);
}
return;
}
final int type = cursor.getType();
if (type != Cursor.CUSTOM_CURSOR) {
nativeSetBuiltInCursor(type, null);
return;
}
final String name = cursor.getName();
if (name != null) {
nativeSetBuiltInCursor(NAMED_CURSOR, name);
return;
}
// do something special
throw new RuntimeException("Unimplemented");
}