|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
org.havi.ui.HComponent
org.havi.ui.HVisible
org.havi.ui.HStaticAnimation
The HStaticAnimation
is a user interface
component used to display animated graphical content but which does
not permit the user to navigate (focus) upon it. By default
it uses the HAnimateLook
to render itself.
The HStaticAnimation
class
supports animating images a finite number of times or infinitely
(continuously), and either forward or in alternating directions
with a specified time delay between the rendering of consecutive
images.
Calling setVisible(false)
on
HStaticAnimation
shall not automatically stop the
animation hence applications are not required to call the
play()
method again when the animation again becomes
visible. It is implementation dependent whether the animation
continues from the last visible position or from where it would be
if it kept running.
Parameter | Description | Default value | Set method | Get method |
---|---|---|---|---|
x | x-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
y | y-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
width | width of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
height | height of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
imagesNormal | The array of images to be used as the content for the HState.NORMAL_STATE state of this
component. |
null | setAnimateContent |
getAnimateContent |
delay | The delay between the presentation of successive content in the animation, in units of 0.1 second | 1 (i.e. 0.1 seconds) | setDelay |
getDelay |
repeatCount | The number of times that the animation is to be played. | REPEAT_INFINITE |
setRepeatCount |
getRepeatCount |
playMode | The playing mode for the animation. | PLAY_REPEATING |
setPlayMode |
getPlayMode |
Description | Default value | Set method | Get method |
---|---|---|---|
Associated matte (HMatte ). |
none (i.e. getMatte() returns null ) |
setMatte |
getMatte |
The text layout manager responsible for text formatting. | An HDefaultTextLayoutManager
object. |
HVisible.setTextLayoutManager(org.havi.ui.HTextLayoutManager)
|
HVisible.getTextLayoutManager()
|
The background painting mode | HVisible.NO_BACKGROUND_FILL |
HVisible.setBackgroundMode(int) |
HVisible.getBackgroundMode() |
The default preferred size | not set (i.e. NO_DEFAULT_SIZE) unless specified by width
and height parameters |
HVisible.setDefaultSize(java.awt.Dimension) |
HVisible.getDefaultSize() |
The horizontal content alignment | HVisible.HALIGN_CENTER |
HVisible.setHorizontalAlignment(int) |
HVisible.getHorizontalAlignment() |
The vertical content alignment | HVisible.VALIGN_CENTER |
HVisible.setVerticalAlignment(int) |
HVisible.getVerticalAlignment() |
The content scaling mode | HVisible.RESIZE_NONE |
HVisible.setResizeMode(int) |
HVisible.getResizeMode() |
The border mode | true |
HVisible.setBordersEnabled(boolean) |
HVisible.getBordersEnabled() |
The initial piece of content to be presented, i.e. its position in the content array. | 0 | setPosition |
getPosition |
By default the animation should be stopped. Hence, to start the animation its start method must be explicitly invoked. This mechanism allows for animations that are programmatically controlled, e.g. via the setPosition method. | "stopped" | start /
stop |
isAnimated |
The default "look" for this class. | A platform specific HAnimateLook |
HStaticAnimation.setDefaultLook |
HStaticAnimation.getDefaultLook |
The "look" for this object. | The HAnimateLook returned from
HStaticAnimation.getDefaultLook when this object was created. |
HStaticAnimation.setLook |
HStaticAnimation.getLook |
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface org.havi.ui.HAnimateEffect |
PLAY_ALTERNATING, PLAY_REPEATING, REPEAT_INFINITE |
Fields inherited from interface org.havi.ui.HState |
ACTIONED_FOCUSED_STATE, ACTIONED_STATE, ACTIONED_STATE_BIT, ALL_STATES, DISABLED_ACTIONED_FOCUSED_STATE, DISABLED_ACTIONED_STATE, DISABLED_FOCUSED_STATE, DISABLED_STATE, DISABLED_STATE_BIT, FIRST_STATE, FOCUSED_STATE, FOCUSED_STATE_BIT, LAST_STATE, NORMAL_STATE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HStaticAnimation()
Creates an HStaticAnimation object. |
|
HStaticAnimation(java.awt.Image[] imagesNormal,
int delay,
int playMode,
int repeatCount)
Creates an HStaticAnimation object. |
|
HStaticAnimation(java.awt.Image[] imagesNormal,
int delay,
int playMode,
int repeatCount,
int x,
int y,
int width,
int height)
Creates an HStaticAnimation object. |
Method Summary | |
static HAnimateLook |
getDefaultLook()
Returns the currently set default HLook for HStaticAnimation components. |
int |
getDelay()
Gets the presentation delay for this HStaticAnimation . |
int |
getPlayMode()
Gets the playing mode for this HStaticAnimation . |
int |
getPosition()
Get the current index into the content array which this HStaticAnimation is using to display
content. |
int |
getRepeatCount()
Gets the number of times that this HStaticAnimation is to be played. |
boolean |
isAnimated()
This method indicates the animation (running) state of the HStaticAnimation . |
static void |
setDefaultLook(HAnimateLook hlook)
Sets the default HLook for further
HStaticAnimation
Components. |
void |
setDelay(int count)
Sets the delay between the presentation of successive pieces of content (frames). |
void |
setLook(HLook hlook)
Sets the HLook for this component. |
void |
setPlayMode(int mode)
Sets the playing mode for this HStaticAnimation . |
void |
setPosition(int position)
Set this HStaticAnimation to
display the content at the specified position. |
void |
setRepeatCount(int count)
Sets the number of times that this HStaticAnimation should be played.
|
void |
start()
This method starts this HStaticAnimation playing. |
void |
stop()
This method indicates that the running HStaticAnimation should be
stopped. |
Methods inherited from class org.havi.ui.HComponent |
getMatte, isDoubleBuffered, isEnabled, processEvent, setMatte |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setCursor, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HStaticAnimation()
HStaticAnimation
object. See the class description for details
of constructor parameters and default values. For constructors
which specify content as parameters, see 'State-based content' in
HVisible for unspecified content associated with other HStates.
public HStaticAnimation(java.awt.Image[] imagesNormal, int delay, int playMode, int repeatCount, int x, int y, int width, int height)
HStaticAnimation
object. See the class description for details
of constructor parameters and default values. For constructors
which specify content as parameters, see 'State-based content' in
HVisible for unspecified content associated with other HStates.
public HStaticAnimation(java.awt.Image[] imagesNormal, int delay, int playMode, int repeatCount)
HStaticAnimation
object. See the class description for details
of constructor parameters and default values. For constructors
which specify content as parameters, see 'State-based content' in
HVisible for unspecified content associated with other HStates.
Method Detail |
public void setLook(HLook hlook) throws HInvalidLookException
HLook
for this component.
setLook
in class HVisible
hlook
- The HLook
that is to be
used for this component.
Note that this parameter may be null, in which case the
component will not draw itself until a look is set.
HInvalidLookException
- If the HLook
is not an HAnimateLook
.public static void setDefaultLook(HAnimateLook hlook)
HLook
for further
HStaticAnimation
Components.
hlook
- The HLook
that will be
used by default when creating a new HStaticAnimation
component.
Note that this parameter may be null, in which case newly
created components shall not draw themselves until a non-null
look is set using the setLook
method.public static HAnimateLook getDefaultLook()
HLook
for HStaticAnimation
components.
HLook
that is used by
default when creating a new HStaticAnimation
component.public void start()
HStaticAnimation
playing. If start
is called when
the animation is already running it resets the animation
according to the current play mode, as returned by getPlayMode
.
start
in interface HAnimateEffect
public void stop()
HStaticAnimation
should be
stopped. After calling this method, there is no guarantee that
one or more frames will not be displayed before the animation
actually stops playing. If the animation is already stopped
further calls to stop
have no effect.
stop
in interface HAnimateEffect
public boolean isAnimated()
HStaticAnimation
.
isAnimated
in interface HAnimateEffect
true
if this HStaticAnimation
is running, i.e. the start
method
has been invoked - false
otherwise.public void setPosition(int position)
HStaticAnimation
to
display the content at the specified position. If the animation
is already running a call to setPosition
will
change the current value and affect the animation immediately.
setPosition
in interface HAnimateEffect
position
- an index into the content array which specifies
the next piece of content to be displayed. If
position
is less than 0, then the array element at
index 0 is displayed, if position
is greater than
or equal to the length of the content array, then the array
element at index [length
-1] will be used.public int getPosition()
HStaticAnimation
is using to display
content.
getPosition
in interface HAnimateEffect
0 <= index < length
public void setRepeatCount(int count)
HStaticAnimation
should be played.
If the animation is already running a call to
setRepeatCount
will change the current value and
reset the current number of repeats to 0, affecting the
animation immediately.
setRepeatCount
in interface HAnimateEffect
count
- the number of times that an HStaticAnimation
should be
played. Valid values of the repeat count are one or more, and
REPEAT_INFINITE
.public int getRepeatCount()
HStaticAnimation
is to be played. Note that this method does not
return the number of repeats that are remaining to be played.
Except for HAnimateEffect
implementations that specify a
different default, getRepeatCount()
returns
REPEAT_INFINITE
if no call to
setRepeatCount()
has previously been made.
getRepeatCount
in interface HAnimateEffect
HStaticAnimation
is to be played. The
returned value shall be greater than zero, or REPEAT_INFINITE
.public void setDelay(int count)
After calling setDelay
on a currently playing HStaticAnimation
, there is no
guarantee that one or more frames will not be displayed using
the previous delay until the new delay value takes effect.
setDelay
in interface HAnimateEffect
count
- the content presentation delay in units of 0.1
seconds duration. If count is less than one "unit",
then it shall be treated as if it were a delay of one
"unit", i.e. 0.1 seconds.public int getDelay()
HStaticAnimation
.
getDelay
in interface HAnimateEffect
public void setPlayMode(int mode)
HStaticAnimation
. If the animation is already running a call to
setPlayMode
will change the current value and
affect the animation immediately. The position of the animation
is unchanged.
setPlayMode
in interface HAnimateEffect
mode
- the play mode for this HStaticAnimation
, which must be either HAnimateEffect.PLAY_ALTERNATING
or HAnimateEffect.PLAY_REPEATING
.public int getPlayMode()
HStaticAnimation
.
getPlayMode
in interface HAnimateEffect
HStaticAnimation
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |