org.viewaframework.util
Class ViewTrayIcon

java.lang.Object
  extended by java.awt.TrayIcon
      extended by org.viewaframework.util.ViewTrayIcon

public class ViewTrayIcon
extends TrayIcon

This is a extended implementation of the java.awt.TrayIcon implementation. It has two JPopupMenu depending on if the user has clicked the tray icon with the right button or with the left button.

Since:
1.0.4
Author:
Mario Garcia

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.TrayIcon
TrayIcon.MessageType
 
Field Summary
static String TRAY_VIEW_MENU_LEFT
           
static String TRAY_VIEW_MENU_RIGHT
           
 
Constructor Summary
ViewTrayIcon(Image image)
          Initializing the tray icon with an image.
ViewTrayIcon(Image image, JPopupMenu right, JPopupMenu left)
          Initializing the tray icon with an image, and both menus.
 
Method Summary
 JPopupMenu getLeftClickMenu()
          Returns the JPopupMenu when clicked with the left button
 JPopupMenu getRightClickMenu()
          Returns the JPopupMenu when clicked with the right button
 void setLeftClickMenu(JPopupMenu leftClickMenu)
          Sets the JPopupMenu when clicked with the left button
 void setPopupMenu(PopupMenu popup)
           
 void setRightClickMenu(JPopupMenu rightClickMenu)
          Sets the JPopupMenu when clicked with the right button
 
Methods inherited from class java.awt.TrayIcon
addActionListener, addMouseListener, addMouseMotionListener, displayMessage, getActionCommand, getActionListeners, getImage, getMouseListeners, getMouseMotionListeners, getPopupMenu, getSize, getToolTip, isImageAutoSize, removeActionListener, removeMouseListener, removeMouseMotionListener, setActionCommand, setImage, setImageAutoSize, setToolTip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRAY_VIEW_MENU_LEFT

public static final String TRAY_VIEW_MENU_LEFT
See Also:
Constant Field Values

TRAY_VIEW_MENU_RIGHT

public static final String TRAY_VIEW_MENU_RIGHT
See Also:
Constant Field Values
Constructor Detail

ViewTrayIcon

public ViewTrayIcon(Image image)
Initializing the tray icon with an image. If the image is null an Exception is thrown.

Parameters:
image -

ViewTrayIcon

public ViewTrayIcon(Image image,
                    JPopupMenu right,
                    JPopupMenu left)
Initializing the tray icon with an image, and both menus. If the image is null an Exception is thrown.

Parameters:
image -
right -
left -
Method Detail

getLeftClickMenu

public JPopupMenu getLeftClickMenu()
Returns the JPopupMenu when clicked with the left button

Returns:

getRightClickMenu

public JPopupMenu getRightClickMenu()
Returns the JPopupMenu when clicked with the right button

Returns:

setLeftClickMenu

public void setLeftClickMenu(JPopupMenu leftClickMenu)
Sets the JPopupMenu when clicked with the left button

Parameters:
leftClickMenu -

setPopupMenu

public void setPopupMenu(PopupMenu popup)
Overrides:
setPopupMenu in class TrayIcon

setRightClickMenu

public void setRightClickMenu(JPopupMenu rightClickMenu)
Sets the JPopupMenu when clicked with the right button

Parameters:
rightClickMenu -


Copyright © 2010. All Rights Reserved.