public class HSceneFactory extends Object
HSceneFactory class provides
a generic mechanism for an application to request HScene resources from a (conceptual) window
management system. The HSceneFactory is the single entry to potentially multiple
HGraphicsDevice centric window management policies.
The HSceneFactory class provides
an opaque interface between any application (or window) management
scheme and the Java application, itself.
Note that only one HScene per HGraphicsDevice can be acquired at any
one time for each application.
HScenes follow the design pattern of the
java.awt.Window class. They are not a scarce resource
on the platform. On platforms which only support one HScene being visible at one time the current
HScene both loses the input focus and is
hidden (e.g. iconified) when another application successfully
requests the input focus. Two
java.awt.event.WindowEvent events, with ids
WINDOW_DEACTIVATED and WINDOW_ICONIFIED,
shall be generated and sent to the HScene which has lost the focus and the isShowing method for that HScene
shall return false.
The constraints on the sizing and positioning of the HScene returned by the methods are dependent on
the platform-specific HScene support.
The three scenarios are defined below:
HScene objects
which are fully within the area of the supporting HGraphicsDevice without any restriction
on size or location. Whether successful creation of HScenes which
are wholly or partially outside the area of the HGraphicsDevice is
supported is implementation dependent.
HScene for the supporting
HGraphicsDevice. It is
implementation dependent whether requests to create HScene
objects which cover less than the full area of the supporting
HGraphicsDevice succeed and if they succeed, what the consequences
are of their being displayed.
HScene is created on such a system, the platform shall return an
HScene which, if visible at that time, would cover as much as
possible of the requested area of the supporting HGraphicsDevice
considering all other visible HScenes at that time. HScenes which
are not visible at this time shall not be considered when fixing the
location & size of the new HScene. HScenes which are visible at
this time shall not be effected by the creation of the new HScene.
When setVisible(true) is
called on such an HScene, the platform
shall attempt to make the HScene visible using its currently set
position and size. If this would conflict with HScenes which are
already visible (e.g. because of changes between when the HScene
was created and when setVisible was called) then the
call to setVisible shall fail silently. Applications
are responsible for testing for failure using the isVisible method. The HScenes of
already visible applications shall not be impacted by this method
call.
The above text specifies the relationship between an HScene and its supporting HGraphicsDevice . This specification
intentionally does not define minimum requirements for
HGraphicsDevices or for their relationship with other HScreenDevices
of any type.
Calling resizeScene
for an HScene shall apply the same
policies as described above for newly created HScenes when deciding
whether the method call is possible.
| Parameter | Description | Default value | Set method | Get method |
|---|---|---|---|---|
| None. | ||||
| Description | Default value | Set method | Get method |
|---|---|---|---|
| None. | |||
| Modifier and Type | Method and Description |
|---|---|
void |
dispose(HScene scene)
This method allows an application to dispose of its
HScene, indicating that the application has
no further need for user interaction (i.e. |
HScene |
getBestScene(HSceneTemplate hst)
Returns an
HScene that best
corresponds to the input HSceneTemplate, or null if such an HScene cannot be generated. |
HSceneTemplate |
getBestSceneTemplate(HSceneTemplate hst)
Returns an
HSceneTemplate
that is closest to to the input HSceneTemplate and corresponds to
an HScene which could be successfully created on this platform
at the time that this method is called. |
HScene |
getDefaultHScene()
|
HScene |
getDefaultHScene(HScreen screen)
|
HScene |
getFullScreenScene(HGraphicsDevice device)
Create a full-screen
HScene on the
specified HGraphicsDevice
or null if such an HScene cannot be generated. |
static HSceneFactory |
getInstance()
Returns an
HSceneFactory
object to an application. |
HSceneTemplate |
resizeScene(HScene hs,
HSceneTemplate hst)
Resizes an
HScene so that it best
corresponds to the input HSceneTemplate, or remains unchanged if it cannot be so
resized. |
public static HSceneFactory getInstance()
HSceneFactory
object to an application.HSceneFactory
object to an application. Note that repeated invocations of
this method should return the same object (reference).public HSceneTemplate getBestSceneTemplate(HSceneTemplate hst)
HSceneTemplate
that is closest to to the input HSceneTemplate and corresponds to
an HScene which could be successfully created on this platform
at the time that this method is called.
Note that since some platforms may support more than one
concurrent application there is no guarantee that the values
returned by this method would actually match those of a
subsequently requested HScene, using
the same template.
Note that conflict may occur between properties in the HSceneTemplate and the HGraphicsConfigTemplate
corresponding to the currently active HGraphicsConfiguration. In
the event of conflict between properties which are PREFERRED or
UNNECESSARY, the properties concerned shall be ignored and the
default will prevail. In the event of conflict between
properties which are REQUIRED, this method shall fail and
return null.
hst - The HSceneTemplate properties that the HScene should satisfy.HSceneTemplate
that best corresponds to the input HSceneTemplate.public HScene getBestScene(HSceneTemplate hst)
HScene that best
corresponds to the input HSceneTemplate, or null if such an HScene cannot be generated.
Note that conflict may occur between properties in the HSceneTemplate and the HGraphicsConfigTemplate
corresponding to the currently active HGraphicsConfiguration. In
the event of conflict between properties which are PREFERRED or
UNNECESSARY, the properties concerned shall be ignored and the
default will prevail. In the event of conflict between
properties which are REQUIRED, this method shall fail and
return null.
hst - the HSceneTemplate to match againstHScene that matches the
properties as specified in the HSceneTemplate, or null if they
cannot be satisfied, or if no further HScenes are available for this application.public HSceneTemplate resizeScene(HScene hs, HSceneTemplate hst) throws IllegalStateException
HScene so that it best
corresponds to the input HSceneTemplate, or remains unchanged if it cannot be so
resized.hs - the HScene to be resized.hst - the HSceneTemplate which denotes the new size / location. Only
size location options in the HSceneTemplate will be considered.HSceneTemplate
that indicates the HScene properties
after (possible) resizing.IllegalStateException - if the HScene had previously been disposed.public HScene getDefaultHScene(HScreen screen)
HScene for this
HScreen. This shall use the
HGraphicsConfiguration returned by calling
screen.getDefaultHGraphicsDevice().getDefaultConfiguration()
public HScene getDefaultHScene()
public HScene getFullScreenScene(HGraphicsDevice device)
HScene on the
specified HGraphicsDevice
or null if such an HScene cannot be generated.device - the graphics device with which to create the
HScene. This is obtained through a
HGraphicsConfigTemplate / HGraphicsConfiguration
sequence as described in the document for these classes.HScene or null if this is not possible.public void dispose(HScene scene)
HScene, indicating that the application has
no further need for user interaction (i.e. its resources may be
released to the system, for future garbage collection). After
dispose() has been called the application may then
acquire another HScene.
scene - the HScene to be
disposed of.HScene,
HScene.dispose()Copyright © 2012 code4tv.com. All Rights Reserved.