Ignore:
Timestamp:
11/02/2017 12:32:10 PM (9 years ago)
Author:
jdalbey
Message:

Integrate TrafficModelViewer? into the CAD Server GUI as an additional tab. Eliminates the separate window for traffic mgr view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java

    r206 r210  
    7676     */ 
    7777    private Properties props = null; 
     78     
     79    /**  
     80     * The Coordinator object from which we obtain the simulation clock. 
     81     */  
     82    private Coordinator theCoordinator; 
     83 
    7884    /** 
    7985     * Highways in traffic network 
     
    95101    private String currentClock = ""; 
    96102     
    97     /** 
    98      * GUI for this driver 
    99      */ 
    100     //private TrafficModelViewer theView; 
    101      
     103    
    102104    /** 
    103105     * Constructor. Loads the Properties file and initializes the 
    104      * ATMSCommunicator with the parsed data. 
     106     * highway network model.  
    105107     * 
    106108     * @param propertiesFile Target file path of properties file. 
     
    118120                props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 
    119121                8080);  
    120          
     122        this.theCoordinator = theCoordinator; 
     123    } 
     124    /** 
     125     * Load the traffic events and start processing the event queue. 
     126     * Usage: addObserver must be called before calling run. 
     127     */ 
     128    public void run() 
     129    { 
    121130        loadEvents(); 
    122131         
     
    378387    } 
    379388 
    380     /** 
    381      * Construct the CADClient with the properties file path, either from the 
    382      * command line arguments or default. 
    383      * 
    384      * @param args Command line arguments. 
    385      */ 
    386     public static void main(String[] args) throws RemoteException 
    387     { 
    388         final String CONFIG_FILE_NAME = "traffic_model_config.properties";         
    389         if (System.getProperty("CONFIG_DIR") == null) 
    390         { 
    391             System.setProperty("CONFIG_DIR", "config"); 
    392         } 
    393         CADSimulatorState theModel = new CADSimulatorState(); 
    394         Coordinator theCoordinator = new Coordinator(theModel); 
    395         try 
    396         { 
    397             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
    398             TrafficModelManager mgr = new TrafficModelManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME,                     
    399             theCoordinator); 
    400             TrafficModelViewer view = new TrafficModelViewer(mgr); 
    401             view.setVisible(true); 
    402             mgr.addObserver(view); 
    403         } 
    404         catch (Exception e) 
    405         { 
    406             logger.logp(Level.SEVERE, "SimulationManager", "Main", 
    407                     "Error initializing application."); 
    408  
    409             JOptionPane.showMessageDialog(new JWindow(), e.getMessage(), 
    410                     "Error - Program Exiting", JOptionPane.ERROR_MESSAGE); 
    411  
    412             System.exit(-1); 
    413         } 
    414  
    415     } 
    416389    class WriteToConsoleThread extends Thread 
    417390    { 
Note: See TracChangeset for help on using the changeset viewer.