com.maxistech.desktopex
Class SystemTray

java.lang.Object
  |
  +--com.maxistech.desktopex.SystemTray

public abstract class SystemTray
extends Object

A platform independent system tray icon. Image formats supported are GIF, JPG, and PNG, Windows Bitmap (BMP), and Windows Icon (ICO).


Method Summary
 void add()
          Adds this system tray.
 void addSystemTrayListener(SystemTrayListener l)
          Adds a listener to system tray notification events.
 String[] getIconAsFileName()
          Gets the registered icon(s) as file names.
 long getIconRotationInterval()
          Gets the time interval (in milliseconds) between icon rotation.
 String getToolTipText()
          Gets the registered tool tip.
 Rectangle getWorkAreaBounds(Rectangle rect)
          Gets the bounds of work area.
 boolean isAdded()
          Indicates if this system tray is added.
 boolean isIconRotationWrapped()
          Indicates if icon rotation will wrap around.
static SystemTray newInstance(String tooltip)
          Creates a new platform-specific instance of system tray.
static SystemTray newInstance(String tooltip, String iconFileName)
          Creates a new platform-specific instance of system tray.
 void remove()
          Removes this system tray.
 void removeSystemTrayListener(SystemTrayListener l)
          Removes a registered listener to system tray notification events.
 void setIconAsFileName(String iconFileName)
          Registers a single icon to display that is obtained from a file of the specified name
 void setIconAsFileName(String[] iconFileNames)
          Registers a list of icons to display that are obtained from files of the specified names.
 void setIconAsResourceName(String resourceName)
          Registers a single icon to display that is obtained from a resource of the specified name from the search path used to load classes.
 void setIconAsResourceName(String[] resourceNames)
          Registers a list of icons to display that are obtained from resources of the specified names from the search path used to load classes.
 void setIconRotationInterval(long interval)
          Sets the time interval (in milliseconds) between icon rotation.
 void setIconRotationWrapped(boolean wrapped)
          Sets if icon rotation will wrap around.
 void setToolTipText(String tooltip)
          Registers the text to display in a tool tip.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static SystemTray newInstance(String tooltip)
Creates a new platform-specific instance of system tray.

Parameters:
tooltip - text of tool tip of this system tray.

newInstance

public static SystemTray newInstance(String tooltip,
                                     String iconFileName)
Creates a new platform-specific instance of system tray.

Parameters:
tooltip - text of tool tip of this system tray.
iconFileName - file name of the icon of this system tray.

setIconRotationWrapped

public void setIconRotationWrapped(boolean wrapped)
Sets if icon rotation will wrap around. (default: true)


isIconRotationWrapped

public boolean isIconRotationWrapped()
Indicates if icon rotation will wrap around.


setIconRotationInterval

public void setIconRotationInterval(long interval)
Sets the time interval (in milliseconds) between icon rotation. (default: 1000, i.e. 1 second).


getIconRotationInterval

public long getIconRotationInterval()
Gets the time interval (in milliseconds) between icon rotation.


setToolTipText

public void setToolTipText(String tooltip)
Registers the text to display in a tool tip.


getToolTipText

public String getToolTipText()
Gets the registered tool tip.


setIconAsResourceName

public final void setIconAsResourceName(String resourceName)
Registers a single icon to display that is obtained from a resource of the specified name from the search path used to load classes.

Parameters:
resourceName - resource name
See Also:
ClassLoader.getSystemResource(java.lang.String)

setIconAsFileName

public final void setIconAsFileName(String iconFileName)
Registers a single icon to display that is obtained from a file of the specified name

Parameters:
iconFileName - name of the file that contains the icon.

setIconAsResourceName

public final void setIconAsResourceName(String[] resourceNames)
Registers a list of icons to display that are obtained from resources of the specified names from the search path used to load classes. If more than one icon are specified, the icons will be displayed in rotation.

Parameters:
resourceNames - a list of resource names that contains icons

setIconAsFileName

public final void setIconAsFileName(String[] iconFileNames)
Registers a list of icons to display that are obtained from files of the specified names. If the number of icons is greater than one, the icons will be displayed in rotation.


getIconAsFileName

public String[] getIconAsFileName()
Gets the registered icon(s) as file names.


add

public void add()
Adds this system tray.


remove

public void remove()
Removes this system tray.


isAdded

public boolean isAdded()
Indicates if this system tray is added.


getWorkAreaBounds

public Rectangle getWorkAreaBounds(Rectangle rect)
Gets the bounds of work area. Work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars.

Parameters:
rect - rectangle that holds the bounds of the work area. If provided, it is the rectangle being returned.
Returns:
rectangle that holds the bounds of the work area.

addSystemTrayListener

public void addSystemTrayListener(SystemTrayListener l)
Adds a listener to system tray notification events.


removeSystemTrayListener

public void removeSystemTrayListener(SystemTrayListener l)
Removes a registered listener to system tray notification events.



Copyright (c) 2001-2002 mAxis Technology Company. All Rights Reserved.