*** empty log message ***

ajs248 [2001-12-07 10:08:26]
*** empty log message ***
Filename
portal/HabitatPortal.java
services/AlertService.java
services/EventService.java
services/NYCPassListService.java
services/ResidentsListService.java
diff --git a/portal/HabitatPortal.java b/portal/HabitatPortal.java
index ebcb987..e49cceb 100644
--- a/portal/HabitatPortal.java
+++ b/portal/HabitatPortal.java
@@ -22,8 +22,8 @@ import java.util.Hashtable;
 import java.util.Enumeration;

 public class HabitatPortal extends JFrame {
-  private static final int WIDTH = 800;
-  private static final int HEIGHT = 600;
+  private static final int WIDTH = 400;
+  private static final int HEIGHT = 200;
   private static final int CTRL_WIDTH = 200;

   private final Hashtable _portals;
diff --git a/services/AlertService.java b/services/AlertService.java
new file mode 100644
index 0000000..18ac624
--- /dev/null
+++ b/services/AlertService.java
@@ -0,0 +1,71 @@
+package psl.habitats.services;
+import psl.habitats.*;
+
+import javax.swing.*;
+
+import java.util.Date;
+import java.util.Vector;
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+public class AlertService implements ServiceInterface {
+  private static final String myDescription = "AlertService";
+  Habitat masterHabitat = null;
+  public void initialize(Habitat _h) {
+    masterHabitat = _h;
+  }
+  public String getDescription(){
+    return myDescription;
+  }
+  public String getDetailDescription(){
+    StringBuffer _stringBuffer = new StringBuffer();
+    _stringBuffer.setLength(0);
+    _stringBuffer.append("<html><body>");
+    _stringBuffer.append("<h1>" + getDescription() + "</h1>");
+    _stringBuffer.append("<table border=4>");
+    _stringBuffer.append("<tr><td>Purpose</td><td>Hit Panic Button</td></tr>");
+    _stringBuffer.append("<tr><td>Availablity</td><td>Selected</td></tr>");
+    _stringBuffer.append("<tr><td>Monitor</td><td>True</td></tr>");
+    _stringBuffer.append("<tr><td>Monitor-Mode</td><td>Text</td></tr>");
+    _stringBuffer.append("</table>");
+    _stringBuffer.append("</body></html>");
+    return _stringBuffer + "";
+  }
+  private JPanel panel;
+  public JPanel startDisplay() {
+    return (panel = new JPanel());
+  }
+
+  private static final String key1 = "First_Name";
+  private static final String key2 = "Last_Name";
+  private static final String key3 = "Boarding_City";
+  private static final String key4 = "Boarding_Date";
+  private static final String key5 = "Address";
+  private static final String key6 = "Telephone";
+  private static final String key7 = "SSN";
+  private static final String key8 = "Age";
+  private static final String key9 = "Image";
+
+  public Hashtable performService(String _senderService, Hashtable ipList) {
+    StringBuffer _stringBuffer = new StringBuffer();
+    _stringBuffer.setLength(0);
+    _stringBuffer.append("<html><body>\n");
+    _stringBuffer.append("<h1>" + getDescription() + "</h1>\n");
+    _stringBuffer.append("<table border=4>\n");
+    for (Enumeration e=ipList.keys(); e.hasMoreElements(); ) {
+      String key = e.nextElement().toString();
+      if (key.equals(key9)) continue;
+      _stringBuffer.append("<tr><td>"+key+"</td><td>"+ipList.get(key)+"</td></tr>\n");
+    }
+    _stringBuffer.append("<tr><td colspan=2><img src="+ipList.get(key9)+"></td></tr>\n");
+    _stringBuffer.append("</table>\n");
+    _stringBuffer.append("</body></html>\n");
+
+    JLabel label = new JLabel("" + _stringBuffer);
+    JOptionPane.showMessageDialog(panel, label, "Alert Service", JOptionPane.WARNING_MESSAGE);
+    masterHabitat.log("" + _stringBuffer);
+    System.out.println("JUST LOGGED: " + _stringBuffer);
+
+    return null;
+  }
+}
diff --git a/services/EventService.java b/services/EventService.java
index 2ef024f..cd6e546 100644
--- a/services/EventService.java
+++ b/services/EventService.java
@@ -48,13 +48,15 @@ public class EventService implements ServiceInterface {
   private String phaseOneData;
 	public JPanel startDisplay(){
     // start the GUI here
-    final JPanel panel = new JPanel(new BorderLayout());
    final JLabel label = new JLabel("Enter name: ");
-    final JTextField text = new JTextField(20);
    JButton button = new JButton("Search");
-    final JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(label, BorderLayout.WEST);
-    panel2.add(text, BorderLayout.CENTER); 
    panel2.add(button, BorderLayout.EAST);
-
-    panel.add(panel2, BorderLayout.NORTH);
    panel.add(new JLabel("" +
-                         "<html><body>" +
                         "Enter: <input><br>" +
                         "</body></html>"
                         ), BorderLayout.CENTER);
    button.addActionListener(new ActionListener() {
+    final JPanel panel = new JPanel(new GridLayout(10, 1));
+    final JLabel label = new JLabel("Enter name: ");
+    final JTextField text = new JTextField(20);
    JButton button = new JButton("Action!");

    panel.add(new JLabel("FOR USE BY AUTHORISED PERSONNEL!"));
+    {JPanel p = new JPanel(new GridLayout(1, 2));p.add(new JLabel("Type of Event: "));p.add(new JTextField(10));panel.add(p);}
    {JPanel p = new JPanel(new GridLayout(1, 2));p.add(new JLabel("Available Data: "));p.add(new JTextField(10));panel.add(p);}
+    {JPanel p = new JPanel(new GridLayout(1, 2));p.add(new JLabel("Description: "));p.add(new JTextField(10));panel.add(p);}
+    {JPanel p = new JPanel(new GridLayout(1, 2));p.add(label);p.add(text);panel.add(p);}
+    panel.add(button);
+
+    button.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent ae) {
        phaseOneData = text.getText();
        phaseOne();
       }
    });
    return panel;
   }
diff --git a/services/NYCPassListService.java b/services/NYCPassListService.java
index efeab7f..5c75b76 100644
--- a/services/NYCPassListService.java
+++ b/services/NYCPassListService.java
@@ -44,10 +44,10 @@ public class NYCPassListService implements ServiceInterface {
     masterHabitat.log(myDescription + ": performService for " + _senderService);
     Hashtable result = new Hashtable();
     if(ipList.containsKey(key1) || ipList.containsKey(key2)){
-      result.put(key1, lookup(key1, masterHabitat.getName()));
-      result.put(key2, lookup(key2, masterHabitat.getName()));
-      result.put(key3, lookup(key3, masterHabitat.getName()));
-      result.put(key4, lookup(key4, masterHabitat.getName()));
+      result.put(key1, lookup("" + ipList.get(key1), key1, masterHabitat.getName()));
+      result.put(key2, lookup("" + ipList.get(key1), key2, masterHabitat.getName()));
+      result.put(key3, lookup("" + ipList.get(key1), key3, masterHabitat.getName()));
+      result.put(key4, lookup("" + ipList.get(key1), key4, masterHabitat.getName()));
     } else
       result = null;
     masterHabitat.log(myDescription + ": returning requested Data ");
@@ -55,19 +55,24 @@ public class NYCPassListService implements ServiceInterface {
   }

   private static final String HABITAT_NAME = "AmTrak";
-  private String lookup(String key, String forHab) {
+  private String lookup(String key1, String key, String forHab) {
     if (forHab.equals(HABITAT_NAME)) {
-      if (key.equals(key1))
-        return ("John");
-      else if (key.equals(key2))
-        return ("Salasin");
-      else if(key.equals(key3))
-        return ("Texas");
-      else if (key.equals(key4))
-        return new Date().toString();
-      else
-        return null;
-    } else
-      return null;
+      if (key1.equalsIgnoreCase("john")) return "" + johnHash.get(key);
+      if (key1.equalsIgnoreCase("gail")) return "" + gailHash.get(key);
+    }
+    return null;
+  }
+  private static final Hashtable gailHash = new Hashtable();
+  private static final Hashtable johnHash = new Hashtable();
+  static {
+    gailHash.put(key1, "Gail");
+    gailHash.put(key2, "Kaiser");
+    gailHash.put(key3, "Texas");
+    gailHash.put(key4, "Friday morning");
+
+    johnHash.put(key1, "John");
+    johnHash.put(key2, "Salasin");
+    johnHash.put(key3, "Texas");
+    johnHash.put(key4, "Yesterday");
   }
 }
diff --git a/services/ResidentsListService.java b/services/ResidentsListService.java
index 3a32b0c..c3e9ba5 100644
--- a/services/ResidentsListService.java
+++ b/services/ResidentsListService.java
@@ -46,11 +46,11 @@ public class ResidentsListService implements ServiceInterface {
     masterHabitat.log(myDescription + ": performService for " + _senderService);
     Hashtable result = new Hashtable();
     if (ipList.containsKey(key1) && ipList.containsKey(key2)) {
-      result.put(key5, lookup(key1, key5, masterHabitat.getName()));
-      result.put(key6, lookup(key1, key6, masterHabitat.getName()));
-      result.put(key7, lookup(key1, key7, masterHabitat.getName()));
-      result.put(key8, lookup(key1, key8, masterHabitat.getName()));
-      result.put(key9, lookup(key1, key9, masterHabitat.getName()));
+      result.put(key5, lookup("" + ipList.get(key1), key5, masterHabitat.getName()));
+      result.put(key6, lookup("" + ipList.get(key1), key6, masterHabitat.getName()));
+      result.put(key7, lookup("" + ipList.get(key1), key7, masterHabitat.getName()));
+      result.put(key8, lookup("" + ipList.get(key1), key8, masterHabitat.getName()));
+      result.put(key9, lookup("" + ipList.get(key1), key9, masterHabitat.getName()));
     } else
       result = null;
     masterHabitat.log(myDescription + ": returning requested data ");
@@ -81,7 +81,7 @@ public class ResidentsListService implements ServiceInterface {
     johnHash.put(key5, "DARPA");
     johnHash.put(key6, "(800) SAL-ASIN");
     johnHash.put(key7, "987-65-4321");
-    johnHash.put(key8, "http://www.darpa.mil/ito/images/mr-logo.gif");
+    johnHash.put(key8, "http://www.cs.columbia.edu/~ajs248/intropic.jpg");
     johnHash.put(key9, "18");
   }
 }