abbot.editor.widgets
Class AnimatedIcon

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

public class AnimatedIcon
extends Object
implements Icon

Ensures animated icons are properly handled within objects that use renderers within a CellRendererPane to render the icon. Keeps a list of repaint rectangles to be used to queue repaint requests when the animated icon indicates an update. The set of repaint rectangles is cleared after the repaint requests are queued.

Author:
twall

Constructor Summary
protected AnimatedIcon()
          For use by derived classes that don't have an original.
  AnimatedIcon(ImageIcon original)
          Create an icon that takes care of animating itself on components which use a CellRendererPane.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
static boolean isAnimated(Icon icon)
          Returns whether the given icon is an animated GIF.
protected  void paintFrame(Component c, Graphics g, int x, int y)
           
 void paintIcon(Component c, Graphics g, int x, int y)
           
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.
protected  void repaint()
          Trigger a repaint on all components on which we've previously been painted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimatedIcon

protected AnimatedIcon()
For use by derived classes that don't have an original.


AnimatedIcon

public AnimatedIcon(ImageIcon original)
Create an icon that takes care of animating itself on components which use a CellRendererPane.

Method Detail

isAnimated

public static boolean isAnimated(Icon icon)
Returns whether the given icon is an animated GIF.


repaint

protected void repaint()
Trigger a repaint on all components on which we've previously been painted.


getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

paintFrame

protected void paintFrame(Component c,
                          Graphics g,
                          int x,
                          int y)

registerRepaintArea

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.



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

SourceForge