|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent AnimationPanel
public class AnimationPanel
Class to show a frame-based animation Copyright Georgia Institute of Technology 2007
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AnimationPanel()
Constructor that takes no parameters |
|
AnimationPanel(List<Picture> pictList)
Constructor that takes a list of pictures |
|
AnimationPanel(String directory)
Constructor that takes the directory to read the frames from |
|
AnimationPanel(String directory,
int theFramesPerSec)
Constructor that takes the directory to read from and the number of frames per second |
Method Summary | |
---|---|
void |
add(Picture picture)
Method to add a picture |
void |
draw(Graphics g)
Method to paint the frames |
int |
getCurrIndex()
Method to get the current index |
int |
getFramesPerSec()
Method to get the frames per second |
static void |
main(String[] args)
Method to test |
void |
paintComponent(Graphics g)
Method to paint the component |
void |
removeAllAfter()
Method to remove all after the current index |
void |
removeAllBefore()
Method to remove all before current from list |
void |
setFramesPerSec(int numFramesPerSec)
Method to set the frames per second to show the movie |
void |
showAll()
show all frames starting at 0 |
void |
showAllFromCurrent()
show animation from current index |
void |
showNext()
Method to show just the next frame |
void |
showPrev()
Method to show the previous frame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AnimationPanel()
public AnimationPanel(List<Picture> pictList)
pictList
- the list of picturespublic AnimationPanel(String directory)
directory
- the directory to read frompublic AnimationPanel(String directory, int theFramesPerSec)
directory
- the frame direcotrytheFramesPerSec
- the number of frames
per secondMethod Detail |
---|
public int getCurrIndex()
public void setFramesPerSec(int numFramesPerSec)
numFramesPerSec
- the number of frames to show per secondpublic int getFramesPerSec()
public void add(Picture picture)
picture
- the picture to addpublic void showNext()
public void showPrev()
public void showAll()
public void showAllFromCurrent()
public void removeAllBefore()
public void removeAllAfter()
public void draw(Graphics g)
g
- the graphics context to draw topublic void paintComponent(Graphics g)
paintComponent
in class JComponent
public static void main(String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |