|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTWGDialogPanel
com.tivoli.twg.guilibs.AnimationPanel
This is the base class for the Director simple animation component. It creates an animation by displaying a series of images in sequence. You can specify the delay between frames in milliseconds. The animation can loop for a specific number of iterations or it can run forever. Note that the animation is not meant to be reentrant. You should not call startAnimation while the animation is in progress. The second call is ignored and the first call to stopAnimation will stop the animation. The start/stops are not reference counted. This makes sense since this class has class data that stores the information for animation.
TWGTaskFrame
,
TWGStatusIndicator
,
Serialized FormNested Class Summary | |
---|---|
protected class |
AnimationPanel.AccessibleStatusIndicator
This class implements accessibility support for the JPanel class. |
Field Summary | |
---|---|
protected boolean |
animationRunning
True animation is running, false otherwise. |
protected java.awt.Image |
backgroundImage
The image to use when the animation images are not loaded. |
protected boolean |
clearFrame
Clear frame between each image. |
protected java.awt.Image |
currentImage
Image currently being shown. |
protected int |
defaultDelay
Delay time between images, in milliseconds. |
protected java.util.Hashtable |
delays
Duration of each image (Integers, in milliseconds). |
protected java.lang.Thread |
displayThread
Thread which runs the animation. |
protected java.awt.Image |
extraLargeBackgroundImage
|
protected java.util.Vector |
extraLargeImages
|
protected boolean |
forever
Run animation forever. |
protected java.util.Vector |
images
Images to be displayed. |
protected java.awt.Image |
largeBackgroundImage
|
protected java.util.Vector |
largeImages
|
protected int |
maxHeight
Dimension of largest image in sequence. |
protected int |
maxWidth
Dimension of largest image in sequence. |
protected int |
numLoops
Number of times to show the animation sequence. |
protected boolean |
previewMode
Preview this component at design time. |
protected java.awt.Image |
smallbackgroundImage
|
protected java.util.Vector |
smallimages
|
Constructor Summary | |
---|---|
AnimationPanel()
Constructs a default Animation Panel. |
Method Summary | |
---|---|
protected void |
finalize()
Make sure as part of the cleanup, the animation is stopped and the thread is destroyed. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JPanel. |
java.awt.Image |
getBackgroundImage()
This function allows you to query the background image the animation panel displays when animation is not running. |
int |
getDefaultDelay()
Returns the current delay between animation frames. |
int |
getFrameDelay(int frameNumber)
You can use this function to query the amount of time a specific frame in an animation sequence is shown before displaying the next animation frame. |
java.awt.Dimension |
getMaximumSize()
Returns the maximum dimensions to properly display this component. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum dimensions to properly display this component. |
int |
getNumLoops()
Returns the current animation set loop count. |
java.awt.Dimension |
getPreferredSize()
Returns the recommended dimensions to properly display this component. |
boolean |
isClearFrame()
Gets the current clear frame setting. |
boolean |
isPreviewMode()
Gets the preview mode flag. |
boolean |
isRepeatMode()
Retrieve the current repeat mode setting. |
void |
paint(java.awt.Graphics g)
Paints this component using the given graphics context. |
void |
resetFrameDelaysToDefault()
This function allows you to reset all individual frame delays to the class's default delay. |
void |
run()
Body of Animation Thread. |
void |
setBackgroundImage(java.awt.Image background)
This function allows you to set a background image that is displayed in the animation panel when animation is not running. |
void |
setBackgroundImages(java.awt.Image smallbackground,
java.awt.Image mediumbackground,
java.awt.Image largebackground)
This function allows you to set a background image that is displayed in the animation panel when animation is not running. |
void |
setClearFrame(boolean newClearFrame)
Sets whether or not the animation frame area is cleared between each frame. |
void |
setDefaultDelay(int newDefaultDelay)
Sets the delay between animation frames. |
void |
setFrameDelay(int frameNumber,
int newDelay)
This function allows you to set the amount of time an specific animation frame will be displayed. |
void |
setImageList(java.util.Vector newImageList)
This function allows you to set a vector of images the animation panel will display as its animation sequence. |
void |
setImageLists(java.util.Vector smallImageList,
java.util.Vector mediumImageList,
java.util.Vector largeImageList)
This function allows you to set a vector of images the animation panel will display as its animation sequence. |
void |
setNumLoops(int newNumLoops)
Sets the number of loops to perform when displaying the animation set. |
void |
setPreviewMode(boolean newPreviewMode)
Deprecated. - this method will be removed in framework4. |
void |
setRepeatMode(boolean newRepeatMode)
Sets the repeat mode setting. |
void |
startAnimation()
Starts the animation. |
void |
stopAnimation()
Stops the animation. |
void |
updateUI()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int defaultDelay
protected java.util.Hashtable delays
protected int numLoops
protected boolean forever
protected java.util.Vector images
protected java.util.Vector smallimages
protected java.util.Vector largeImages
protected java.util.Vector extraLargeImages
protected java.awt.Image backgroundImage
protected java.awt.Image smallbackgroundImage
protected java.awt.Image largeBackgroundImage
protected java.awt.Image extraLargeBackgroundImage
protected transient java.awt.Image currentImage
protected transient java.lang.Thread displayThread
protected int maxWidth
protected int maxHeight
protected boolean clearFrame
protected boolean previewMode
protected boolean animationRunning
Constructor Detail |
public AnimationPanel()
Method Detail |
public void updateUI()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public void setDefaultDelay(int newDefaultDelay)
newDefaultDelay
- the animation delay, in millisecondsgetDefaultDelay()
public int getDefaultDelay()
setDefaultDelay(int)
public void setFrameDelay(int frameNumber, int newDelay)
frameNumber
- The frame you want the specific delay for. The number
is a zero based index into the animation frames.newDelay
- The delay, in milliseconds, to use for that frame.getFrameDelay(int)
public int getFrameDelay(int frameNumber)
frameNumber
- The frame you want the specific delay for. The number
is a zero based index into the animation frames.
setFrameDelay(int, int)
public void resetFrameDelaysToDefault()
setFrameDelay(int, int)
public void setNumLoops(int newNumLoops)
newNumLoops
- the new loop count to use when iterating through the
animation frame set.public int getNumLoops()
setNumLoops(int)
public void setRepeatMode(boolean newRepeatMode)
newRepeatMode
- If true, then the animation panel will loop through
the animation set forever (or until stopped). If false,
the animation panel will loop through the animation
set for the number times specified by the loop count.setNumLoops(int)
public boolean isRepeatMode()
setRepeatMode(boolean)
public void setBackgroundImages(java.awt.Image smallbackground, java.awt.Image mediumbackground, java.awt.Image largebackground)
public void setBackgroundImage(java.awt.Image background)
background
- The Image to display as the background.public java.awt.Image getBackgroundImage()
public void setImageList(java.util.Vector newImageList)
newImageList
- The Vector containing the Images that will be used
as the animation set.public void setImageLists(java.util.Vector smallImageList, java.util.Vector mediumImageList, java.util.Vector largeImageList)
public void setClearFrame(boolean newClearFrame)
newClearFrame
- If true, the frame area is cleared between each
animation frame; if false, the frame area is not cleared.#getClearFrame
public boolean isClearFrame()
setClearFrame(boolean)
public void setPreviewMode(boolean newPreviewMode)
newPreviewMode
- new preview mode#getPreviewMode
public boolean isPreviewMode()
setPreviewMode(boolean)
public void startAnimation()
stopAnimation()
public void stopAnimation()
startAnimation()
public void run()
run
in interface java.lang.Runnable
public void paint(java.awt.Graphics g)
g
- the graphics context used for paintingComponent.repaint()
public java.awt.Dimension getPreferredSize()
getMinimumSize()
public java.awt.Dimension getMinimumSize()
getPreferredSize()
public java.awt.Dimension getMaximumSize()
getPreferredSize()
public javax.accessibility.AccessibleContext getAccessibleContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |