com.maxistech.desktopex
Class SystemTrayTargetAdapter

java.lang.Object
  |
  +--com.maxistech.desktopex.SystemTrayAdapter
        |
        +--com.maxistech.desktopex.SystemTrayTargetAdapter
All Implemented Interfaces:
SystemTrayListener

public class SystemTrayTargetAdapter
extends SystemTrayAdapter

A concrete implementation of SystemTrayListener that shows target component depending on which button is pressed. A component can be displayed for each of the following buttons:

  1. SystemTrayEvent.BUTTON1
  2. SystemTrayEvent.BUTTON2
  3. SystemTrayEvent.BUTTON3

Any AWT or Swing components that inherit from java.awt.Component are supported.


Constructor Summary
SystemTrayTargetAdapter(Component comp1, Component comp2, Component comp3)
          Constructs a new adapter.
 
Method Summary
 Component getButtonComponent(int button)
          Gets the component that will be displayed when a button is pressed.
 boolean isButtonAutoHidden(int button)
          Indicates if a component is hidden automatically when the window that owns this component is deactivated.
 void mouseReleased(SystemTrayEvent e)
          Invoked when a mouse button has been released on a system tray.
 void setButtonComponent(int button, Component comp)
          Sets the component that will be displayed when a button is pressed.
 void setButtonComponent(int button, Component comp, boolean autoHide)
          Sets the component that will be displayed when a button is pressed.
 void setButtonComponentAutoHidden(int button, boolean autoHide)
          Sets if the component is hidden automatically when the window that owns this component is deactivated.
 
Methods inherited from class com.maxistech.desktopex.SystemTrayAdapter
mouseDblClicked, mouseMoved, mousePressed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemTrayTargetAdapter

public SystemTrayTargetAdapter(Component comp1,
                               Component comp2,
                               Component comp3)
Constructs a new adapter.

Parameters:
comp1 - component that will be displayed when SystemTrayEvent.BUTTON1 is pressed.
comp2 - component that will be displayed when SystemTrayEvent.BUTTON2 is pressed.
comp3 - component that will be displayed when SystemTrayEvent.BUTTON3 is pressed.
Method Detail

setButtonComponent

public void setButtonComponent(int button,
                               Component comp,
                               boolean autoHide)
Sets the component that will be displayed when a button is pressed.

Parameters:
button - number
comp - component to be displayed.
autoHide - this component is hidden automatically when the window that owns this component is deactivated.
Throws:
IllegalArgumentException - thrown when button number is invalid.

setButtonComponent

public void setButtonComponent(int button,
                               Component comp)
Sets the component that will be displayed when a button is pressed.

Parameters:
button - number
comp - component to be displayed.
Throws:
IllegalArgumentException - thrown when button number is invalid.

getButtonComponent

public Component getButtonComponent(int button)
Gets the component that will be displayed when a button is pressed.

Parameters:
button - number
Returns:
component to be displayed.
Throws:
IllegalArgumentException - thrown when button number is invalid.
See Also:
setButtonComponent(int, java.awt.Component, boolean)

setButtonComponentAutoHidden

public void setButtonComponentAutoHidden(int button,
                                         boolean autoHide)
Sets if the component is hidden automatically when the window that owns this component is deactivated. (default: true)

Parameters:
button - number
autoHide - this component is hidden automatically when the window that owns
Throws:
IllegalArgumentException - thrown when button number is invalid.

isButtonAutoHidden

public boolean isButtonAutoHidden(int button)
Indicates if a component is hidden automatically when the window that owns this component is deactivated.

Parameters:
button - number
Returns:
true if component is auto hidden.
Throws:
IllegalArgumentException - thrown when button number is invalid.
See Also:
setButtonComponentAutoHidden(int, boolean)

mouseReleased

public final void mouseReleased(SystemTrayEvent e)
Description copied from interface: SystemTrayListener
Invoked when a mouse button has been released on a system tray.

Specified by:
mouseReleased in interface SystemTrayListener
Overrides:
mouseReleased in class SystemTrayAdapter


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