conga.gui
Class AnimatedGifWidget

java.lang.Object
  |
  +--marimba.gui.Widget
        |
        +--marimba.gui.ResourceWidget
              |
              +--marimba.gui.ImageWidget
                    |
                    +--conga.gui.AnimatedGifWidget
All Implemented Interfaces:
java.awt.image.ImageObserver, PropertyObject, TimerClient, WidgetConstants

public class AnimatedGifWidget
extends ImageWidget

This widget is the same as the ImageWidget, except that it also frequently repaints new frames in an animated gif if the image is an animated image.

This widget is not a subclass of AnimatedWidget, because the fps property is different here (this widget uses a delay) and the AnimatedWidget is based on frames and a current frame, while this widget simply repaints the next frame whenever it arrives from the image.

This widget supports WidgetLayoutMgr2. This means it can be used in widgets/containers that use a layout manager that implements WidgetLayoutMgr2.

Version:
2.00, 06/19/1998
Author:
Klaas Waslander
See Also:
WidgetLayoutMgr2

Field Summary
protected  int delay
          The delay in milliseconds between each frame of the animated gif, if the image being used is actually an animating gif.
protected  java.util.Vector oldImages
          Vector with Image objects that have been previously used, but are not used anymore since the image had to be refreshed.
 
Fields inherited from class marimba.gui.ImageWidget
img, mode, modeOptions
 
Fields inherited from class marimba.gui.ResourceWidget
preload, src
 
Fields inherited from class marimba.gui.Widget
adapter, background, clazz, defaultBackground, defaultFont, defaultForeground, defaultHilite, directGraphics, disabled, east, editor, focus, font, foreground, height, hilite, layoutMgr, name, north, nwidgets, parent, script, south, tip, transparent, tx, ty, valid, visible, wBackground, west, wFont, wForeground, wHilite, widgets, width, wScript, wTip, x, y
 
Fields inherited from interface marimba.gui.WidgetConstants
ALWAYS, ANYWHERE, APPLET, ASCENDING, BLINK, BLUE, BONGO_EVENT, BOTH, BOTTOM, BOXED, BUTTON, CENTER, CHAR, CHECK, COLLAPSE_EVENT, CONTENT, DESCENDING, DETACHED, DIAGONAL, DOWN, DRAG, EXCLUSIVE, EXPAND_EVENT, FILL, FILLED, GREEN, HORIZONTAL, INSIDE, INVISIBLE, JAVA_VERSION, JAVAOS, JDK10, JDK11, LAYERS, LEFT, LOWERED, MAC, MULTIPLE, NETCASTER, NETSCAPE, NEVER, NONE, NT, OPTIONAL, OS_ARCH, OS_NAME, OS_VERSION, OUTLINE, PAGE_DOWN, PAGE_EVENT, PAGE_UP, PATTERN, PC, PICTURE, PLAIN, PROPORTIONAL, RADIO, RAISED, RED, REST_EVENT, RIGHT, ROUNDED, SCALE, SCROLLBAR, SCROLLING, SOLID, SQUARE, TEXT_CHANGED_EVENT, TOP, TOPLEFT, TRUNCATE, UNDERLINE, UNIX, UP, VERTICAL, WAKE_EVENT, WIN95, WINDOWS, WORD
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AnimatedGifWidget()
          Default public constructor.
AnimatedGifWidget(java.lang.String src)
          Construct a new animated gif widget with the given image source.
 
Method Summary
 void flush()
          Flush the image cache.
 int getDelay()
          Get the delay between each frame in milliseconds.
 void getProperties(PropertyList list)
          Add the delay property to the properties of this widget.
 boolean imageUpdate(java.awt.Image newimg, int flags, int x, int y, int w, int h)
          Check whether the next frame of the image is ready.
 void setDelay(int delay)
          Set the delay between each frame in milliseconds.
 void setProperties(PropertyList list)
          Set the properties of this widget, including the delay property.
 void setValue(java.lang.String value)
          Store old image before flushing with new value, so imageUpdate can check for that old image and return false on it.
 
Methods inherited from class marimba.gui.ImageWidget
action, getImageValue, getMode, getModeOptions, getStringValue, getValue, handleEvent, init, paint, paramString, setMode, setValue, start
 
Methods inherited from class marimba.gui.ResourceWidget
getSource, setSource
 
Methods inherited from class marimba.gui.Widget
action, action, add, add, adjustFont, adjustFont, applyProperties, audioLoop, audioLoop, audioPlay, audioPlay, audioStop, audioStop, bounds, clearFocus, clearPopups, clone, contains, contains, createImage, createImage, currentFocus, destroy, disable, disable, enable, findWidget, firstFocus, focusInterest, getAudioClip, getAudioClipAt, getBackground, getBounds, getCancelButton, getChildProperties, getCursor, getDefaultButton, getDescription, getEditor, getEncoding, getFocusColor, getFont, getFontMetrics, getForeground, getHilite, getImage, getKey, getKey, getKey, getLayoutMgr, getLocale, getLocation, getName, getParent, getPlayerFrame, getPlayerPanel, getPreferredSize, getPresentation, getSelBackground, getSelFocusColor, getSelForeground, getSize, getText, getText, getTip, getTip, getTipFont, getValue, getWidget, getWidgetAt, getWidgetAt, getWidgetClass, getWidgetsAt, getWidgetsAt, getWidgetsAt, gotFocus, gotoPage, gotoPage, hasFocus, hide, inheritFont, inside, inside, invalidate, isDisabled, isShowing, isTransparent, isVisible, keyDown, keyUp, layout, list, list, locateWidget, locateWidgets, locateWidgets, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, overlap, paint, paintAll, postEvent, previousFocus, remove, remove, remove, removeAll, repaint, repaint, repaint, repaint, repaintParent, replace, replace, replace, requestFocus, resetCursor, reshape, reshape, resize, resize, rmove, rscroll, scroll, setAttach, setBackground, setBounds, setBounds, setCursor, setDisabled, setEditor, setEncoding, setFont, setForeground, setHilite, setLayoutMgr, setLocale, setLocation, setName, setSize, setSize, setText, setText, setTip, setTipFont, setTransparent, setValue, setVisible, show, show, size, stop, sync, tick, toBack, toBack, toFront, toFront, toString, update, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delay

protected int delay
The delay in milliseconds between each frame of the animated gif, if the image being used is actually an animating gif.
See Also:
getDelay(), setDelay(int)

oldImages

protected java.util.Vector oldImages
Vector with Image objects that have been previously used, but are not used anymore since the image had to be refreshed. The imageUpdate method returns false whenever it receives an old image, so that image won't be loaded anymore.
See Also:
imageUpdate(java.awt.Image, int, int, int, int, int)
Constructor Detail

AnimatedGifWidget

public AnimatedGifWidget()
Default public constructor.

AnimatedGifWidget

public AnimatedGifWidget(java.lang.String src)
Construct a new animated gif widget with the given image source.
Method Detail

getProperties

public void getProperties(PropertyList list)
Add the delay property to the properties of this widget.
Overrides:
getProperties in class ImageWidget
Following copied from class: marimba.gui.Widget
Parameters:
list - The list in which the current state needs to be saved.
See Also:
Widget.setProperties(PropertyList)

setProperties

public void setProperties(PropertyList list)
Set the properties of this widget, including the delay property.
Overrides:
setProperties in class ImageWidget
Following copied from class: marimba.gui.Widget
Parameters:
list - The list that contains the new widget state.
See Also:
Widget.getProperties(PropertyList)

getDelay

public int getDelay()
Get the delay between each frame in milliseconds.
See Also:
setDelay(int), delay

setDelay

public void setDelay(int delay)
Set the delay between each frame in milliseconds.
Parameters:
delay - the new delay in milliseconds
See Also:
getDelay(), delay

setValue

public void setValue(java.lang.String value)
Store old image before flushing with new value, so imageUpdate can check for that old image and return false on it.
Overrides:
setValue in class ImageWidget
See Also:
imageUpdate(java.awt.Image, int, int, int, int, int)

flush

public void flush()
Flush the image cache. This class stores the old image here before flushing the cache, so imageUpdate can check for that old image and return false on it.
Overrides:
flush in class ImageWidget
See Also:
imageUpdate(java.awt.Image, int, int, int, int, int)

imageUpdate

public boolean imageUpdate(java.awt.Image newimg,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Check whether the next frame of the image is ready.
Overrides:
imageUpdate in class ImageWidget