java.awt

Class GraphicsConfigTemplate

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

UNKNOWN: updated to 1.4

Field Summary
static intPREFERRED
States that a feature is preferred, but not required, to select a configuration.
static intREQUIRED
States that a feature is required to select a configuration.
static intUNNECESSARY
States that a feature is not necessary in the configuration.
Constructor Summary
GraphicsConfigTemplate()
The default constructor.
Method Summary
abstract GraphicsConfigurationgetBestConfiguration(GraphicsConfiguration[] array)
Returns the "best" match among the array of possible configurations, given the criteria of this template.
abstract booleanisGraphicsConfigSupported(GraphicsConfiguration config)
Returns true if the given configuration supports all the features required by this template.

Field Detail

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.

REQUIRED

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

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.

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