org.havi.ui
Class HBackgroundConfiguration

java.lang.Object
  extended by org.havi.ui.HScreenConfiguration
      extended by org.havi.ui.HBackgroundConfiguration
Direct Known Subclasses:
HStillImageBackgroundConfiguration

public class HBackgroundConfiguration
extends HScreenConfiguration

The HBackgroundConfiguration class describes the characteristics (settings) of an HBackgroundDevice. There can be many HBackgroundConfiguration objects associated with a single HBackgroundDevice .

The basic background configuration supports backgrounds of a single color. More sophisticated backgrounds can be supported by defining new classes inheriting from this class. Where a device has a single non- changeable background color, this class will provide applications the ability to read that color however all attempts to reserve control of the background will fail.


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:
HBackgroundDevice

Method Summary
 java.awt.Color getColor()
          Obtain the current color of this background.
 HBackgroundConfigTemplate getConfigTemplate()
          Returns an HBackgroundConfigTemplate object that describes and uniquely identifies this HBackgroundConfiguration.
 HBackgroundDevice getDevice()
          Returns the HBackgroundDevice associated with this HBackgroundConfiguration.
 void setColor(java.awt.Color color)
          Set the current color of this background.
 
Methods inherited from class org.havi.ui.HScreenConfiguration
convertTo, getFlickerFilter, getInterlaced, getOffset, getPixelAspectRatio, getPixelResolution, getScreenArea
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDevice

public HBackgroundDevice getDevice()
Returns the HBackgroundDevice associated with this HBackgroundConfiguration.

Returns:
the HBackgroundDevice object that is associated with this HBackgroundConfiguration.

getConfigTemplate

public HBackgroundConfigTemplate getConfigTemplate()
Returns an HBackgroundConfigTemplate object that describes and uniquely identifies this HBackgroundConfiguration. Hence, the following sequence should return the original HBackgroundConfiguration
 HBackgroundDevice.getBestMatch(HBackgroundConfiguration.getConfigTemplate())
 

Features that are implemented in the HBackgroundConfiguration will return HScreenConfigTemplate.REQUIRED priority. Features that are not implemented in the HBackgroundConfiguration will return HScreenConfigTemplate.REQUIRED_NOT priority. Preferences that are not filled in by the platform will return HScreenConfigTemplate.DONT_CARE priority.

Returns:
an HBackgroundConfigTemplate object which both describes and uniquely identifies this HBackgroundConfiguration.

getColor

public java.awt.Color getColor()
Obtain the current color of this background. This method may be called without ownership of the resource. The value returned is not guaranteed to be the value set in the last call to setColor(java.awt.Color) since platforms may offer a reduced color space for backgrounds and the actual value used will be returned.

Returns:
the current Color

setColor

public void setColor(java.awt.Color color)
              throws HPermissionDeniedException,
                     HConfigurationException
Set the current color of this background. On platforms where there is a sub-class of java.awt.Color supporting transparency of any kind, passing an object representing a non-opaque color is illegal. Platforms with a limited color resolution for backgrounds may approximate this value to the nearest available. The getColor() method will return the actual value used.

Parameters:
color - the color to be used for the background
Throws:
HPermissionDeniedException - if the application has not currently reserved the HBackgroundDevice associated with this configuration or this configuration is not the current configuration of that HBackgroundDevice.
HConfigurationException - if the color specified is illegal for this platform.