de.upb.swtpra05.group03.companycontrol.plugin
Class PluginBase

java.lang.Object
  extended byde.upb.swtpra05.group03.companycontrol.plugin.PluginBase
Direct Known Subclasses:
ShuttleInformationPlugin, TurnierPlugin

public class PluginBase
extends java.lang.Object

The Base Class all Plugins must inherit. For a working Plugin the Method "getPluginPanel" must be overridden. The other Methods can be overridden depending on the Purpose of the Plugin. Please be sure to also override the Method "getName" so the right Name of the Plugin is returned.

Version:
$Revision: 1.3 $

Field Summary
private  CompanyControlClient client
          Reference to the CompanyControlClient.
(package private)  java.lang.String name
          Default Name.
(package private)  javax.swing.JPanel pluginPanel
          The Panel of the Plugin.
 
Constructor Summary
PluginBase()
          Constructor
 
Method Summary
 java.lang.String getName()
          Returns the Name of the Plugin.
 javax.swing.JPanel getPluginPanel()
          Returns the Plugins Panel.
protected  void sendMessage(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj msg)
          Lets PLugins send Messages to the Kernel
 void setClient(CompanyControlClient client)
          Sets the Reference to the CompanyControlClient.
 void setCompanyID(int ID)
          Sets the CompanyID.
 void setKerneltoShuttleIDMap(java.util.HashMap map)
          Sets the KernelIDtoShuttleAgendID HashMap.
 void shuttleSelected(int ID)
          Invoced if a User selects a Shuttle.
 void stationSelected(int ID)
          Invoced if a User selects a Station.
 void update(de.upb.swtpra.kernel.visualisation.RemoteObj msg)
          Update Method which is invoced every Time a Message is received by the Client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginPanel

javax.swing.JPanel pluginPanel
The Panel of the Plugin. Plugin should define a Panel on its own.


name

java.lang.String name
Default Name. Plugin should define a name on its own.


client

private CompanyControlClient client
Reference to the CompanyControlClient.

Constructor Detail

PluginBase

public PluginBase()
Constructor

Method Detail

setClient

public final void setClient(CompanyControlClient client)
Sets the Reference to the CompanyControlClient.

Parameters:
client -

sendMessage

protected final void sendMessage(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj msg)
Lets PLugins send Messages to the Kernel

Parameters:
msg -

getPluginPanel

public javax.swing.JPanel getPluginPanel()
Returns the Plugins Panel. Plugin should override this Method if it has a GUI.

Returns:
JPanel

setCompanyID

public void setCompanyID(int ID)
Sets the CompanyID. Plugin may override this if ID is needed.

Parameters:
ID -

setKerneltoShuttleIDMap

public void setKerneltoShuttleIDMap(java.util.HashMap map)
Sets the KernelIDtoShuttleAgendID HashMap.

Parameters:
map -

getName

public java.lang.String getName()
Returns the Name of the Plugin. Plugins should override this so they do not return the Default Name

Returns:
Name

update

public void update(de.upb.swtpra.kernel.visualisation.RemoteObj msg)
Update Method which is invoced every Time a Message is received by the Client. Plugins should override this Method.

Parameters:
msg -

shuttleSelected

public void shuttleSelected(int ID)
Invoced if a User selects a Shuttle.

Parameters:
ID -

stationSelected

public void stationSelected(int ID)
Invoced if a User selects a Station.

Parameters:
ID -