nl.tue.id.tim
Class PresenceWatcher

java.lang.Object
  extended bynl.tue.id.tim.PresenceWatcher
All Implemented Interfaces:
com.valhalla.pluginmanager.Plugin, com.valhalla.pluginmanager.PluginEventListener

public class PresenceWatcher
extends java.lang.Object
implements com.valhalla.pluginmanager.Plugin, com.valhalla.pluginmanager.PluginEventListener

TIM Presence Watcher.

Description: a plugin for JBother that watches and changes the status change of the user and the buddies.

Copyright: Copyright (c) 2005 Jun Hu

Company: ID, TU/e

Version:
1.0
Author:
Jun Hu

Field Summary
(package private)  ControlPanel cp
          a GUI control panel to show and change the stadus of the user and the buddies.
private  java.util.ResourceBundle resources
          i18n translation resources from JBother
 
Constructor Summary
PresenceWatcher()
           
 
Method Summary
private  void buddyPresenceModeHandler(com.valhalla.jbother.plugins.events.BuddyPresenceModeEvent pluginEvent)
          buddyPresenceModeHandler
private  void currentPresenceModeHandler(com.valhalla.jbother.plugins.events.CurrentPresenceModeEvent pluginEvent)
          currentPresenceModeHandler
private  void exitingHandler(com.valhalla.jbother.plugins.events.ExitingEvent event)
          when existing, let the control panel save its screen positions and dimenstions.
private  java.lang.String getStatus(org.jivesoftware.smack.packet.Presence.Mode mode)
          return description of a certain presence mode.
 void handleEvent(com.valhalla.pluginmanager.PluginEvent pluginEvent)
          this plugin handles three events: the presence change of the user, the presence change of a buddy, and exisiting.
 boolean init()
          when load the plugin, show the control panel and register this plugin to the plugin event chain.
 void unload()
          Unloads the plugin. remove it from the plugin event chain. hide the control panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

private java.util.ResourceBundle resources
i18n translation resources from JBother


cp

ControlPanel cp
a GUI control panel to show and change the stadus of the user and the buddies.

Constructor Detail

PresenceWatcher

public PresenceWatcher()
Method Detail

init

public boolean init()
when load the plugin, show the control panel and register this plugin to the plugin event chain.

Specified by:
init in interface com.valhalla.pluginmanager.Plugin
Returns:
boolean

unload

public void unload()
Unloads the plugin. remove it from the plugin event chain. hide the control panel.

Specified by:
unload in interface com.valhalla.pluginmanager.Plugin

handleEvent

public void handleEvent(com.valhalla.pluginmanager.PluginEvent pluginEvent)
this plugin handles three events: the presence change of the user, the presence change of a buddy, and exisiting.

Specified by:
handleEvent in interface com.valhalla.pluginmanager.PluginEventListener
Parameters:
pluginEvent - PluginEvent

exitingHandler

private void exitingHandler(com.valhalla.jbother.plugins.events.ExitingEvent event)
when existing, let the control panel save its screen positions and dimenstions.

Parameters:
event - ExitingEvent

buddyPresenceModeHandler

private void buddyPresenceModeHandler(com.valhalla.jbother.plugins.events.BuddyPresenceModeEvent pluginEvent)
buddyPresenceModeHandler

Parameters:
pluginEvent - BuddyPresenceModeEvent

currentPresenceModeHandler

private void currentPresenceModeHandler(com.valhalla.jbother.plugins.events.CurrentPresenceModeEvent pluginEvent)
currentPresenceModeHandler

Parameters:
pluginEvent - CurrentPresenceModeEvent

getStatus

private java.lang.String getStatus(org.jivesoftware.smack.packet.Presence.Mode mode)
return description of a certain presence mode.

Parameters:
mode - Mode
Returns:
String