模块 java.desktop
 java.awt

类 GraphicsConfigTemplate

java.lang.Object
java.awt.GraphicsConfigTemplate
所有已实现的接口:
Serializable

public abstract class GraphicsConfigTemplate extends Object implements Serializable
GraphicsConfigTemplate 类用于获取有效的 GraphicsConfiguration 。用户实例化这些对象之一,然后根据需要设置所有非默认属性。然后使用此 GraphicsConfigTemplate 调用 GraphicsDevice 类中的 GraphicsDevice.getBestConfiguration(java.awt.GraphicsConfigTemplate) 方法。返回的有效 GraphicsConfiguration 满足或超过 GraphicsConfigTemplate 中的请求。
自从:
1.2
参见:
  • 字段详细信息

    • REQUIRED

      public static final int REQUIRED
      用于“枚举”(整数)类型的值。声明 GraphicsConfiguration 对象需要此功能。如果此功能不可用,请不要选择 GraphicsConfiguration 对象。
      参见:
    • PREFERRED

      public static final int PREFERRED
      用于“枚举”(整数)类型的值。声明 GraphicsConfiguration 对象需要此功能。具有此特征的选择优于不包含此特征的选择,尽管两种选择都可被视为有效匹配。
      参见:
    • UNNECESSARY

      public static final int UNNECESSARY
      用于“枚举”(整数)类型的值。声明此功能对于选择 GraphicsConfiguration 对象不是必需的。没有此功能的选择优于包含此功能的选择,因为它未被使用。
      参见:
  • 构造方法详细信息

    • GraphicsConfigTemplate

      public GraphicsConfigTemplate()
      这个类是一个抽象类,所以只能实例化子类。
  • 方法详情

    • getBestConfiguration

      public abstract GraphicsConfiguration  getBestConfiguration(GraphicsConfiguration [] gc)
      返回可能通过 GraphicsConfigTemplate 中定义的标准的“最佳”配置。
      参数:
      gc - 可供选择的 GraphicsConfiguration 对象数组。
      返回:
      一个 GraphicsConfiguration 对象,它是可能的最佳配置。
      参见:
    • isGraphicsConfigSupported

      public abstract boolean isGraphicsConfigSupported(GraphicsConfiguration  gc)
      返回一个 boolean 指示指定的 GraphicsConfiguration 是否可用于创建支持指定功能的绘图表面。
      参数:
      gc - 要测试的 GraphicsConfiguration 对象
      返回:
      true 如果此 GraphicsConfiguration 对象可用于创建支持指定特征的表面; false 如果 GraphicsConfiguration 不能用于创建此 Java(tm) API 可用的绘图表面。