JavaTM 2 Platform
Standard Ed. 6

java.awt
类 Cursor

java.lang.Object
  继承者 java.awt.Cursor
所有已实现的接口:
Serializable

public class Cursor
extends Object
implements Serializable

封装鼠标光标的位图表示形式的类。

另请参见:
Component.setCursor(java.awt.Cursor), 序列化表格

字段摘要
static int CROSSHAIR_CURSOR
          十字光标类型。
static int CUSTOM_CURSOR
          与所有定制光标有关的类型。
static int DEFAULT_CURSOR
          默认光标类型(如果没有定义光标,则获取该设置)。
static int E_RESIZE_CURSOR
          调整窗口右边框大小的光标类型。
static int HAND_CURSOR
          手状光标类型。
static int MOVE_CURSOR
          移动光标类型。
static int N_RESIZE_CURSOR
          调整窗口上边框大小的光标类型。
protected  String name
          光标的用户可视名称。
static int NE_RESIZE_CURSOR
          调整窗口右上角大小的光标类型。
static int NW_RESIZE_CURSOR
          调整窗口左上角大小的光标类型。
protected static Cursor[] predefined
           
static int S_RESIZE_CURSOR
          调整窗口下边框大小的光标类型。
static int SE_RESIZE_CURSOR
          调整窗口右下角大小的光标类型。
static int SW_RESIZE_CURSOR
          调整窗口左下角大小的光标类型。
static int TEXT_CURSOR
          文字光标类型。
static int W_RESIZE_CURSOR
          调整窗口左边框大小的光标类型。
static int WAIT_CURSOR
          等待光标类型。
 
构造方法摘要
  Cursor(int type)
          用指定类型创建一个新的光标对象。
protected Cursor(String name)
          用指定名称创建一个新的定制光标对象。
 
方法摘要
static Cursor getDefaultCursor()
          返回系统默认光标。
 String getName()
          返回此光标的名称。
static Cursor getPredefinedCursor(int type)
          返回一个具有指定预定义类型的光标对象。
static Cursor getSystemCustomCursor(String name)
          返回与指定名称匹配的特定于系统的定制光标对象。
 int getType()
          返回此光标的类型。
 String toString()
          返回此光标的字符串表示形式。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

DEFAULT_CURSOR

public static final int DEFAULT_CURSOR
默认光标类型(如果没有定义光标,则获取该设置)。

另请参见:
常量字段值

CROSSHAIR_CURSOR

public static final int CROSSHAIR_CURSOR
十字光标类型。

另请参见:
常量字段值

TEXT_CURSOR

public static final int TEXT_CURSOR
文字光标类型。

另请参见:
常量字段值

WAIT_CURSOR

public static final int WAIT_CURSOR
等待光标类型。

另请参见:
常量字段值

SW_RESIZE_CURSOR

public static final int SW_RESIZE_CURSOR
调整窗口左下角大小的光标类型。

另请参见:
常量字段值

SE_RESIZE_CURSOR

public static final int SE_RESIZE_CURSOR
调整窗口右下角大小的光标类型。

另请参见:
常量字段值

NW_RESIZE_CURSOR

public static final int NW_RESIZE_CURSOR
调整窗口左上角大小的光标类型。

另请参见:
常量字段值

NE_RESIZE_CURSOR

public static final int NE_RESIZE_CURSOR
调整窗口右上角大小的光标类型。

另请参见:
常量字段值

N_RESIZE_CURSOR

public static final int N_RESIZE_CURSOR
调整窗口上边框大小的光标类型。

另请参见:
常量字段值

S_RESIZE_CURSOR

public static final int S_RESIZE_CURSOR
调整窗口下边框大小的光标类型。

另请参见:
常量字段值

W_RESIZE_CURSOR

public static final int W_RESIZE_CURSOR
调整窗口左边框大小的光标类型。

另请参见:
常量字段值

E_RESIZE_CURSOR

public static final int E_RESIZE_CURSOR
调整窗口右边框大小的光标类型。

另请参见:
常量字段值

HAND_CURSOR

public static final int HAND_CURSOR
手状光标类型。

另请参见:
常量字段值

MOVE_CURSOR

public static final int MOVE_CURSOR
移动光标类型。

另请参见:
常量字段值

predefined

protected static Cursor[] predefined

CUSTOM_CURSOR

public static final int CUSTOM_CURSOR
与所有定制光标有关的类型。

另请参见:
常量字段值

name

protected String name
光标的用户可视名称。

另请参见:
getName()
构造方法详细信息

Cursor

public Cursor(int type)
用指定类型创建一个新的光标对象。

参数:
type - 光标的类型
抛出:
IllegalArgumentException - 如果指定的光标类型无效

Cursor

protected Cursor(String name)
用指定名称创建一个新的定制光标对象。

注:此构造方法应该只由 AWT 实现使用,用作它们支持定制光标的一部分。应用程序应该使用 Toolkit.createCustomCursor()。

参数:
name - 光标的用户可视名称。
另请参见:
Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String)
方法详细信息

getPredefinedCursor

public static Cursor getPredefinedCursor(int type)
返回一个具有指定预定义类型的光标对象。

参数:
type - 指定光标的类型
返回:
指定的预定义光标
抛出:
IllegalArgumentException - 如果指定的光标类型无效

getSystemCustomCursor

public static Cursor getSystemCustomCursor(String name)
                                    throws AWTException,
                                           HeadlessException
返回与指定名称匹配的特定于系统的定制光标对象。例如,光标名称为:"Invalid.16x16"

参数:
name - 描述所需的特定于系统的定制光标的字符串
返回:
与指定名称匹配的特定于系统的定制光标
抛出:
HeadlessException - 如果 GraphicsEnvironment.isHeadless 返回 true
AWTException

getDefaultCursor

public static Cursor getDefaultCursor()
返回系统默认光标。


getType

public int getType()
返回此光标的类型。


getName

public String getName()
返回此光标的名称。

返回:
此光标的本地化描述。
从以下版本开始:
1.2

toString

public String toString()
返回此光标的字符串表示形式。

覆盖:
Object 中的 toString
返回:
此光标的字符串表示形式。
从以下版本开始:
1.2

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only