|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.visuals.ImageAnimationIcon
public class ImageAnimationIcon
ImageAnimationIcon is a class that allows for incrementing and decrementing
over a set of images that are then displayed in the new state. The
ImageAnimationIcon displays .jpg or .gif image files. The images
can be scrolled or flipped through in several directions.
Notes:
AnimationIconInterface,
AnimationIconView,
ImageAnimation,
Serialized Form| Field Summary | |
|---|---|
protected boolean |
appletRelative
|
protected java.awt.Dimension[] |
dim
|
protected int |
direction
|
protected int |
height
|
protected java.util.Vector |
images
|
protected boolean |
imageScroll
|
protected java.lang.String[] |
imageSources
|
protected java.net.URL[] |
imageURLs
|
protected ImageView |
img
|
protected int |
imgIndex
|
protected java.awt.Dimension |
maxD
|
protected java.awt.Point |
maxPos
|
protected int |
numberOfImages
|
protected java.awt.Image |
offScreen
|
protected java.awt.Graphics |
offScreenGraphics
|
protected java.awt.Point[] |
pos
|
protected int |
scrollingSpeed
|
protected int |
startPosition
|
protected java.awt.MediaTracker |
tracker
|
protected int |
width
|
| Constructor Summary | |
|---|---|
ImageAnimationIcon()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
decrement()
Decrement the position of the images if scolling or the image to be displayed if not scolling. |
int |
getDirection()
Get the direction the images will scroll in if imageScroll property is true. |
java.awt.Insets |
getInsets()
Return Insets(0,0,0,0) |
java.awt.Dimension |
getPreferredSize()
Get the preferredSize of the images. |
int |
getScrollingSpeed()
Get the speed at which the images will scroll. |
java.lang.String[] |
getSequence()
Return the sequence of file names for the images to be displayed. |
java.net.URL[] |
getURLSequence()
Return the sequence of file names for the images to be displayed. |
void |
increment()
Increment the position of the images if scolling or the image to be displayed if not scolling. |
boolean |
isImageScroll()
Return if the images are supposed to scroll over the preferredSize of the ImageAnimationIcon component. |
boolean |
isSourceAppletRelative()
|
protected void |
loadDimensions()
Load the dimensions of the loaded image objects. |
protected java.awt.Image |
loadImage(java.lang.String source)
Load an image from an image name. |
protected java.awt.Image |
loadImage(java.net.URL source)
|
protected java.awt.Image[] |
loadImageSequence(java.lang.String[] srcs)
Load the java.awt.Image objects based on the image file names. |
protected java.awt.Image[] |
loadImageSequence(java.net.URL[] srcs)
Load the java.awt.Image objects based on the image URL. |
protected void |
loadPositions()
Load the positions of the loaded image objects. |
void |
paint(java.awt.Component comp,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paint the component. |
void |
paintAnimation(java.awt.Component comp,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paint the images at their current positions. |
void |
reset()
Reset the object state to its initial state. |
void |
setDefaultValues()
Set the default internal values for the ImageAnimationIcon. |
void |
setDirection(int d)
Set the direction the images will scroll in if imageScroll property is true. |
void |
setImageScroll(boolean s)
Set the display of the images to scroll. |
void |
setImageSequence(java.awt.Image[] imgs)
|
void |
setPreferredSize(java.awt.Dimension d)
Set the preferredSize of the images. |
void |
setScrollingSpeed(int s)
Set the speed at which the images will scroll. |
void |
setSequence(java.lang.String[] sources)
Set the sequence of file names for the images to be displayed. |
void |
setSourceAppletRelative(boolean b)
|
void |
setURLSequence(java.net.URL[] sources)
|
| Field Detail |
|---|
protected int width
protected int height
protected int direction
protected int scrollingSpeed
protected boolean appletRelative
protected boolean imageScroll
protected java.lang.String[] imageSources
protected java.net.URL[] imageURLs
protected transient java.awt.Dimension maxD
protected transient int startPosition
protected transient int imgIndex
protected transient int numberOfImages
protected transient java.awt.MediaTracker tracker
protected transient java.awt.Point maxPos
protected transient java.awt.Image offScreen
protected transient java.awt.Graphics offScreenGraphics
protected transient java.util.Vector images
protected transient java.awt.Dimension[] dim
protected transient java.awt.Point[] pos
protected transient ImageView img
| Constructor Detail |
|---|
public ImageAnimationIcon()
| Method Detail |
|---|
public java.awt.Dimension getPreferredSize()
getPreferredSize in interface com.sas.visuals.IconInterfacegetPreferredSize in class java.awt.ComponentsetPreferredSize(java.awt.Dimension),
IconInterfacepublic void setPreferredSize(java.awt.Dimension d)
setPreferredSize in class java.awt.ComponentgetPreferredSize(),
IconInterfacepublic int getDirection()
setDirection(int)public int getScrollingSpeed()
public java.awt.Insets getInsets()
getInsets in interface com.sas.visuals.PainterInterfacePainterInterfacepublic java.lang.String[] getSequence()
setSequence(java.lang.String[])public java.net.URL[] getURLSequence()
setURLSequence(java.net.URL[])public boolean isImageScroll()
setImageScroll(boolean)public void setImageScroll(boolean s)
s - if true the images will scroll over the preferredSize;
otherwise the images will be displayed in sequence in the same
position.isImageScroll()public boolean isSourceAppletRelative()
public void setSourceAppletRelative(boolean b)
public void setDirection(int d)
d - a com.sas.visuals.Direction valuegetDirection()public void setScrollingSpeed(int s)
public void setSequence(java.lang.String[] sources)
sources - an array of image file namesgetSequence()public void setURLSequence(java.net.URL[] sources)
public void setImageSequence(java.awt.Image[] imgs)
public void reset()
reset in interface AnimationIconInterfaceAnimationIconInterfacepublic void increment()
increment in interface AnimationIconInterfaceAnimationIconInterfacepublic void decrement()
decrement in interface AnimationIconInterfaceAnimationIconInterface
public void paint(java.awt.Component comp,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
paint in interface com.sas.visuals.PainterInterfacecomp - the java.awt.Component to paint ong - the graphics context to use for paintingx - the x coordinatey - the y coordinatewidth - the widthheight - the height
public void paintAnimation(java.awt.Component comp,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
paintAnimation in interface AnimationIconInterfacecomp - the java.awt.Component to paint ong - the graphics context to use for paintingx - the x coordinatey - the y coordinatewidth - the widthheight - the heightPainterInterface.paint(java.awt.Component, java.awt.Graphics, int, int, int, int)protected java.awt.Image[] loadImageSequence(java.lang.String[] srcs)
srcs - the image file namesprotected java.awt.Image[] loadImageSequence(java.net.URL[] srcs)
srcs - the image file namesprotected void loadDimensions()
protected void loadPositions()
protected java.awt.Image loadImage(java.lang.String source)
source - the source can be the image file name and path
or a URL to the image file name and path.
protected java.awt.Image loadImage(java.net.URL source)
public void setDefaultValues()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||