diff options
author | Romain Kuntz <rkuntz@java.net> | 2007-10-24 15:07:46 +0000 |
---|---|---|
committer | Romain Kuntz <rkuntz@java.net> | 2007-10-24 15:07:46 +0000 |
commit | 62b58e28b6aad237bb8ac1a63155cd591629261a (patch) | |
tree | 9c3421cd569bcd6f01e20e4e1f97042ff9d9e691 /src/net/java/sip/communicator/impl/systray/jdic | |
parent | eee50a66d7495329396d6719621d4c88230f9223 (diff) | |
download | jitsi-62b58e28b6aad237bb8ac1a63155cd591629261a.zip jitsi-62b58e28b6aad237bb8ac1a63155cd591629261a.tar.gz jitsi-62b58e28b6aad237bb8ac1a63155cd591629261a.tar.bz2 |
The systray implementation now takes care of selecting the correct icon to display according to the OS type. Other plugins do not have to take care of the OS type when they want to change the icon, and just need to call setSystrayIcon() with the correct Image type identifier.
Diffstat (limited to 'src/net/java/sip/communicator/impl/systray/jdic')
-rw-r--r-- | src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java index 52a5fda..05dcfc0 100644 --- a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java +++ b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java @@ -75,7 +75,11 @@ public class SystrayServiceJdicImpl private static Logger logger = Logger.getLogger(SystrayServiceJdicImpl.class.getName()); + /** + * The various icons used on the systray + */ private ImageIcon logoIcon; + private ImageIcon envelopeIcon; /** * Creates an instance of <tt>Systray</tt>. @@ -115,16 +119,24 @@ public class SystrayServiceJdicImpl { logoIcon = new ImageIcon( Resources.getImage("trayIconWindows")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIconWindows")); } + // If we're running under MacOSX, we use a special back and + // white icons without background. else if (osName.startsWith("Mac OS X")) { logoIcon = new ImageIcon( Resources.getImage("trayIconMacOSX")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIconMacOSX")); } else { logoIcon = new ImageIcon( Resources.getImage("trayIcon")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIcon")); } trayIcon = new TrayIcon(logoIcon, "SIP Communicator", menu); @@ -322,12 +334,18 @@ public class SystrayServiceJdicImpl /** * Sets a new Systray icon. * - * @param image the icon to set. + * @param imageType the type of the image to set. */ - public void setSystrayIcon(byte[] image) + public void setSystrayIcon(int imageType) { - if (image != null) - this.trayIcon.setIcon(new ImageIcon(image)); + if (imageType == SystrayService.SC_IMG_TYPE) + { + this.trayIcon.setIcon(logoIcon); + } + else if (imageType == SystrayService.ENVELOPE_IMG_TYPE) + { + this.trayIcon.setIcon(envelopeIcon); + } } /** |