java.awt
Class GraphicsConfigTemplate

java.lang.Object
  extended by java.awt.GraphicsConfigTemplate
All Implemented Interfaces:
Serializable

public abstract class GraphicsConfigTemplate
extends Object
implements Serializable

This allows filtering an array of GraphicsConfigurations for the best one based on various requirements. The resulting configuration has had all non-default attributes set as required to meet or exceed the request.

Since:
1.2
See Also:
GraphicsConfiguration, GraphicsDevice, Serialized Form

Field Summary
static int PREFERRED
          States that a feature is preferred, but not required, to select a configuration.
static int REQUIRED
          States that a feature is required to select a configuration.
static int UNNECESSARY
          States that a feature is not necessary in the configuration.
 
Constructor Summary
GraphicsConfigTemplate()
          The default constructor.
 
Method Summary
abstract  GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] array)
          Returns the "best" match among the array of possible configurations, given the criteria of this template.
abstract  boolean isGraphicsConfigSupported(GraphicsConfiguration config)
          Returns true if the given configuration supports all the features required by this template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUIRED

public static final int REQUIRED
States that a feature is required to select a configuration.

See Also:
Constant Field Values

PREFERRED

public static final int PREFERRED
States that a feature is preferred, but not required, to select a configuration. In the case of multiple valid configurations, the tie breaks in favor of the one with the feature.

See Also:
Constant Field Values

UNNECESSARY

public static final int UNNECESSARY
States that a feature is not necessary in the configuration. In the case of multiple valid configurations, the tie breaks in favor of the one without the feature, to reduce overhead.

See Also:
Constant Field Values
Constructor Detail

GraphicsConfigTemplate

public GraphicsConfigTemplate()
The default constructor.

Method Detail

getBestConfiguration

public abstract GraphicsConfiguration getBestConfiguration(GraphicsConfiguration[] array)
Returns the "best" match among the array of possible configurations, given the criteria of this template.

Parameters:
array - the array to choose from
Returns:
the best match
Throws:
NullPointerException - if array is null

isGraphicsConfigSupported

public abstract boolean isGraphicsConfigSupported(GraphicsConfiguration config)
Returns true if the given configuration supports all the features required by this template.

Parameters:
config - the configuration to test
Returns:
true if it is a match
Throws:
NullPointerException - if config is null