Changeset 532 in tmcsimulator for trunk/src/tmcsim/client/CADClient.java


Ignore:
Timestamp:
11/27/2019 07:56:32 AM (6 years ago)
Author:
jdalbey
Message:

Login.java, CADClient.java: Implement #206, login screen has drop down box of student names read from a config file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/CADClient.java

    r525 r532  
    99import java.awt.event.WindowEvent; 
    1010import java.awt.event.WindowListener; 
     11import java.awt.image.BufferedImage; 
     12import java.io.File; 
    1113import java.io.FileInputStream; 
    1214import java.io.FileOutputStream; 
     
    1921import java.util.logging.Level; 
    2022import java.util.logging.Logger; 
     23import javax.imageio.ImageIO; 
     24import javax.swing.ImageIcon; 
    2125import javax.swing.JDialog; 
    2226 
     
    8892                "CADRmiPort"), CLIENT_CAD_POS("CADPosition"), CLIENT_USER_ID( 
    8993                "CADUserID"), KEYBOARD_TYPE("KeyboardType"), DISPLAY_TYPE( 
    90                 "DisplayType"); 
     94                "DisplayType"), STUDENT_NAMES_FILE("StudentNamesFile"); 
    9195 
    9296        public String name; 
     
    182186        // This ensures they all have access to each other and the data model 
    183187        theClientGUI.screen = new ScreenManager(theCoorInt); 
    184         theClientGUI.login = new Login(); 
     188        theClientGUI.login = new Login(cadClientProp.getProperty(PROPERTIES.STUDENT_NAMES_FILE.name).trim()); 
    185189        theClientGUI.client = this; 
    186190 
     
    345349        // CAD Simulator's connection information. 
    346350        if (cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name) == null 
    347                 || cadClientProp.getProperty(PROPERTIES.CAD_SIM_PORT.name) == null) { 
     351                || cadClientProp.getProperty(PROPERTIES.CAD_SIM_PORT.name) == null 
     352                || cadClientProp.getProperty(PROPERTIES.STUDENT_NAMES_FILE.name) == null) { 
    348353            cadClientLogger.logp(Level.SEVERE, "SimulationManager", 
    349354                    "Constructor", "Null value in properties file."); 
     
    522527    private JDialog createSplashScreen() 
    523528    { 
    524         final int dialogSize = 300;  // desired width and height of dialog 
     529        final int dialogSize = 268;  // desired width and height of dialog 
    525530        // create the dialog 
    526531        JDialog dlg = new JDialog(null,"VisiCAD loading",Dialog.ModalityType.MODELESS); 
     
    534539        // Add the msg to the center of the dialog 
    535540        dlg.add(dlgMsg,BorderLayout.CENTER);  
     541        // Add TriTech banner to top of screen  
     542        try { 
     543            BufferedImage myPicture = ImageIO.read(new File("images/CADMenuImages/Tritech.png")); 
     544            JLabel picLabel = new JLabel(new ImageIcon(myPicture)); 
     545            dlg.add(picLabel, BorderLayout.NORTH); 
     546        } catch (IOException ex) { 
     547            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex); 
     548        }         
    536549        // Set how big we want the dialog to be 
    537550        dlg.setSize(dialogSize, dialogSize); 
Note: See TracChangeset for help on using the changeset viewer.