public class HStaticAnimation extends HVisible implements HNoInputPreferred, HAnimateEffect
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 |
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyADJUSTMENT_VALUE_CHANGE, ANIMATE_CONTENT_CHANGE, ANIMATION_POSITION_CHANGE, BACKGROUND_FILL, BORDER_CHANGE, CARET_POSITION_CHANGE, CONTENT_CHANGE, ECHO_CHAR_CHANGE, EDIT_MODE_CHANGE, FIRST_CHANGE, GRAPHIC_CONTENT_CHANGE, HALIGN_CENTER, HALIGN_JUSTIFY, HALIGN_LEFT, HALIGN_RIGHT, ITEM_VALUE_CHANGE, LAST_CHANGE, LIST_CONTENT_CHANGE, LIST_ICONSIZE_CHANGE, LIST_LABELSIZE_CHANGE, LIST_MULTISELECTION_CHANGE, LIST_SCROLLPOSITION_CHANGE, LIST_SELECTION_CHANGE, MIN_MAX_CHANGE, NO_BACKGROUND_FILL, NO_DEFAULT_HEIGHT, NO_DEFAULT_SIZE, NO_DEFAULT_WIDTH, ORIENTATION_CHANGE, REPEAT_COUNT_CHANGE, RESIZE_ARBITRARY, RESIZE_NONE, RESIZE_PRESERVE_ASPECT, SIZE_CHANGE, STATE_CHANGE, TEXT_CONTENT_CHANGE, TEXT_VALUE_CHANGE, THUMB_OFFSETS_CHANGE, UNKNOWN_CHANGE, VALIGN_BOTTOM, VALIGN_CENTER, VALIGN_JUSTIFY, VALIGN_TOPBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTPLAY_ALTERNATING, PLAY_REPEATING, REPEAT_INFINITEACTIONED_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_STATEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
HStaticAnimation()
Creates an
HStaticAnimation object. |
HStaticAnimation(Image[] imagesNormal,
int delay,
int playMode,
int repeatCount)
Creates an
HStaticAnimation object. |
HStaticAnimation(Image[] imagesNormal,
int delay,
int playMode,
int repeatCount,
int x,
int y,
int width,
int height)
Creates an
HStaticAnimation object. |
| Modifier and Type | Method and Description |
|---|---|
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. |
getAnimateContent, getBackgroundMode, getBordersEnabled, getContent, getDefaultSize, getGraphicContent, getHorizontalAlignment, getInteractionState, getLook, getLookData, getMaximumSize, getMinimumSize, getPreferredSize, getResizeMode, getTextContent, getTextLayoutManager, getVerticalAlignment, isFocusTraversable, isOpaque, paint, setAnimateContent, setBackgroundMode, setBordersEnabled, setContent, setDefaultSize, setEnabled, setGraphicContent, setHorizontalAlignment, setInteractionState, setLookData, setResizeMode, setTextContent, setTextLayoutManager, setVerticalAlignment, updategetMatte, isDoubleBuffered, isEnabled, processEvent, setMatteaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validatepublic 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(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(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.public void setLook(HLook hlook) throws HInvalidLookException
HLook for this component.setLook in class HVisiblehlook - 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 HAnimateEffectpublic 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 HAnimateEffectpublic boolean isAnimated()
HStaticAnimation.isAnimated in interface HAnimateEffecttrue 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 HAnimateEffectposition - 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 HAnimateEffect0 <= index < lengthpublic 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 HAnimateEffectcount - 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 HAnimateEffectHStaticAnimation 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 HAnimateEffectcount - 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 HAnimateEffectpublic 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 HAnimateEffectmode - the play mode for this HStaticAnimation, which must be either HAnimateEffect.PLAY_ALTERNATING or HAnimateEffect.PLAY_REPEATING.public int getPlayMode()
HStaticAnimation.getPlayMode in interface HAnimateEffectHStaticAnimation.Copyright © 2012 code4tv.com. All Rights Reserved.