Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class GraphicsConfigTemplate

java.lang.Object
|
+--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:Author:See Also:

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

java.awt.GraphicsConfigurationgetBestConfiguration(java.awt.GraphicsConfiguration array)

Returns the "best" match among the array of possible configurations, given the criteria of this template.
booleanisGraphicsConfigSupported(java.awt.GraphicsConfiguration config)

Returns true if the given configuration supports all the features required by this template.

Field Details

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 Details

GraphicsConfigTemplate

public GraphicsConfigTemplate()

The default constructor.


Method Details

getBestConfiguration

public GraphicsConfiguration getBestConfiguration(java.awt.GraphicsConfiguration array)

Returns the "best" match among the array of possible configurations, given the criteria of this template.

Parameters:

Returns:

Throws:


isGraphicsConfigSupported

public boolean isGraphicsConfigSupported(java.awt.GraphicsConfiguration config)

Returns true if the given configuration supports all the features required by this template.

Parameters:

Returns:

Throws: