de.scheisseichfindemalkeinen.systemtray
Class SystemTrayTool

java.lang.Object
  extended by de.scheisseichfindemalkeinen.systemtray.SystemTrayTool
All Implemented Interfaces:
IQueueDataListener, ISettingsListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.util.EventListener

public class SystemTrayTool
extends java.lang.Object
implements java.awt.event.ActionListener, IQueueDataListener, java.awt.event.MouseListener, java.awt.event.ItemListener, ISettingsListener

Class which handles the SystemTray


Constructor Summary
SystemTrayTool()
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addSystemTrayListener(ISystemTrayListener l)
          Adds a listener
 void init()
          Initializes the SystemTray, but does not show the trayicon
static boolean isTraySupported()
          Checks if SystemTray is supported or not
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void queueChanged(int queue, int openSlots, int maxSlots)
          Download-Slots has changed.
 void remove()
          Removes the icon from the SystemTray
 void removeSystemTrayListener(ISystemTrayListener l)
          Removes a listener
 void sessionDownloadedBytesChanged(long count)
          Changes of the count of downloaded bytes since application started
 void sessionDownloadedFilesChanged(int count)
          Changes of the count of downloaded files since application started
 void settingsChanged()
          This method is fired when settings had changed
 void showTrayIcon()
          Now, here we add the icon to the SystemTray and register Listeners for the menuitems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemTrayTool

public SystemTrayTool()
Constructor

Method Detail

isTraySupported

public static boolean isTraySupported()
Checks if SystemTray is supported or not

Returns:
True if supported

init

public void init()
Initializes the SystemTray, but does not show the trayicon


showTrayIcon

public void showTrayIcon()
Now, here we add the icon to the SystemTray and register Listeners for the menuitems


remove

public void remove()
Removes the icon from the SystemTray


addSystemTrayListener

public void addSystemTrayListener(ISystemTrayListener l)
Adds a listener

Parameters:
l - Listener

removeSystemTrayListener

public void removeSystemTrayListener(ISystemTrayListener l)
Removes a listener

Parameters:
l - Listener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

queueChanged

public void queueChanged(int queue,
                         int openSlots,
                         int maxSlots)
Description copied from interface: IQueueDataListener
Download-Slots has changed.

Specified by:
queueChanged in interface IQueueDataListener
Parameters:
queue - Amount of downloads in the queue
openSlots - Free download-slots
maxSlots - Maximum download-slots

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

settingsChanged

public void settingsChanged()
Description copied from interface: ISettingsListener
This method is fired when settings had changed

Specified by:
settingsChanged in interface ISettingsListener

sessionDownloadedBytesChanged

public void sessionDownloadedBytesChanged(long count)
Description copied from interface: IQueueDataListener
Changes of the count of downloaded bytes since application started

Specified by:
sessionDownloadedBytesChanged in interface IQueueDataListener
Parameters:
count - Count of downloaded bytes

sessionDownloadedFilesChanged

public void sessionDownloadedFilesChanged(int count)
Description copied from interface: IQueueDataListener
Changes of the count of downloaded files since application started

Specified by:
sessionDownloadedFilesChanged in interface IQueueDataListener
Parameters:
count - Count of downloaded files