|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.havi.ui.HSceneTemplate
The HSceneTemplate
class is used
to obtain an HScene
subject to a variety
of constraints.
The following constraints are supported:
Preference | Object |
---|---|
GRAPHICS_CONFIGURATION | HGraphicsConfiguration |
SCENE_PIXEL_LOCATION | java.awt.Point |
SCENE_PIXEL_DIMENSION | java.awt.Dimension |
SCENE_SCREEN_LOCATION | HScreenPoint |
SCENE_SCREEN_DIMENSION | HScreenDimension |
Note that as defined here users must set both a location and a
dimension preference to request a given rectangle area. Instances
of HSceneTemplate
returned by
the system will always be fully specified. Therefore, if an
application only sets a preference on SCENE_SCREEN_LOCATION
the system will fill in SCENE_SCREEN_DIMENSION
, SCENE_PIXEL_LOCATION
and SCENE_PIXEL_DIMENSION
with default values based on the appropriate
HGraphicsConfiguration
and its associated HGraphicsDevice
.
In the event of a conflict between REQUIRED
preferences specified
in pixel coordinates (SCENE_PIXEL_LOCATION
, SCENE_PIXEL_DIMENSION
) and normalized screen coordinates (SCENE_SCREEN_LOCATION
, SCENE_SCREEN_DIMENSION
) the system shall ignore the pixel
coordinates and use only the screen coordinate preferences.
Parameter | Description | Default value | Set method | Get method |
---|---|---|---|---|
None. |
Description | Default value | Set method | Get method |
---|---|---|---|
None. |
HSceneFactory
Field Summary | |
static int |
GRAPHICS_CONFIGURATION
A value for use in the preference field of the setPreference , getPreferenceObject and getPreferencePriority methods in the HSceneTemplate that indicates that
the HScene be created with a
specified HGraphicsConfiguration (corresponding to a particular HGraphicsDevice ).
|
static java.awt.Dimension |
LARGEST_PIXEL_DIMENSION
A Dimension object for use in the object field of the setPreference and
getPreferenceObject methods in the HSceneTemplate that indicates that
the SCENE_PIXEL_DIMENSION feature should be set to its
largest possible dimension. |
static int |
PREFERRED
A value for use in the priority field of the setPreference and
getPreferencePriority methods in the HSceneTemplate that indicates that
this feature is preferred over a selection that does not
include this feature, although both selections can be
considered valid. |
static int |
REQUIRED
A value for use in the priority field of the setPreference and
getPreferencePriority methods in the HSceneTemplate that indicates that
this feature is required in the HScene . |
static int |
SCENE_PIXEL_DIMENSION
A value for use in the preference field of the setPreference , getPreferenceObject and getPreferencePriority methods in the HSceneTemplate that indicates that
the HScene be created with
preferred dimensions in pixels as given by a Dimension
object. |
static int |
SCENE_PIXEL_LOCATION
A value for use in the preference field of the setPreference , getPreferenceObject and getPreferencePriority methods in the HSceneTemplate that indicates that
the HScene be created with a
preferred location in pixels as given by a Point
object. |
static int |
SCENE_SCREEN_DIMENSION
A value for use in the preference field of the setPreference , getPreferenceObject and getPreferencePriority methods in the HSceneTemplate that indicates that
the HScene be created with
preferred dimensions in normalized screen coordinates as given
by an HScreenDimension
object. |
static int |
SCENE_SCREEN_LOCATION
A value for use in the preference field of the setPreference , getPreferenceObject and getPreferencePriority methods in the HSceneTemplate that indicates that
the HScene be created with a
preferred location in normalized screen coordinates, as given
by an HScreenPoint object. |
static int |
UNNECESSARY
A value for use in the priority field of the setPreference and
getPreferencePriority methods in the HSceneTemplate that indicates that
this feature is unnecessary in the HScene . |
Constructor Summary | |
HSceneTemplate()
Creates a new HSceneTemplate 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. |
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 |
public static final int REQUIRED
setPreference
and
getPreferencePriority
methods in the HSceneTemplate
that indicates that
this feature is required in the HScene
. If this feature is not available, do not create an
HScene
object.
public static final int PREFERRED
setPreference
and
getPreferencePriority
methods in the HSceneTemplate
that indicates that
this feature is preferred over a selection that does not
include this feature, although both selections can be
considered valid.
public static final int UNNECESSARY
setPreference
and
getPreferencePriority
methods in the HSceneTemplate
that indicates that
this feature is unnecessary in the HScene
. A selection without this feature is preferred over a
selection that includes this feature since it is not used.
public static final java.awt.Dimension LARGEST_PIXEL_DIMENSION
setPreference
and
getPreferenceObject
methods in the HSceneTemplate
that indicates that
the SCENE_PIXEL_DIMENSION feature should be set to its
largest possible dimension.
public static final int GRAPHICS_CONFIGURATION
setPreference
, getPreferenceObject
and getPreferencePriority
methods in the HSceneTemplate
that indicates that
the HScene
be created with a
specified HGraphicsConfiguration
(corresponding to a particular HGraphicsDevice
).
By default the HSceneTemplate
creates HScenes
on
the default HScreen's
default
HGraphicsDevice
with its
current HGraphicsConfiguration
.
public static final int SCENE_PIXEL_DIMENSION
setPreference
, getPreferenceObject
and getPreferencePriority
methods in the HSceneTemplate
that indicates that
the HScene
be created with
preferred dimensions in pixels as given by a Dimension
object. If the Dimension object is LARGEST_PIXEL_DIMENSION then the
returned HScene
should have the
largest possible dimensions.
public static final int SCENE_PIXEL_LOCATION
setPreference
, getPreferenceObject
and getPreferencePriority
methods in the HSceneTemplate
that indicates that
the HScene
be created with a
preferred location in pixels as given by a Point
object. The graphics pixels shall correspond to the pixel
setting for the HGraphicsDevice
settings as indicated by the HGraphicsConfiguration
as
specified in the HSceneTemplate
(or its default value).
public static final int SCENE_SCREEN_DIMENSION
setPreference
, getPreferenceObject
and getPreferencePriority
methods in the HSceneTemplate
that indicates that
the HScene
be created with
preferred dimensions in normalized screen coordinates as given
by an HScreenDimension
object.
public static final int SCENE_SCREEN_LOCATION
setPreference
, getPreferenceObject
and getPreferencePriority
methods in the HSceneTemplate
that indicates that
the HScene
be created with a
preferred location in normalized screen coordinates, as given
by an HScreenPoint
object.
Constructor Detail |
public HSceneTemplate()
HSceneTemplate
object.
See the
class description for details of constructor parameters and
default values.
Method Detail |
public void setPreference(int preference, java.lang.Object object, int priority)
By default, the preferences should have an UNNECESSARY
priority.
preference
- the preference to be indicated. Valid values
are:
GRAPHICS_CONFIGURATION
,
SCENE_PIXEL_LOCATION
,
SCENE_PIXEL_RESOLUTION
,
SCENE_PIXEL_LOCATION
and
SCENE_SCREEN_RECTANGLE
.
An IllegalArgumentException shall be thrown if the preference is not a valid value as listed above.
object
- the Object associated with the given preference.
An IllegalArgumentException shall be thrown if the object is not valid for the preference as specified in the class description.
priority
- the priority of the preference. Valid values
are: REQUIRED
,
PREFERRED
and
UNNECESSARY
.
If priority
is not a valid priority as defined here a
java.lang.IllegalArgumentException will be thrown.
public java.lang.Object getPreferenceObject(int preference)
preference
- the preference to be indicated.
HGraphicsConfiguration
object which is returned for the GRAPHICS_CONFIGURATION
preference.
SCENE_PIXEL_LOCATION
preference.
SCENE_PIXEL_DIMENSION
preference.
HScreenPoint
object
which is returned for the SCENE_SCREEN_LOCATION
preference.
HScreenDimension
object which is returned for the SCENE_SCREEN_DIMENSION
preference.
public int getPreferencePriority(int preference)
preference
- the preference to be indicated. Valid values
are:
GRAPHICS_CONFIGURATION
,
SCENE_PIXEL_LOCATION
,
SCENE_PIXEL_RESOLUTION
,
SCENE_PIXEL_LOCATION
and
SCENE_SCREEN_RECTANGLE
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |