org.systemsbiology.gaggle.boss
Class GuiBoss

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.systemsbiology.gaggle.boss.GuiBoss
All Implemented Interfaces:
java.awt.event.WindowStateListener, java.io.Serializable, java.rmi.Remote, java.util.EventListener, Boss

public final class GuiBoss
extends java.rmi.server.UnicastRemoteObject
implements Boss, java.awt.event.WindowStateListener, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  javax.swing.JFrame frame
           
protected  java.util.HashMap gooseListeningMap
           
protected  java.util.HashMap<java.lang.String,Goose> gooseMap
           
protected  javax.swing.JTable gooseTable
           
protected  GaggleBossTableModel gooseTableModel
           
protected  NewNameHelper nameHelper
           
protected  javax.swing.JScrollPane scrollPane
           
protected  javax.swing.JTextField searchBox
           
protected  java.lang.String serviceName
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
GuiBoss()
           
GuiBoss(java.lang.String[] args)
           
 
Method Summary
 java.lang.String actuallyRenameGoose(java.lang.String oldName, java.lang.String proposedName)
           
 void addNewGoose(java.lang.String name, Goose goose)
           
 void askForShow(java.lang.String gooseName)
           
 void broadcastCluster(java.lang.String sourceGoose, java.lang.String targetGoose, Cluster cluster)
          Tells the boss to broadcast a Cluster object.
 void broadcastMatrix(java.lang.String sourceGoose, java.lang.String targetGoose, DataMatrix matrix)
          Tells the boss to broadcast a DataMatrix object.
 void broadcastNamelist(java.lang.String sourceGoose, java.lang.String targetGoose, Namelist nameList)
          Tells the boss to broadcast a Namelist object.
 void broadcastNetwork(java.lang.String sourceGoose, java.lang.String targetGoose, Network network)
          Tells the boss to broadcast a Network object.
protected  void broadcastToPlugins(java.lang.String[] names)
           
 void broadcastTuple(java.lang.String sourceGoose, java.lang.String targetGoose, GaggleTuple gaggleTuple)
          Tells the boss to broadcast a GaggleTuple object.
 void cleanUpOnExit(java.lang.String appName)
           
protected  javax.swing.JPanel createButtonsInPanel()
           
protected  java.lang.String createFrameTitle()
           
protected  javax.swing.JPanel createGaggleControlPanel()
           
protected  javax.swing.JPanel createGui()
           
 BossConfig getConfig()
           
 javax.swing.JFrame getFrame()
           
 Goose[] getGeese()
           
 Goose getGoose(java.lang.String name)
           
 java.util.HashMap getGooseMap()
           
 java.lang.String[] getGooseNames()
           
protected  java.lang.String[] getListeningGeese()
           
 NewNameHelper getNameHelper()
           
 void hide(java.lang.String targetGoose)
          Tells the boss to hide the specified goose.
 boolean isListening(java.lang.String gooseName)
           
protected  boolean listening(java.lang.String gooseName)
           
 GaggleBossPlugin loadPlugin(java.lang.String className, GuiBoss gaggleBoss)
           
static void main(java.lang.String[] args)
           
 void refresh()
           
 void refresh(boolean resetTableColumnWidths)
           
 java.lang.String register(DeafGoose deafGoose)
           
 java.lang.String register(Goose goose)
          Adds a new goose to the Gaggle
 java.lang.String renameGoose(java.lang.String oldName, java.lang.String proposedName)
           
protected  void setSelectionCount(java.lang.String gooseName, int count)
           
protected  void setTableColumnWidths()
           
 void show(java.lang.String gooseName)
          Tells the boss to show the specified goose.
 void terminate(java.lang.String gooseName)
          Terminates the specified goose.
 void toggleVisibility()
           
 void unregister(java.lang.String gooseName)
          Unregisters a goose
 void unregister(java.lang.String gooseName, boolean doUpdate)
           
protected  void unregisterIdleGeeseAndUpdate()
          Check to see if we can communicate with all currently registered geese and unregister any that do not respond, then update all geese with the newly derived list of active geese.
 void windowActivated(java.awt.event.WindowEvent event)
           
 void windowClosed(java.awt.event.WindowEvent event)
           
 void windowClosing(java.awt.event.WindowEvent event)
           
 void windowDeactivated(java.awt.event.WindowEvent event)
           
 void windowDeiconified(java.awt.event.WindowEvent event)
           
 void windowGainedFocus(java.awt.event.WindowEvent event)
           
 void windowIconified(java.awt.event.WindowEvent event)
           
 void windowLostFocus(java.awt.event.WindowEvent event)
           
 void windowOpened(java.awt.event.WindowEvent event)
           
 void windowStateChanged(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

frame

protected javax.swing.JFrame frame

gooseTable

protected javax.swing.JTable gooseTable

scrollPane

protected javax.swing.JScrollPane scrollPane

searchBox

protected javax.swing.JTextField searchBox

gooseTableModel

protected GaggleBossTableModel gooseTableModel

serviceName

protected java.lang.String serviceName

nameHelper

protected NewNameHelper nameHelper

gooseMap

protected java.util.HashMap<java.lang.String,Goose> gooseMap

gooseListeningMap

protected java.util.HashMap gooseListeningMap
Constructor Detail

GuiBoss

public GuiBoss()
        throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

GuiBoss

public GuiBoss(java.lang.String[] args)
        throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

getConfig

public BossConfig getConfig()

getNameHelper

public NewNameHelper getNameHelper()
Specified by:
getNameHelper in interface Boss
Returns:
a NewNameHelper object

getFrame

public javax.swing.JFrame getFrame()

windowStateChanged

public void windowStateChanged(java.awt.event.WindowEvent e)
Specified by:
windowStateChanged in interface java.awt.event.WindowStateListener

actuallyRenameGoose

public java.lang.String actuallyRenameGoose(java.lang.String oldName,
                                            java.lang.String proposedName)
                                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

renameGoose

public java.lang.String renameGoose(java.lang.String oldName,
                                    java.lang.String proposedName)
Specified by:
renameGoose in interface Boss

unregisterIdleGeeseAndUpdate

protected void unregisterIdleGeeseAndUpdate()
Check to see if we can communicate with all currently registered geese and unregister any that do not respond, then update all geese with the newly derived list of active geese. This is currently triggered by the refresh button, and also by any goose registering or unregistering or being renamed.


createFrameTitle

protected java.lang.String createFrameTitle()

register

public java.lang.String register(Goose goose)
                          throws java.rmi.RemoteException
Description copied from interface: Boss
Adds a new goose to the Gaggle

Specified by:
register in interface Boss
Parameters:
goose - The goose to be added
Returns:
The uniquified name of the new goose
Throws:
java.rmi.RemoteException - if RMI communication fails

register

public java.lang.String register(DeafGoose deafGoose)
                          throws java.rmi.RemoteException
Specified by:
register in interface Boss
Parameters:
deafGoose - The DeafGoose
Returns:
the uniquified name of the DeafGoose
Throws:
java.rmi.RemoteException - if RMI communication fails

unregister

public void unregister(java.lang.String gooseName)
Unregisters a goose

Specified by:
unregister in interface Boss
Parameters:
gooseName - the name of the goose to unregister

unregister

public void unregister(java.lang.String gooseName,
                       boolean doUpdate)

getGeese

public Goose[] getGeese()

getGoose

public Goose getGoose(java.lang.String name)

getGooseNames

public java.lang.String[] getGooseNames()
Specified by:
getGooseNames in interface Boss
Returns:
list of currently connected geese names

getGooseMap

public java.util.HashMap getGooseMap()

broadcastToPlugins

protected void broadcastToPlugins(java.lang.String[] names)

broadcastNamelist

public void broadcastNamelist(java.lang.String sourceGoose,
                              java.lang.String targetGoose,
                              Namelist nameList)
                       throws java.rmi.RemoteException
Description copied from interface: Boss
Tells the boss to broadcast a Namelist object.

Specified by:
broadcastNamelist in interface Boss
Parameters:
sourceGoose - The name of the goose originating the broadcast
targetGoose - The name of the goose to receive the broadcast. If this is "boss", all listening geese will receive the broadcast.
nameList - The NameList object
Throws:
java.rmi.RemoteException - if RMI communication fails

broadcastMatrix

public void broadcastMatrix(java.lang.String sourceGoose,
                            java.lang.String targetGoose,
                            DataMatrix matrix)
                     throws java.rmi.RemoteException
Description copied from interface: Boss
Tells the boss to broadcast a DataMatrix object.

Specified by:
broadcastMatrix in interface Boss
Parameters:
sourceGoose - The name of the goose originating the broadcast
targetGoose - The name of the goose to receive the broadcast. If this is "boss", all listening geese will receive the broadcast.
matrix - The DataMatrix object
Throws:
java.rmi.RemoteException - if RMI communication fails

broadcastTuple

public void broadcastTuple(java.lang.String sourceGoose,
                           java.lang.String targetGoose,
                           GaggleTuple gaggleTuple)
Description copied from interface: Boss
Tells the boss to broadcast a GaggleTuple object.

Specified by:
broadcastTuple in interface Boss
Parameters:
sourceGoose - The name of the goose originating the broadcast
targetGoose - The name of the goose to receive the broadcast. If this is "boss", all listening geese will receive the broadcast.
gaggleTuple - the GaggleTuple object

broadcastCluster

public void broadcastCluster(java.lang.String sourceGoose,
                             java.lang.String targetGoose,
                             Cluster cluster)
Description copied from interface: Boss
Tells the boss to broadcast a Cluster object.

Specified by:
broadcastCluster in interface Boss
Parameters:
sourceGoose - The name of the goose originating the broadcast
targetGoose - The name of the goose to receive the broadcast. If this is "boss", all listening geese will receive the broadcast.
cluster - the Cluster object

broadcastNetwork

public void broadcastNetwork(java.lang.String sourceGoose,
                             java.lang.String targetGoose,
                             Network network)
Description copied from interface: Boss
Tells the boss to broadcast a Network object.

Specified by:
broadcastNetwork in interface Boss
Parameters:
sourceGoose - The name of the goose originating the broadcast
targetGoose - The name of the goose to receive the broadcast. If this is "boss", all listening geese will receive the broadcast.
network - the Network object

cleanUpOnExit

public void cleanUpOnExit(java.lang.String appName)
                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

hide

public void hide(java.lang.String targetGoose)
          throws java.rmi.RemoteException
Description copied from interface: Boss
Tells the boss to hide the specified goose.

Specified by:
hide in interface Boss
Parameters:
targetGoose - The name of the goose to hide
Throws:
java.rmi.RemoteException - if RMI communication fails

show

public void show(java.lang.String gooseName)
          throws java.rmi.RemoteException
Description copied from interface: Boss
Tells the boss to show the specified goose.

Specified by:
show in interface Boss
Parameters:
gooseName - The name of the goose to show
Throws:
java.rmi.RemoteException - if RMI communication fails

askForShow

public void askForShow(java.lang.String gooseName)
                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

terminate

public void terminate(java.lang.String gooseName)
               throws java.rmi.RemoteException
Description copied from interface: Boss
Terminates the specified goose.

Specified by:
terminate in interface Boss
Parameters:
gooseName - The name of the goose to terminate
Throws:
java.rmi.RemoteException - if RMI communication fails

toggleVisibility

public void toggleVisibility()

createGui

protected javax.swing.JPanel createGui()

createGaggleControlPanel

protected javax.swing.JPanel createGaggleControlPanel()

createButtonsInPanel

protected javax.swing.JPanel createButtonsInPanel()

setTableColumnWidths

protected void setTableColumnWidths()

getListeningGeese

protected java.lang.String[] getListeningGeese()

listening

protected boolean listening(java.lang.String gooseName)

setSelectionCount

protected void setSelectionCount(java.lang.String gooseName,
                                 int count)

refresh

public void refresh()

refresh

public void refresh(boolean resetTableColumnWidths)

windowClosed

public void windowClosed(java.awt.event.WindowEvent event)

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)

windowOpened

public void windowOpened(java.awt.event.WindowEvent event)

windowIconified

public void windowIconified(java.awt.event.WindowEvent event)

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent event)

windowActivated

public void windowActivated(java.awt.event.WindowEvent event)

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent event)

windowGainedFocus

public void windowGainedFocus(java.awt.event.WindowEvent event)

windowLostFocus

public void windowLostFocus(java.awt.event.WindowEvent event)

addNewGoose

public void addNewGoose(java.lang.String name,
                        Goose goose)

isListening

public boolean isListening(java.lang.String gooseName)

loadPlugin

public GaggleBossPlugin loadPlugin(java.lang.String className,
                                   GuiBoss gaggleBoss)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception