abbot.editor.widgets
Class AbstractAnimatedIcon

java.lang.Object
  extended by abbot.editor.widgets.AnimatedIcon
      extended by abbot.editor.widgets.AbstractAnimatedIcon
All Implemented Interfaces:
Icon
Direct Known Subclasses:
SpinningDial

public abstract class AbstractAnimatedIcon
extends AnimatedIcon

Provide animation of auto-generated animations. Makes use of the repaint tracking structure established by AnimatedIcon.


Constructor Summary
protected AbstractAnimatedIcon()
           
protected AbstractAnimatedIcon(int frameCount)
           
protected AbstractAnimatedIcon(int frameCount, int interval)
           
 
Method Summary
protected  void finalize()
          Ensure the timer stops running, so it, too can be GC'd.
 int getFrame()
          Returns the current animation frame number.
 int getFrameCount()
          Returns the total number of frames.
 int getFrameInterval()
           
abstract  int getIconHeight()
           
abstract  int getIconWidth()
           
 void nextFrame()
          Advance to the next animation frame.
protected abstract  void paintFrame(Component c, Graphics g, int x, int y)
          Implement this method to paint the icon.
protected  void registerRepaintArea(Component c, int x, int y, int w, int h)
          Register repaint areas, which get get cleared once the repaint request has been queued.
 void setFrame(int f)
          Set the current animation frame number.
 void setFrameInterval(int interval)
          Setting a frame interval of zero stops automatic animation.
 
Methods inherited from class abbot.editor.widgets.AnimatedIcon
isAnimated, paintIcon, repaint
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnimatedIcon

protected AbstractAnimatedIcon()

AbstractAnimatedIcon

protected AbstractAnimatedIcon(int frameCount)

AbstractAnimatedIcon

protected AbstractAnimatedIcon(int frameCount,
                               int interval)
Method Detail

finalize

protected void finalize()
Ensure the timer stops running, so it, too can be GC'd.

Overrides:
finalize in class Object

setFrameInterval

public void setFrameInterval(int interval)
Setting a frame interval of zero stops automatic animation.


getFrameInterval

public int getFrameInterval()

getFrameCount

public int getFrameCount()
Returns the total number of frames.


nextFrame

public void nextFrame()
Advance to the next animation frame.


setFrame

public void setFrame(int f)
Set the current animation frame number.


getFrame

public int getFrame()
Returns the current animation frame number.


paintFrame

protected abstract void paintFrame(Component c,
                                   Graphics g,
                                   int x,
                                   int y)
Implement this method to paint the icon.

Overrides:
paintFrame in class AnimatedIcon

getIconWidth

public abstract int getIconWidth()
Specified by:
getIconWidth in interface Icon
Overrides:
getIconWidth in class AnimatedIcon

getIconHeight

public abstract int getIconHeight()
Specified by:
getIconHeight in interface Icon
Overrides:
getIconHeight in class AnimatedIcon

registerRepaintArea

protected void registerRepaintArea(Component c,
                                   int x,
                                   int y,
                                   int w,
                                   int h)
Description copied from class: AnimatedIcon
Register repaint areas, which get get cleared once the repaint request has been queued.

Overrides:
registerRepaintArea in class AnimatedIcon


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge