All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.havi.ui.HStaticAnimation Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package org.havi.ui;

/*
 * Copyright 2000-2003 by HAVi, Inc. Java is a trademark of Sun
 * Microsystems, Inc. All rights reserved.  
 */

import java.awt.Image;


/**
   The {@link org.havi.ui.HStaticAnimation 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 {@link org.havi.ui.HAnimateLook HAnimateLook} to render itself.

   

The {@link org.havi.ui.HStaticAnimation 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.


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
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 {@link org.havi.ui.HState#NORMAL_STATE HState.NORMAL_STATE} state of this component. null {@link org.havi.ui.HVisible#setAnimateContent setAnimateContent} {@link org.havi.ui.HVisible#getAnimateContent 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) {@link org.havi.ui.HStaticAnimation#setDelay setDelay} {@link org.havi.ui.HStaticAnimation#getDelay getDelay}
repeatCount The number of times that the animation is to be played. {@link org.havi.ui.HAnimateEffect#REPEAT_INFINITE REPEAT_INFINITE} {@link org.havi.ui.HStaticAnimation#setRepeatCount setRepeatCount} {@link org.havi.ui.HStaticAnimation#getRepeatCount getRepeatCount}
playMode The playing mode for the animation. {@link org.havi.ui.HAnimateEffect#PLAY_REPEATING PLAY_REPEATING} {@link org.havi.ui.HStaticAnimation#setPlayMode setPlayMode} {@link org.havi.ui.HStaticAnimation#getPlayMode getPlayMode}

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
Associated matte ({@link org.havi.ui.HMatte HMatte}). none (i.e. getMatte() returns null) {@link org.havi.ui.HComponent#setMatte setMatte} {@link org.havi.ui.HComponent#getMatte getMatte}
The text layout manager responsible for text formatting. An {@link org.havi.ui.HDefaultTextLayoutManager} object. {@link org.havi.ui.HVisible#setTextLayoutManager} {@link org.havi.ui.HVisible#getTextLayoutManager}
The background painting mode {@link org.havi.ui.HVisible#NO_BACKGROUND_FILL} {@link org.havi.ui.HVisible#setBackgroundMode} {@link org.havi.ui.HVisible#getBackgroundMode}
The default preferred size not set (i.e. NO_DEFAULT_SIZE) unless specified by width and height parameters {@link org.havi.ui.HVisible#setDefaultSize} {@link org.havi.ui.HVisible#getDefaultSize}
The horizontal content alignment {@link org.havi.ui.HVisible#HALIGN_CENTER} {@link org.havi.ui.HVisible#setHorizontalAlignment} {@link org.havi.ui.HVisible#getHorizontalAlignment}
The vertical content alignment {@link org.havi.ui.HVisible#VALIGN_CENTER} {@link org.havi.ui.HVisible#setVerticalAlignment} {@link org.havi.ui.HVisible#getVerticalAlignment}
The content scaling mode {@link org.havi.ui.HVisible#RESIZE_NONE} {@link org.havi.ui.HVisible#setResizeMode} {@link org.havi.ui.HVisible#getResizeMode}
The border mode true {@link org.havi.ui.HVisible#setBordersEnabled} {@link org.havi.ui.HVisible#getBordersEnabled}
The initial piece of content to be presented, i.e. its position in the content array. 0 {@link org.havi.ui.HStaticAnimation#setPosition setPosition} {@link org.havi.ui.HStaticAnimation#getPosition 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" {@link org.havi.ui.HStaticAnimation#start start} / {@link org.havi.ui.HStaticAnimation#stop stop} {@link org.havi.ui.HStaticAnimation#isAnimated isAnimated}
The default "look" for this class. A platform specific {@link org.havi.ui.HAnimateLook HAnimateLook} {@link org.havi.ui.HStaticAnimation#setDefaultLook HStaticAnimation.setDefaultLook} {@link org.havi.ui.HStaticAnimation#getDefaultLook HStaticAnimation.getDefaultLook}
The "look" for this object. The {@link org.havi.ui.HAnimateLook HAnimateLook} returned from HStaticAnimation.getDefaultLook when this object was created. {@link org.havi.ui.HStaticAnimation#setLook HStaticAnimation.setLook} {@link org.havi.ui.HStaticAnimation#getLook HStaticAnimation.getLook}
*/ public class HStaticAnimation extends HVisible implements HNoInputPreferred, HAnimateEffect { /** * Creates an {@link org.havi.ui.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() { } /** * Creates an {@link org.havi.ui.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) { } /** * Creates an {@link org.havi.ui.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) { } /** * Sets the {@link org.havi.ui.HLook HLook} for this component. * * @param hlook The {@link org.havi.ui.HLook 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. * @exception HInvalidLookException If the {@link * org.havi.ui.HLook HLook} is not an {@link * org.havi.ui.HAnimateLook HAnimateLook}. */ public void setLook(HLook hlook) throws HInvalidLookException { } /** * Sets the default {@link org.havi.ui.HLook HLook} for further * {@link org.havi.ui.HStaticAnimation HStaticAnimation} * Components. * * @param hlook The {@link org.havi.ui.HLook HLook} that will be * used by default when creating a new {@link * org.havi.ui.HStaticAnimation 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 {@link * org.havi.ui.HStaticAnimation#setLook setLook} method. */ public static void setDefaultLook(HAnimateLook hlook) { } /** * Returns the currently set default {@link org.havi.ui.HLook * HLook} for {@link org.havi.ui.HStaticAnimation * HStaticAnimation} components. * * @return The {@link org.havi.ui.HLook HLook} that is used by * default when creating a new {@link org.havi.ui.HStaticAnimation * HStaticAnimation} component. */ public static HAnimateLook getDefaultLook() { return (null); } /** * This method starts this {@link org.havi.ui.HStaticAnimation * 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 {@link * org.havi.ui.HStaticAnimation#getPlayMode getPlayMode}. */ public void start() { return; } /** * This method indicates that the running {@link * org.havi.ui.HStaticAnimation 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. */ public void stop() { return; } /** * This method indicates the animation (running) state of the * {@link org.havi.ui.HStaticAnimation HStaticAnimation}. * * @return true if this {@link org.havi.ui.HStaticAnimation * HStaticAnimation} is running, i.e. the start method * has been invoked - false otherwise. */ public boolean isAnimated() { return(false); } /** * Set this {@link org.havi.ui.HStaticAnimation 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. * * @param 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 void setPosition(int position) { return; } /** * Get the current index into the content array which this {@link * org.havi.ui.HStaticAnimation HStaticAnimation} is using to display * content. * * @return the index of the content currently being displayed, in * the range 0 <= index < length */ public int getPosition() { return(0); } /** * Sets the number of times that this {@link * org.havi.ui.HStaticAnimation 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. * * @param count the number of times that an {@link * org.havi.ui.HStaticAnimation HStaticAnimation} should be * played. Valid values of the repeat count are one or more, and * {@link org.havi.ui.HAnimateEffect#REPEAT_INFINITE * REPEAT_INFINITE}. */ public void setRepeatCount(int count) { return; } /** * Gets the number of times that this {@link org.havi.ui.HStaticAnimation * 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. * * @return the total number of times that an {@link * org.havi.ui.HStaticAnimation HStaticAnimation} is to be played. The * returned value shall be greater than zero, or {@link * org.havi.ui.HAnimateEffect#REPEAT_INFINITE REPEAT_INFINITE}. */ public int getRepeatCount() { return(0); } /** * Sets the delay between the presentation of successive pieces of * content (frames). *

* After calling {@link org.havi.ui.HStaticAnimation#setDelay * setDelay} on a currently playing {@link * org.havi.ui.HStaticAnimation 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. * * @param 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 void setDelay(int count) { return; } /** * Gets the presentation delay for this {@link * org.havi.ui.HStaticAnimation HStaticAnimation}. * * @return the presentation delay in units of 0.1 seconds. */ public int getDelay() { return(0); } /** * Sets the playing mode for this {@link org.havi.ui.HStaticAnimation * 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. * * @param mode the play mode for this {@link * org.havi.ui.HStaticAnimation HStaticAnimation}, which must be either {@link * org.havi.ui.HAnimateEffect#PLAY_ALTERNATING} or {@link * org.havi.ui.HAnimateEffect#PLAY_REPEATING}. */ public void setPlayMode(int mode) { return; } /** * Gets the playing mode for this {@link org.havi.ui.HStaticAnimation * HStaticAnimation}. * * @return the play mode for this {@link * org.havi.ui.HStaticAnimation HStaticAnimation}. */ public int getPlayMode() { return(0); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy