org.havi.ui
Class HGraphicsConfigTemplate

java.lang.Object
  extended byorg.havi.ui.HScreenConfigTemplate
      extended byorg.havi.ui.HGraphicsConfigTemplate

public class HGraphicsConfigTemplate
extends HScreenConfigTemplate

The HGraphicsConfigTemplate class is used to obtain a valid HGraphicsConfiguration. An application instantiates one of these objects and then sets all non-default attributes as desired. The HGraphicsDevice.getBestConfiguration(org.havi.ui.HGraphicsConfigTemplate) method found in the HGraphicsDevice class is then called with this HGraphicsConfigTemplate . A valid HGraphicsConfiguration is returned that meets or exceeds what was requested in the HGraphicsConfigTemplate.

This class may be subclassed to support additional properties of graphics configurations which may be requested by applications.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet method
None.

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
None.

See Also:
HScreenConfigTemplate, HBackgroundConfigTemplate, HVideoConfigTemplate

Field Summary
static int IMAGE_SCALING_SUPPORT
          A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support rapid (hardware) image scaling.
static int MATTE_SUPPORT
          A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support the HAVi mattes feature.
static int VIDEO_MIXING
          A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support transparency in the graphics system such that the output of a video decoder is visible.
 
Fields inherited from class org.havi.ui.HScreenConfigTemplate
DONT_CARE, FLICKER_FILTERING, INTERLACED_DISPLAY, PIXEL_ASPECT_RATIO, PIXEL_RESOLUTION, PREFERRED, PREFERRED_NOT, REQUIRED, REQUIRED_NOT, SCREEN_RECTANGLE, VIDEO_GRAPHICS_PIXEL_ALIGNED, ZERO_BACKGROUND_IMPACT, ZERO_GRAPHICS_IMPACT, ZERO_VIDEO_IMPACT
 
Constructor Summary
HGraphicsConfigTemplate()
          Creates an HGraphicsConfigTemplate object.
 
Method Summary
 java.lang.Object getPreferenceObject(int preference)
          Return the preference object for the specified preference.
 int getPreferencePriority(int preference)
          Return the priority for the specified preference.
 boolean isConfigSupported(HGraphicsConfiguration hgc)
          Returns a boolean indicating whether or not the specified HGraphicsConfiguration can be used to create a graphics plane that supports the features set in this template.
 void setPreference(int preference, int priority)
          Set the indicated preference to have the specified priority.
 void setPreference(int preference, java.lang.Object object, int priority)
          Set the indicated preference (and associated value object) to have the specified priority.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIDEO_MIXING

public static final int VIDEO_MIXING
A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support transparency in the graphics system such that the output of a video decoder is visible. This includes the following configurations :-

Applications may specify a particular video configuration with which mixing must be supported. In this case, the video configuration is specified as an HVideoConfiguration object. If no specific video configuration is required then it is not required to specify such a configuration and null can be used.

This preference is used by the platform as a constraint in selecting configurations. Templates generated by the platform and then returned to applications (e.g. from a getConfigTemplate method) shall not have this preference filled in by the platform.

See Also:
Constant Field Values

MATTE_SUPPORT

public static final int MATTE_SUPPORT
A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support the HAVi mattes feature.

See Also:
Constant Field Values

IMAGE_SCALING_SUPPORT

public static final int IMAGE_SCALING_SUPPORT
A value for use in the preference field of the setPreference and getPreferencePriority methods in the HGraphicsConfigTemplate that indicates that the graphics configuration should or shall support rapid (hardware) image scaling.

See Also:
Constant Field Values
Constructor Detail

HGraphicsConfigTemplate

public HGraphicsConfigTemplate()
Creates an HGraphicsConfigTemplate object. See the class description for details of constructor parameters and default values.

Method Detail

isConfigSupported

public boolean isConfigSupported(HGraphicsConfiguration hgc)
Returns a boolean indicating whether or not the specified HGraphicsConfiguration can be used to create a graphics plane that supports the features set in this template.

Parameters:
hgc - - the HGraphicsConfiguration object to test against this template.
Returns:
true if this HGraphicsConfiguration object can be used to create a graphics plane that supports the features set in this template, false otherwise.

setPreference

public void setPreference(int preference,
                          int priority)
Set the indicated preference to have the specified priority. If the preference has been previously set, then the previous priority for the preference shall be overwritten.

Attributes that are not filled in in a template (through HScreenConfigTemplate.setPreference(int, int)), shall have the priority HScreenConfigTemplate.DONT_CARE. Any configuration always satisfies these attributes.

Overrides:
setPreference in class HScreenConfigTemplate
Parameters:
preference - the preference to be indicated. Valid values for an HGraphicsConfigTemplate are: HScreenConfigTemplate.ZERO_BACKGROUND_IMPACT, HScreenConfigTemplate.ZERO_GRAPHICS_IMPACT, HScreenConfigTemplate.ZERO_VIDEO_IMPACT, HScreenConfigTemplate.INTERLACED_DISPLAY, HScreenConfigTemplate.FLICKER_FILTERING, MATTE_SUPPORT and IMAGE_SCALING_SUPPORT.

Subclasses may add further valid values. An IllegalArgumentException shall be thrown if the preference is not a valid value for this instance of HGraphicsConfigTemplate

priority - the priority of the preference. Valid values include: HScreenConfigTemplate.REQUIRED, HScreenConfigTemplate.PREFERRED, HScreenConfigTemplate.DONT_CARE, HScreenConfigTemplate.PREFERRED_NOT and HScreenConfigTemplate.REQUIRED_NOT.

If priority is not a valid priority as defined here a java.lang.IllegalArgumentException will be thrown.


getPreferencePriority

public int getPreferencePriority(int preference)
Return the priority for the specified preference.

By default the preferences in a template returned from the system will have a HScreenConfigTemplate.DONT_CARE priority unless specified otherwise. Any configuration always satisfies these attributes.

Overrides:
getPreferencePriority in class HScreenConfigTemplate
Parameters:
preference - the preference to be indicated. Valid values for an HGraphicsConfigTemplate are: HScreenConfigTemplate.ZERO_BACKGROUND_IMPACT, HScreenConfigTemplate.ZERO_GRAPHICS_IMPACT, HScreenConfigTemplate.ZERO_VIDEO_IMPACT, HScreenConfigTemplate.INTERLACED_DISPLAY, HScreenConfigTemplate.FLICKER_FILTERING, HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED, HScreenConfigTemplate.PIXEL_ASPECT_RATIO, HScreenConfigTemplate.PIXEL_RESOLUTION, HScreenConfigTemplate.SCREEN_RECTANGLE, VIDEO_MIXING, MATTE_SUPPORT and IMAGE_SCALING_SUPPORT.

Subclasses may add further valid values. An IllegalArgumentException shall be thrown if the preference is not a valid value for this instance of HGraphicsConfigTemplate

Returns:
the priority for the specified preference.

setPreference

public void setPreference(int preference,
                          java.lang.Object object,
                          int priority)
Set the indicated preference (and associated value object) to have the specified priority. If the preference has been previously set, then the previous object and priority shall be overwritten.

Attributes that are not filled in in a template (through setPreference(int, int)), shall have the priority HScreenConfigTemplate.DONT_CARE. Any configuration always satisfies these attributes.

An application which wishes to remove a preference from an existing template (e.g. one generated by the platform) may call this method with null for the object parameter. Calling this method with null for the object parameter shall have no effect if the preference is not currently set in the template.

Overrides:
setPreference in class HScreenConfigTemplate
Parameters:
preference - the preference to be indicated. Valid values for an HScreenConfigTemplate are: HScreenConfigTemplate.PIXEL_ASPECT_RATIO, HScreenConfigTemplate.PIXEL_RESOLUTION, HScreenConfigTemplate.SCREEN_RECTANGLE, HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED and VIDEO_MIXING.

Subclasses may add further valid values. An IllegalArgumentException shall be thrown if the preference is not a valid value for this instance of HScreenConfigTemplate

object - the Object associated with the given preference, or null.
priority - the priority of the preference. Valid values include: HScreenConfigTemplate.REQUIRED, HScreenConfigTemplate.PREFERRED, HScreenConfigTemplate.DONT_CARE, HScreenConfigTemplate.PREFERRED_NOT and HScreenConfigTemplate.REQUIRED_NOT.

If priority is not a valid priority as defined here a java.lang.IllegalArgumentException will be thrown.


getPreferenceObject

public java.lang.Object getPreferenceObject(int preference)
Return the preference object for the specified preference.

Instances of HGraphicsConfigTemplate which have not had this preference set shall return null for this object. Note that instances constructed by the platform and returned to applications are required to have all preferences (except where explicitly identified) set by the platform before it is returned.

Overrides:
getPreferenceObject in class HScreenConfigTemplate
Parameters:
preference - the preference to be indicated. Valid values for an HGraphicsConfigTemplate are: HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED, HScreenConfigTemplate.PIXEL_ASPECT_RATIO, HScreenConfigTemplate.PIXEL_RESOLUTION, HScreenConfigTemplate.SCREEN_RECTANGLE, and VIDEO_MIXING.

Subclasses may add further valid values. A IllegalArgumentException shall be thrown if the preference is not a valid value for this instance of HGraphicsConfigTemplate, or if preference does not have an associated value object.

Returns:
the preference object for the specified preference.