- java.lang.Object
-
- java.awt.GraphicsConfigTemplate
-
- All Implemented Interfaces:
-
Serializable
public abstract class GraphicsConfigTemplate extends Object implements Serializable
GraphicsConfigTemplate类用于获取有效的GraphicsConfiguration。 用户实例化其中一个对象,然后根据需要设置所有非默认属性。 然后在GraphicsDevice类中找到的GraphicsDevice.getBestConfiguration(java.awt.GraphicsConfigTemplate)方法用这个GraphicsConfigTemplate。 有效GraphicsConfiguration返回满足或超过什么的要求GraphicsConfigTemplate。- 从以下版本开始:
- 1.2
- 另请参见:
-
GraphicsDevice,GraphicsConfiguration, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 描述 static intPREFERRED用于“Enum”(整数)类型的值。static intREQUIRED用于“Enum”(整数)类型的值。static intUNNECESSARY用于“Enum”(整数)类型的值。
-
构造方法摘要
构造方法 Constructor 描述 GraphicsConfigTemplate()这个类是一个抽象类,所以只有子类可以被实例化。
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 abstract GraphicsConfigurationgetBestConfiguration(GraphicsConfiguration[] gc)返回通过GraphicsConfigTemplate定义的标准的“最佳”配置。abstract booleanisGraphicsConfigSupported(GraphicsConfiguration gc)返回一个boolean指示是否可以使用指定的GraphicsConfiguration创建支持指定功能的绘图面。
-
-
-
字段详细信息
-
REQUIRED
public static final int REQUIRED
用于“Enum”(整数)类型的值。 这个功能是GraphicsConfiguration对象需要的。 如果此功能不可用,请勿选择GraphicsConfiguration对象。- 另请参见:
- Constant Field Values
-
PREFERRED
public static final int PREFERRED
用于“Enum”(整数)类型的值。 请确定GraphicsConfiguration对象需要此功能。 使用此功能的选择优先于不包含此功能的选项,尽管这两种选择都可以被认为是有效的匹配。- 另请参见:
- Constant Field Values
-
UNNECESSARY
public static final int UNNECESSARY
用于“Enum”(整数)类型的值。 说明该功能不需要用于选择GraphicsConfiguration对象。 没有此功能的选择优先于包含此功能的选项,因为它不被使用。- 另请参见:
- Constant Field Values
-
-
方法详细信息
-
getBestConfiguration
public abstract GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] gc)
返回通过GraphicsConfigTemplate定义的标准的“最佳”配置。- 参数
-
gc- 可选择的GraphicsConfiguration对象数组。 - 结果
-
一个
GraphicsConfiguration对象是可能的最佳配置。 - 另请参见:
-
GraphicsConfiguration
-
isGraphicsConfigSupported
public abstract boolean isGraphicsConfigSupported(GraphicsConfiguration gc)
返回一个boolean指示是否可以使用指定的GraphicsConfiguration创建支持指定功能的绘图面。- 参数
-
gc-GraphicsConfiguration对象进行测试 - 结果
-
true如果此GraphicsConfiguration对象可用于创建支持指定功能的曲面;false如果GraphicsConfiguration无法用于创建此Java(tm)API可用的绘图表面。
-
-