com.jmo.mailmessager.utils
Class MailMessagerIconAnimator

java.lang.Object
  extended by java.lang.Thread
      extended by com.jmo.mailmessager.utils.MailMessagerIconAnimator
All Implemented Interfaces:
java.lang.Runnable

public class MailMessagerIconAnimator
extends java.lang.Thread

Used to spawn a thread for animation of rotating "thinking" icons as well as rotating icons of mail accounts that contain new email messages.

Version:
0.0.1
Author:
John Morales
See Also:
MailMessagerTray, MailMessagerConstants, MailMessagerController

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MailMessagerIconAnimator()
          Creates MailMessagerIconAnimator to be used for animating busy icons.
MailMessagerIconAnimator(java.lang.String[] imageFilenames)
          Creates MailMessagerIconAnimator to be used for animating email provider icons where that provider has new email messages.
 
Method Summary
 void end(int opt)
          Tells the current Animator thread to gracefully stop.
static boolean isProcessing()
          Returns whether the IconAnimator instance is performing a provider animation or a busy animation.
 void run()
          Main thread to perform the specified type of System Tray icon animation.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailMessagerIconAnimator

public MailMessagerIconAnimator()
Creates MailMessagerIconAnimator to be used for animating busy icons.


MailMessagerIconAnimator

public MailMessagerIconAnimator(java.lang.String[] imageFilenames)
Creates MailMessagerIconAnimator to be used for animating email provider icons where that provider has new email messages.

Parameters:
imageFilenames - Array of image filesnames of providers with new messages.
Method Detail

run

public void run()
Main thread to perform the specified type of System Tray icon animation.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isProcessing

public static boolean isProcessing()
Returns whether the IconAnimator instance is performing a provider animation or a busy animation. Can be used to determine if a refresh is currently taking place so another one doesn't start.

Returns:
True if thread is performing a busy animation, False if a provider animation

end

public void end(int opt)
Tells the current Animator thread to gracefully stop. NOTE: Do NOT use a thread interrupt to stop animating the Icon. If the interrupt should occur during the WindowsTrayIcon.setImage(...) pixelgrab, the WindowsTrayIcon will disappear and become unrecoverable.

Parameters:
opt - Index into array for which default ICONS and TOOLTIPS element to display.