org.havi.ui.HFlatEffectMatte Maven / Gradle / Ivy
package org.havi.ui;
/*
* Copyright 2000-2003 by HAVi, Inc. Java is a trademark of Sun
* Microsystems, Inc. All rights reserved.
*/
/**
The {@link org.havi.ui.HFlatEffectMatte HFlatEffectMatte} class
represents a matte that is constant over space but varies over
time. It is specified as a sequence of floating point values
in the range 0.0 to 1.0 where:
- 0.0 is fully transparent
- values between 0.0 and 1.0 are partially transparent to the
nearest supported transparency value.
- 1.0 is fully opaque
The data for any HFlatEffectMatte may be changed "on the fly"
using the {@link org.havi.ui.HFlatEffectMatte#setMatteData setMatteData} method.
However, some implementations may be asynchronously referencing
their content (i.e. through a separate implementation-specific
animation thread). Therefore the following restrictions apply to
the {@link org.havi.ui.HFlatEffectMatte#setMatteData setMatteData} method:
- The method must be synchronized with any implementation-specific
animation thread such that content cannot be changed while a
different thread is using it.
- If the animation was running the method should stop the
animation in a synchronized manner before changing content.
- The method should reset the animation to a starting position
defined by the current play mode. The repeat count of the animation
should be reset to 0.
- If the animation was running the method should start the
animation.
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
Parameter Description Default value
Set method Get method
data
The transparency value for this flat effect matte.
null (the matte should be treated as being temporally
unvarying and opaque)
{@link org.havi.ui.HFlatEffectMatte#setMatteData setMatteData}
{@link org.havi.ui.HFlatEffectMatte#getMatteData getMatteData}
Default parameter values not exposed in the constructors
Description Default value Set method
Get method
The initial piece of content to be presented, i.e. its
position in the content array.
0
{@link org.havi.ui.HFlatEffectMatte#setPosition setPosition}
{@link org.havi.ui.HFlatEffectMatte#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.HFlatEffectMatte#start start} /
{@link org.havi.ui.HFlatEffectMatte#stop stop}
{@link org.havi.ui.HFlatEffectMatte#isAnimated isAnimated}
*/
public class HFlatEffectMatte
implements HMatte, HAnimateEffect
{
/**
* Creates an {@link org.havi.ui.HFlatEffectMatte
* HFlatEffectMatte} object. See the class description for details
* of constructor parameters and default values.
*/
public HFlatEffectMatte()
{
}
/**
* Creates an {@link org.havi.ui.HFlatEffectMatte
* HFlatEffectMatte} object. See the class description for details
* of constructor parameters and default values.
*/
public HFlatEffectMatte(float[] data)
{
}
/**
* Sets the data for this matte. Any previously set data is
* replaced. If this method is called when the animation is
* running the data is changed immediately and the current
* animation position is reset according to the active play
* mode. The changes affect the animation immediately.
*
* @param data the data for this matte. Specify a null object to
* remove the associated data for this matte. If the length of the
* data array is zero, an IllegalArgumentException is thrown.
*/
public void setMatteData(float[] data)
{
}
/**
* Returns the matte data used for this matte.
*
* @return the data used for this matte (an array of numbers), or
* null if no matte data has been set.
*/
public float[] getMatteData()
{
return (null);
}
/**
* This method starts this {@link org.havi.ui.HFlatEffectMatte
* HFlatEffectMatte} 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.HFlatEffectMatte#getPlayMode getPlayMode}.
*/
public void start()
{
return;
}
/**
* This method indicates that the running {@link
* org.havi.ui.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte HFlatEffectMatte}.
*
* @return true
if this {@link org.havi.ui.HFlatEffectMatte
* HFlatEffectMatte} is running, i.e. the start
method
* has been invoked - false
otherwise.
*/
public boolean isAnimated()
{
return(false);
}
/**
* Set this {@link org.havi.ui.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte
* HFlatEffectMatte} 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.HFlatEffectMatte HFlatEffectMatte} 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.HFlatEffectMatte#setDelay
* setDelay} on a currently playing {@link
* org.havi.ui.HFlatEffectMatte HFlatEffectMatte}, 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.HFlatEffectMatte HFlatEffectMatte}.
*
* @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.HFlatEffectMatte
* HFlatEffectMatte}. 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.HFlatEffectMatte HFlatEffectMatte}, 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.HFlatEffectMatte
* HFlatEffectMatte}.
*
* @return the play mode for this {@link
* org.havi.ui.HFlatEffectMatte HFlatEffectMatte}.
*/
public int getPlayMode()
{
return(0);
}
}