Index: trunk/src/tmcsim/client/cadclientgui/screens/Login.java
===================================================================
--- trunk/src/tmcsim/client/cadclientgui/screens/Login.java	(revision 289)
+++ trunk/src/tmcsim/client/cadclientgui/screens/Login.java	(revision 532)
@@ -1,4 +1,5 @@
 package tmcsim.client.cadclientgui.screens;
 
+import java.awt.BorderLayout;
 import java.awt.Color;
 import static java.awt.Component.LEFT_ALIGNMENT;
@@ -9,7 +10,22 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Scanner;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
+import javax.swing.ImageIcon;
 import javax.swing.JButton;
+import javax.swing.JComboBox;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
@@ -26,16 +42,63 @@
  * @author Vincent
  */
-public class Login extends JFrame implements KeyListener
+public class Login extends JFrame
 {
     private Box login;
-    private JTextField userNameField;
+    private JComboBox<String> userNameCombo;
     private JTextField passwordField;
     public static String kNamePrompt = "Enter your name";
-
-    public Login()
-    {
+    /** a list of student names that will be displayed on the login screen */
+    private Vector<String> students;
+    
+    public Login(String studentNamesFile)
+    {
+        readNamesFile(studentNamesFile);
         initView();
     }
 
+    /** 
+     * A list of student names is read from a file.  The intent is to allow the
+     * system operators to customize the login display for each training session
+     * with the names of participants in that training. 
+     * @param studentNamesFile the full path to a text file of student names
+     * @author jdalbey  ticket #206
+     */
+    private void readNamesFile(String studentNamesFile)
+    {
+        FileInputStream fis = null;
+        try {
+            // Prepare an input stream from the names file
+            fis = new FileInputStream(studentNamesFile);
+            // Scan the names into a string
+            Scanner s = new Scanner(fis).useDelimiter("\\A");
+            String out = s.next();
+            // split string into an array
+            String[] results = out.split("\\n");
+            // Initialize the student name list
+            students = new Vector();
+            // Make sure to truncate names before putting in list
+            for (String name: results)
+            {
+                String truncName = name.trim();
+                // Limit name length so it fits in the combo box
+                if (truncName.length() > 26)
+                {
+                    truncName = truncName.substring(0,25);
+                }
+                // Add the validated name to the list of students
+                students.add(truncName);
+            }
+            // Append the default name 
+            students.add("Anonymous Trainee");
+        } catch (FileNotFoundException ex) {
+            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
+        } finally {
+            try {
+                fis.close();
+            } catch (IOException ex) {
+                Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
+    }
     private ActionListener newEnterActionListener()
     {
@@ -45,14 +108,7 @@
             {
                 setVisible(false);
-                // Check if user provided a username JD
-                String userEntry = userNameField.getText();
-                if (userEntry.equals(kNamePrompt))
-                {
-                    ScreenManager.setUserName("Anonymous Trainee");
-                }
-                else
-                {
-                    ScreenManager.setUserName(userEntry);
-                }
+                // Extract the selected student name from the combo box
+                String userEntry = (String) userNameCombo.getSelectedItem();
+                ScreenManager.setUserName(userEntry);
                 ScreenManager.openCADMenu();
                 ScreenManager.openAssignedIncidents();
@@ -60,4 +116,5 @@
                 ScreenManager.openPendingIncidents();
                 ScreenManager.openPowerlineUI();
+                // a secret password allows special permission
                 if (!passwordField.getText().equals("Dispatcher"))
                 {
@@ -81,7 +138,15 @@
     private void initView()
     {
+        // create a combo box containing the student names
+        userNameCombo = new JComboBox<String>(students);
+        // Create a scrollbar after ten names
+        userNameCombo.setMaximumRowCount(10);
+        userNameCombo.setForeground(Color.BLUE);
+        userNameCombo.setFont(new Font("Arial", Font.BOLD, 14));
+        
         login = new Box(BoxLayout.Y_AXIS);
         login.setAlignmentX(LEFT_ALIGNMENT);
         JPanel whiteBackground = new JPanel();
+        whiteBackground.setLayout(new BorderLayout());
         whiteBackground.setAlignmentX(LEFT_ALIGNMENT);
         whiteBackground.setBackground(Color.WHITE);
@@ -89,4 +154,12 @@
         whiteBackground.setMinimumSize(new Dimension(750, 150));
         whiteBackground.setPreferredSize(new Dimension(750, 150));
+        // Add TriTech banner to top of screen (ticket #205)
+        try {
+            BufferedImage myPicture = ImageIO.read(new File("images/TritechLoginBanner.png"));
+            JLabel picLabel = new JLabel(new ImageIcon(myPicture));
+            whiteBackground.add(picLabel, BorderLayout.CENTER);
+        } catch (IOException ex) {
+            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
+        }
         login.add(whiteBackground);
 
@@ -134,12 +207,9 @@
         JLabel userNameLabel = new JLabel("User name ");
         userNameLabel.setForeground(Color.WHITE);
-        userNameField = new JTextField(kNamePrompt);
-        userNameField.addKeyListener(this);
-        userNameField.setForeground(Color.GRAY);
         Box userNameBox = new Box(BoxLayout.X_AXIS);
         userNameBox.setAlignmentX(LEFT_ALIGNMENT);
         userNameBox.add(Box.createHorizontalStrut(10));
         userNameBox.add(userNameLabel);
-        userNameBox.add(userNameField);
+        userNameBox.add(userNameCombo);
         leftBox.add(userNameBox);
 
@@ -212,25 +282,10 @@
         setVisible(true);
     }
-
-    /** 
-     * This keylistener removes the prompt displayed in the username text box
-     * the first time the user presses a key.  Fixes #96
-     * @author jdalbey
-     * @param evt 
-     */
-    public void keyPressed(KeyEvent evt) 
-    {
-        // See if the text in the box is the initial prompt
-        // If so, the user hasn't typed anything yet, this is the 1st keypress
-        // Even the shift key will be caught here.
-        if (userNameField.getText().equals(kNamePrompt))
-        {
-            userNameField.setText("");
-            // Change the text color from gray to black
-            userNameField.setForeground(Color.BLACK);
-        }
-    }
-
-    public void keyReleased(KeyEvent e) {}
-    public void keyTyped(KeyEvent e) {}
+    
+    /** Local main for unit testing */
+    public static void main(String[] args) 
+    {
+        new Login("config/student_names.txt");
+    }
+    
 }
