Changeset 54 in tmcsimulator for trunk/src/tmcsim/client/CADClockDisplay.java
- Timestamp:
- 03/14/2017 04:20:05 PM (9 years ago)
- File:
-
- 1 copied
-
trunk/src/tmcsim/client/CADClockDisplay.java (copied) (copied from trunk/src/tmcsim/client/CADClient.java) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/client/CADClockDisplay.java
r33 r54 37 37 * between the CAD Client and the CAD Simulator. The CADClientModel object is 38 38 * instantiated and the CAD Client registers itself with the CAD Simulator. 39 * Finally, the CADCl ientView is initialized, the model-view and observer39 * Finally, the CADClockView is initialized, the model-view and observer 40 40 * relationships are established, and the view is shown.<br> 41 41 * <br> … … 61 61 */ 62 62 63 public class CADCl ientextends UnicastRemoteObject implements63 public class CADClockDisplay extends UnicastRemoteObject implements 64 64 CADClientInterface { 65 65 … … 96 96 private CADClientModel theClientScreenModel; 97 97 98 /** Instance of the CADCl ientView. */99 private CADCl ientView theClientScreenView;100 101 /** 102 * Instance of the CADCLientGUI Replaces CADCl ientView98 /** Instance of the CADClockView. */ 99 private CADClockView theClientScreenView; 100 101 /** 102 * Instance of the CADCLientGUI Replaces CADClockView 103 103 */ 104 104 private CADClientGUI theClientGUI; … … 131 131 * containing configuration data. 132 132 */ 133 public CADCl ient(String propertiesFile) throws SimulationException,133 public CADClockDisplay(String propertiesFile) throws SimulationException, 134 134 RemoteException { 135 135 if (!verifyProperties(propertiesFile)) … … 155 155 // Instantiate the CADScreenView and set up the model-view observer 156 156 // relationship. 157 theClientScreenView = new CADCl ientView(theClientScreenModel);157 theClientScreenView = new CADClockView(theClientScreenModel); 158 158 theClientScreenView.setVisible(false); 159 159 … … 163 163 // modify in parallel 164 164 // This is required to perform powerline commands on the data 165 theClientGUI = new CADClientGUI();165 // theClientGUI = new CADClientGUI(); 166 166 167 167 // Each screen of the UI should have a reference to either it's parent 168 168 // object or the main client 169 169 // 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; 173 173 174 174 // 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 // STD180 else {181 CADEnums.CAD_KEYS.setupStandardKeyboard();182 }183 184 theClientScreenModel.addObserver(theClientScreenView);185 186 // Initialize the display187 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(); 263 263 264 264 ensureProperShutdown(); … … 482 482 try { 483 483 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 484 new CADCl ient(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); 485 485 486 486 } catch (Exception e) {
Note: See TracChangeset
for help on using the changeset viewer.
