de.fhg.igd.atlas.ui
Class LSGui

java.lang.Object
  extended byde.fhg.igd.atlas.ui.LSGui
All Implemented Interfaces:
ActionListener, EventListener, Listener, MouseListener, Runnable, WindowListener

public class LSGui
extends Object
implements Runnable, Listener, ActionListener, WindowListener, MouseListener

Provides a GUI of the location service which watches and controls the Location Service Proxy (LSProxy) and Location Service Server (LSServer). This Location Service Gui (LSGui) is used to display the content of locally installed proxy and server storage databases. It's possible to refresh and delete entries or set the timeout for the entries.

Version:
"$Id: LSGui.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
LSAdminService

Field Summary
protected  LSAdminService adminService_
           
protected  JFrame commandFrame_
           
protected  JMenuItem deleteItem_
           
protected  LSPEntry[] entries_
           
protected  TreeMap entriesSorted_
           
private  Object guiEventLock_
           
protected  JButton infoButton_
           
protected  String namePrefix_
           
protected  JPopupMenu popupMenuLong_
           
protected  JPopupMenu popupMenuShort_
           
protected  LSProxyService proxyService_
           
protected  JMenuItem refreshItem_
           
private  boolean running_
           
protected  JScrollPane scrollPane_
           
protected  LSServerService serverService_
           
protected  JMenuItem setTimeoutItem_
           
protected  JMenuItem setTimeoutItem2_
           
protected  JTable table_
           
private  boolean update_
           
private  Object updateLock_
           
private  Object waitLock_
           
protected  String windowName_
           
 
Constructor Summary
LSGui()
          Default constructor to create an instance of this class.
 
Method Summary
 void actionPerformed(ActionEvent a)
          Catches action events from infoButton_, setTimeoutItem_, setTimeoutItem2_, refreshItem_ and deleteItem_.
private  void initGUI()
          Initialize the GUI with a table to display the database entries.
static void main(String[] argv)
          Starts the GUI from command line.
 void mouseClicked(MouseEvent e)
          Catches mouse events within table_ and scrollPain_ used to open an close a context menu.
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void notifiedOf(Object obj)
          This method is called from the proxy's or server's event reflector and informs the class of changes of their database's state.
 void run()
          Searches the LSProxyService and LSServerService locally and opens a GUI for the found components.
private  void updateGUI()
          Updates the GUI by requesting the complete database content
private  void updateGUI(StorageDBEvent event)
          Updates the GUI incrementally by examing the given database
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
          Called after main window has been closed.
 void windowClosing(WindowEvent e)
          Disposes the main window.
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandFrame_

protected transient JFrame commandFrame_

scrollPane_

protected transient JScrollPane scrollPane_

table_

protected transient JTable table_

infoButton_

protected transient JButton infoButton_

popupMenuShort_

protected transient JPopupMenu popupMenuShort_

setTimeoutItem2_

protected transient JMenuItem setTimeoutItem2_

popupMenuLong_

protected transient JPopupMenu popupMenuLong_

setTimeoutItem_

protected transient JMenuItem setTimeoutItem_

refreshItem_

protected transient JMenuItem refreshItem_

deleteItem_

protected transient JMenuItem deleteItem_

serverService_

protected transient LSServerService serverService_

proxyService_

protected transient LSProxyService proxyService_

adminService_

protected transient LSAdminService adminService_

entries_

protected transient LSPEntry[] entries_

entriesSorted_

protected transient TreeMap entriesSorted_

namePrefix_

protected transient String namePrefix_

windowName_

protected transient String windowName_

guiEventLock_

private transient Object guiEventLock_

updateLock_

private transient Object updateLock_

waitLock_

private transient Object waitLock_

update_

private transient boolean update_

running_

private transient boolean running_
Constructor Detail

LSGui

public LSGui()
Default constructor to create an instance of this class.

Method Detail

run

public void run()
Searches the LSProxyService and LSServerService locally and opens a GUI for the found components.

Specified by:
run in interface Runnable

initGUI

private void initGUI()
Initialize the GUI with a table to display the database entries.


updateGUI

private void updateGUI()
Updates the GUI by requesting the complete database content


updateGUI

private void updateGUI(StorageDBEvent event)
Updates the GUI incrementally by examing the given database

Parameters:
event - The database event.

actionPerformed

public void actionPerformed(ActionEvent a)
Catches action events from infoButton_, setTimeoutItem_, setTimeoutItem2_, refreshItem_ and deleteItem_. Used to handle the buttons and context menu items.

Specified by:
actionPerformed in interface ActionListener
Parameters:
a - The action event.

mouseClicked

public void mouseClicked(MouseEvent e)
Catches mouse events within table_ and scrollPain_ used to open an close a context menu.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - The mouse event.

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

windowClosed

public void windowClosed(WindowEvent e)
Called after main window has been closed. Notifies the GUI of this event, that the GUI can terminate (without storing the timeout).

Specified by:
windowClosed in interface WindowListener
Parameters:
e - The window event.

windowClosing

public void windowClosing(WindowEvent e)
Disposes the main window.

Specified by:
windowClosing in interface WindowListener
Parameters:
e - The window event.

windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener

notifiedOf

public void notifiedOf(Object obj)
This method is called from the proxy's or server's event reflector and informs the class of changes of their database's state.

Specified by:
notifiedOf in interface Listener
Parameters:
obj - The object describing the action.

main

public static void main(String[] argv)
Starts the GUI from command line.

Parameters:
argv - The command line parameters.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.