org.havi.ui
Class HVideoConfigTemplate

java.lang.Object
  extended by org.havi.ui.HScreenConfigTemplate
      extended by org.havi.ui.HVideoConfigTemplate

public class HVideoConfigTemplate
extends HScreenConfigTemplate

The HVideoConfigTemplate class is used to obtain a valid HVideoConfiguration. An application instantiates one of these objects and then sets all non-default attributes as desired. The object is then passed to the HVideoDevice.getBestConfiguration(org.havi.ui.HVideoConfigTemplate) method found in the HVideoDevice class. If possible, a valid HVideoConfiguration is returned which meets or exceeds the requirements set in the HVideoConfigTemplate.

This class may be subclassed to support additional properties of video 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, HGraphicsConfigTemplate

Field Summary
static int GRAPHICS_MIXING
          A value for use in the preference field of the setPreference and getPreferencePriority methods in the HVideoConfigTemplate that indicates that the device configuration supports the display of graphics in addition to video streams.
 
Fields inherited from class org.havi.ui.HScreenConfigTemplate
DISABLED, DONT_CARE, FLICKER_FILTERING, INTERLACED_DISPLAY, PIXEL_ASPECT_RATIO, PIXEL_RESOLUTION, PREFERRED, PREFERRED_NOT, REQUIRED, REQUIRED_NOT, SCREEN_ASPECT_RATIO, SCREEN_RECTANGLE, VIDEO_GRAPHICS_PIXEL_ALIGNED, ZERO_BACKGROUND_IMPACT, ZERO_GRAPHICS_IMPACT, ZERO_VIDEO_IMPACT
 
Constructor Summary
HVideoConfigTemplate()
          Creates an HVideoConfigTemplate 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(HVideoConfiguration hvc)
          Returns a boolean indicating whether or not the specified HVideoConfiguration can be used to create a video plane that supports the features set in this template.
 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 org.havi.ui.HScreenConfigTemplate
setPreference
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAPHICS_MIXING

public static final int GRAPHICS_MIXING
A value for use in the preference field of the setPreference and getPreferencePriority methods in the HVideoConfigTemplate that indicates that the device configuration supports the display of graphics in addition to video streams. This display includes both configurations where the video pixels and graphics pixels are fully aligned (same size) as well as configurations where they are displayed together but where a more complex relationship exists between the two pixel coordinate spaces. The graphics configuration for mixing is specified as an HGraphicsConfiguration.

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
Constructor Detail

HVideoConfigTemplate

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

Method Detail

isConfigSupported

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

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

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 HVideoConfigTemplate 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 and GRAPHICS_MIXING.

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

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, java.lang.Object, 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. Specifying null as the object parameter shall have no effect if the preference is not 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 GRAPHICS_MIXING.

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

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 HVideoConfigTemplate 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 HVideoConfigTemplate are: HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED, HScreenConfigTemplate.PIXEL_ASPECT_RATIO, HScreenConfigTemplate.PIXEL_RESOLUTION, HScreenConfigTemplate.SCREEN_RECTANGLE, and GRAPHICS_MIXING.

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

Returns:
the preference object for the specified preference.