Changeset 54 in tmcsimulator for trunk/src/tmcsim/client/CADClockDisplay.java


Ignore:
Timestamp:
03/14/2017 04:20:05 PM (9 years ago)
Author:
jdalbey
Message:

Coordinator.java: updates with error checking for bad input parameters, add CADicon.png, mp3 jar

File:
1 copied

Legend:

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

    r33 r54  
    3737 * between the CAD Client and the CAD Simulator. The CADClientModel object is 
    3838 * instantiated and the CAD Client registers itself with the CAD Simulator. 
    39  * Finally, the CADClientView is initialized, the model-view and observer 
     39 * Finally, the CADClockView is initialized, the model-view and observer 
    4040 * relationships are established, and the view is shown.<br> 
    4141 * <br> 
     
    6161 */ 
    6262 
    63 public class CADClient extends UnicastRemoteObject implements 
     63public class CADClockDisplay extends UnicastRemoteObject implements 
    6464        CADClientInterface { 
    6565 
     
    9696    private CADClientModel theClientScreenModel; 
    9797 
    98     /** Instance of the CADClientView. */ 
    99     private CADClientView theClientScreenView; 
    100  
    101     /** 
    102      * Instance of the CADCLientGUI Replaces CADClientView 
     98    /** Instance of the CADClockView. */ 
     99    private CADClockView theClientScreenView; 
     100 
     101    /** 
     102     * Instance of the CADCLientGUI Replaces CADClockView 
    103103     */ 
    104104    private CADClientGUI theClientGUI; 
     
    131131     *            containing configuration data. 
    132132     */ 
    133     public CADClient(String propertiesFile) throws SimulationException, 
     133    public CADClockDisplay(String propertiesFile) throws SimulationException, 
    134134            RemoteException { 
    135135        if (!verifyProperties(propertiesFile)) 
     
    155155        // Instantiate the CADScreenView and set up the model-view observer 
    156156        // relationship. 
    157         theClientScreenView = new CADClientView(theClientScreenModel); 
     157        theClientScreenView = new CADClockView(theClientScreenModel); 
    158158        theClientScreenView.setVisible(false); 
    159159 
     
    163163        // modify in parallel 
    164164        // This is required to perform powerline commands on the data 
    165         theClientGUI = new CADClientGUI(); 
     165//        theClientGUI = new CADClientGUI(); 
    166166 
    167167        // Each screen of the UI should have a reference to either it's parent 
    168168        // object or the main client 
    169169        // This ensures they all have access to each other and the data model 
    170         theClientGUI.screen = new ScreenManager(theCoorInt); 
    171         theClientGUI.login = new Login(); 
    172         theClientGUI.client = this; 
     170//        theClientGUI.screen = new ScreenManager(theCoorInt); 
     171//        theClientGUI.login = new Login(); 
     172//        theClientGUI.client = this; 
    173173 
    174174        // setup keyboard settings for CAD Client 
    175         if (cadClientProp.getProperty(PROPERTIES.KEYBOARD_TYPE.name).trim() 
    176                 .equals("CAD")) { 
    177             CADEnums.CAD_KEYS.setupCADKeyboard(); 
    178         } 
    179         // STD 
    180         else { 
    181             CADEnums.CAD_KEYS.setupStandardKeyboard(); 
    182         } 
    183  
    184         theClientScreenModel.addObserver(theClientScreenView); 
    185  
    186         // Initialize the display 
    187         if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name).equals( 
    188                 "FULL_SCREEN")) { 
    189  
    190             theClientScreenView.addWindowListener(new WindowListener() { 
    191                 public void windowClosed(WindowEvent e) { 
    192                 } 
    193  
    194                 public void windowOpened(WindowEvent e) { 
    195                 } 
    196  
    197                 public void windowIconified(WindowEvent e) { 
    198                 } 
    199  
    200                 public void windowDeiconified(WindowEvent e) { 
    201                 } 
    202  
    203                 public void windowActivated(WindowEvent e) { 
    204                 } 
    205  
    206                 public void windowDeactivated(WindowEvent e) { 
    207                 } 
    208  
    209                 public void windowClosing(WindowEvent e) { 
    210  
    211                     try { 
    212                         theClientSocket.closeSocket(); 
    213                     } catch (SimulationException se) { 
    214                     } 
    215  
    216                     System.exit(0); 
    217                 } 
    218             }); 
    219  
    220             theClientScreenView.initWindow(); 
    221             theClientScreenView.setVisible(false); 
    222         } else { 
    223             JFrame cadFrame = new JFrame("CAD Client"); 
    224             cadFrame.add(theClientScreenView.initBox()); 
    225             cadFrame.setSize(800, 600); 
    226  
    227             cadFrame.addWindowListener(new WindowListener() { 
    228                 public void windowClosed(WindowEvent e) { 
    229                 } 
    230  
    231                 public void windowOpened(WindowEvent e) { 
    232                 } 
    233  
    234                 public void windowIconified(WindowEvent e) { 
    235                 } 
    236  
    237                 public void windowDeiconified(WindowEvent e) { 
    238                 } 
    239  
    240                 public void windowActivated(WindowEvent e) { 
    241                 } 
    242  
    243                 public void windowDeactivated(WindowEvent e) { 
    244                 } 
    245  
    246                 public void windowClosing(WindowEvent e) { 
    247  
    248                     try { 
    249                         theClientSocket.closeSocket(); 
    250                     } catch (SimulationException se) { 
    251                     } 
    252  
    253                     System.exit(0); 
    254                 } 
    255             }); 
    256  
    257             cadFrame.setVisible(true); 
    258         } 
    259  
    260         // Create the CAD Client thread to run the CADClientModel Object. 
    261         Thread clientThread = new Thread(theClientScreenModel); 
    262         clientThread.start(); 
     175//        if (cadClientProp.getProperty(PROPERTIES.KEYBOARD_TYPE.name).trim() 
     176//                .equals("CAD")) { 
     177//            CADEnums.CAD_KEYS.setupCADKeyboard(); 
     178//        } 
     179//        // STD 
     180//        else { 
     181//            CADEnums.CAD_KEYS.setupStandardKeyboard(); 
     182//        } 
     183// 
     184//        theClientScreenModel.addObserver(theClientScreenView); 
     185// 
     186//        // Initialize the display 
     187//        if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name).equals( 
     188//                "FULL_SCREEN")) { 
     189// 
     190//            theClientScreenView.addWindowListener(new WindowListener() { 
     191//                public void windowClosed(WindowEvent e) { 
     192//                } 
     193// 
     194//                public void windowOpened(WindowEvent e) { 
     195//                } 
     196// 
     197//                public void windowIconified(WindowEvent e) { 
     198//                } 
     199// 
     200//                public void windowDeiconified(WindowEvent e) { 
     201//                } 
     202// 
     203//                public void windowActivated(WindowEvent e) { 
     204//                } 
     205// 
     206//                public void windowDeactivated(WindowEvent e) { 
     207//                } 
     208// 
     209//                public void windowClosing(WindowEvent e) { 
     210// 
     211//                    try { 
     212//                        theClientSocket.closeSocket(); 
     213//                    } catch (SimulationException se) { 
     214//                    } 
     215// 
     216//                    System.exit(0); 
     217//                } 
     218//            }); 
     219// 
     220//            theClientScreenView.initWindow(); 
     221//            theClientScreenView.setVisible(false); 
     222//        } else { 
     223//            JFrame cadFrame = new JFrame("CAD Client"); 
     224//            cadFrame.add(theClientScreenView.initBox()); 
     225//            cadFrame.setSize(800, 600); 
     226// 
     227//            cadFrame.addWindowListener(new WindowListener() { 
     228//                public void windowClosed(WindowEvent e) { 
     229//                } 
     230// 
     231//                public void windowOpened(WindowEvent e) { 
     232//                } 
     233// 
     234//                public void windowIconified(WindowEvent e) { 
     235//                } 
     236// 
     237//                public void windowDeiconified(WindowEvent e) { 
     238//                } 
     239// 
     240//                public void windowActivated(WindowEvent e) { 
     241//                } 
     242// 
     243//                public void windowDeactivated(WindowEvent e) { 
     244//                } 
     245// 
     246//                public void windowClosing(WindowEvent e) { 
     247// 
     248//                    try { 
     249//                        theClientSocket.closeSocket(); 
     250//                    } catch (SimulationException se) { 
     251//                    } 
     252// 
     253//                    System.exit(0); 
     254//                } 
     255//            }); 
     256// 
     257//            cadFrame.setVisible(true); 
     258//        } 
     259// 
     260//        // Create the CAD Client thread to run the CADClientModel Object. 
     261//        Thread clientThread = new Thread(theClientScreenModel); 
     262//        clientThread.start(); 
    263263 
    264264        ensureProperShutdown(); 
     
    482482        try { 
    483483            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
    484             new CADClient(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 
     484            new CADClockDisplay(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 
    485485          
    486486        } catch (Exception e) { 
Note: See TracChangeset for help on using the changeset viewer.