Changes in / [30:20] in tmcsimulator


Ignore:
Location:
/trunk
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • /trunk/src/tmcsim/cadsimulator/Coordinator.java

    r27 r2  
     1 
    12package tmcsim.cadsimulator; 
    23 
     4import java.awt.List; 
    35import java.io.File; 
    46import java.rmi.RemoteException; 
     
    1416import java.util.logging.Level; 
    1517import java.util.logging.Logger; 
     18 
     19import javax.swing.JList; 
     20import javax.swing.Timer; 
    1621import javax.swing.table.DefaultTableModel; 
    1722import javax.xml.parsers.SAXParserFactory; 
     23 
    1824import tmcsim.cadmodels.CADRoutedMessage; 
    1925import tmcsim.cadmodels.CMSInfo; 
     
    3743import tmcsim.client.cadclientgui.data.Incident; 
    3844import tmcsim.client.cadclientgui.data.IncidentEvent; 
    39 import tmcsim.client.cadclientgui.enums.CADDataEnums.CARDFILE; 
    40 import tmcsim.client.cadclientgui.enums.CADDataEnums.EditCommand; 
    41 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_ACTIVITIES; 
    42 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_ADD_INFO; 
    43 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_CALLBACK; 
    44 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_CALLER; 
    45 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_EDIT_LOG; 
    46 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_GEN_INFO; 
    47 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_INFO; 
    48 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_LOC; 
    49 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_PROBLEM; 
    50 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_RESP; 
    51 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_TABLE; 
    52 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_TIMES; 
    53 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_VAL; 
    54 import tmcsim.client.cadclientgui.enums.CADDataEnums.TABLE; 
     45import tmcsim.client.cadclientgui.enums.CADDataEnums.*; 
    5546import tmcsim.client.cadclientgui.enums.CADScriptTags.UNIT_TAGS; 
    5647import tmcsim.client.cadclientgui.enums.IncidentEnums; 
    5748import tmcsim.client.cadclientgui.enums.UnitStatusEnums; 
    58 import tmcsim.common.CADEnums.PARAMICS_STATUS; 
    59 import tmcsim.common.CADEnums.SCRIPT_STATUS; 
     49import tmcsim.client.cadclientgui.screens.ScreenManager; 
     50import tmcsim.common.CCTVInfo; 
    6051import tmcsim.common.ObserverMessage; 
    6152import tmcsim.common.ScriptException; 
    6253import tmcsim.common.SimulationException; 
    6354import tmcsim.common.XMLIncident; 
     55import tmcsim.common.CADEnums.PARAMICS_STATUS; 
     56import tmcsim.common.CADEnums.SCRIPT_STATUS; 
    6457import tmcsim.interfaces.CADClientInterface; 
    6558import tmcsim.interfaces.CoordinatorInterface; 
     
    6760 
    6861/** 
    69  * Coordinator is used to control and manage interactions between all CAD 
    70  * Simulator Managers. The Coordinator is also registered as an RMI Object to 
    71  * allow remote control and access to simulation data. A 
     62 * Coordinator is used to control and manage interactions between all CAD  
     63 * Simulator Managers.  The Coordinator is also registered as an RMI Object 
     64 * to allow remote control and access to simulation data.   A  
    7265 * SimulationManagerInterface Object is used to provide communication to a 
    73  * remotely connected SimulationManager. Observers may register with the 
     66 * remotely connected SimulationManager.  Observers may register with the 
    7467 * Coordinator to listen for simulation data updates. 
    7568 * 
     
    8073 * @see SimulationControlManager 
    8174 * @author Matthew Cechini 
    82  * @version 
     75 * @version  
    8376 */ 
    8477@SuppressWarnings("serial") 
    8578public class Coordinator extends UnicastRemoteObject 
    86         implements CoordinatorInterface 
    87 { 
    88  
    89     /** 
    90      * Error logger. 
    91      */ 
     79    implements CoordinatorInterface { 
     80 
     81    /** Error logger. */ 
    9282    private Logger coorLogger = Logger.getLogger("tmcsim.cadsimulator"); 
    93     /** 
    94      * List of all Observers that have been registered with the Coordinator. Due 
    95      * to being a remote object, Coordinator cannot extend the Observable class. 
     83     
     84    /** 
     85     * List of all Observers that have been registered with the Coordinator.  Due 
     86     * to being a remote object, Coordinator cannot extend the Observable class.  
    9687     * Therefore, the list is managed manually. 
    9788     */ 
    9889    private Vector<Observer> observerList = null; 
    99     /** 
    100      * Interface object for RMI communication with the Simulation Manager. Only 
    101      * one Simulation Manager may be connected at a time. When there is no 
    102      * connected Manager, this object is set to null. 
     90     
     91    /** 
     92     * Interface object for RMI communication with the Simulation Manager.  Only one Simulation Manager 
     93     * may be connected at a time.  When there is no connected Manager, this object is set to null. 
    10394     */ 
    10495    private static SimulationManagerInterface managerInt = null; 
     96     
    10597    private static LinkedList<CADClientInterface> clientList; 
     98             
    10699    private static CADData cadData; 
     100     
    107101    private static CardfileData cardfileData; 
    108  
    109     /** 
    110      * Constructor. Call UnicastRemoteObject constructor and call 
     102     
     103    /** 
     104     * Constructor.  Call UnicastRemoteObject constructor and call  
    111105     * initializeSimulation. 
    112106     * 
    113107     * @throws RemoteException 
    114108     */ 
    115     public Coordinator() throws RemoteException 
    116     { 
     109    public Coordinator() throws RemoteException {            
    117110        super(); 
    118111        clientList = new LinkedList<CADClientInterface>(); 
    119112        cadData = new CADData(); 
    120         cardfileData = new CardfileData(); 
    121         try 
    122         { 
     113      cardfileData = new CardfileData(); 
     114        try { 
    123115            CardfileReader cfr = new CardfileReader("scripts/Cardfile.xml", cardfileData); 
    124         } catch (Exception e) 
    125         { 
     116        } catch (Exception e) { 
    126117            System.out.println("Could not load cardfile script"); 
    127118        } 
    128  
     119         
    129120        observerList = new Vector<Observer>(); 
    130121    } 
    131  
    132     public void registerForCallback(CADClientInterface client) throws RemoteException 
    133     { 
     122     
     123    public void registerForCallback(CADClientInterface client) throws RemoteException{ 
    134124        clientList.add(client); 
    135125        CADSimulator.theViewer.connectClient(); 
    136     } 
    137  
    138     public void unregisterForCallback(CADClientInterface client) throws RemoteException 
    139     { 
     126    }    
     127     
     128    public void unregisterForCallback(CADClientInterface client) throws RemoteException{ 
    140129        clientList.remove(client); 
    141130        CADSimulator.theViewer.disconnectClient(); 
    142131    } 
    143  
    144     public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException 
    145     { 
     132     
     133    public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException{ 
    146134        managerInt = simManInt; 
    147135        CADSimulator.theViewer.setSimManagerStatus(true); 
    148     } 
    149  
    150     public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException 
    151     { 
     136    }    
     137     
     138    public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException { 
    152139        managerInt = null; 
    153140        CADSimulator.theViewer.setSimManagerStatus(false); 
    154     } 
    155  
    156     public void startSimulation() throws RemoteException, ScriptException 
    157     { 
    158  
    159         coorLogger.logp(Level.INFO, "Coordinator", "startSimulation", 
    160                 "starting..."); 
    161         if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    162         { 
     141    }      
     142     
     143    public void startSimulation() throws RemoteException, ScriptException { 
     144 
     145        if(!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    163146            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    164         } else if (CADSimulator.theParamicsSimMgr.isConnected()) 
    165         { 
    166             Runnable startRun = new Runnable() 
    167             { 
    168                 public void run() 
    169                 { 
    170                     try 
    171                     { 
     147        else if(CADSimulator.theParamicsSimMgr.isConnected()) { 
     148            Runnable startRun = new Runnable() { 
     149                public void run() { 
     150                    try { 
    172151                        setScriptStatus(SCRIPT_STATUS.ATMS_SYNCHRONIZATION); 
    173  
     152                         
    174153                        long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime(); 
    175                         long sleepTime = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000); 
    176  
    177                         coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation", 
    178                                 "Sleeping for " + sleepTime / 1000 + " seconds."); 
     154                        long sleepTime       = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000);                
     155 
     156                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation",  
     157                                "Sleeping for " + sleepTime/1000 + " seconds."); 
    179158                        Thread.sleep(sleepTime); 
    180  
    181                         //currentATMSTime += sleepTime; 
    182                         //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime); 
    183                     } catch (Exception e) 
    184                     { 
     159     
     160                        //currentATMSTime += sleepTime;                  
     161                        //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime);                                        
     162                    } 
     163                    catch (Exception e) { 
    185164                        setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING); 
    186  
    187                         coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run", 
     165                         
     166                        coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run",  
    188167                                "Unable to connect to ATMS server.", e); 
    189                     } finally 
    190                     { 
     168                    } 
     169                    finally { 
    191170                        CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    192171                        CADSimulator.theParamicsSimMgr.startSimulation(); 
    193                         CADSimulator.theSoundPlayer.setAudioEnabled(true); 
    194                         coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 
    195                                 "Simulation has started."); 
     172                        CADSimulator.theSoundPlayer.setAudioEnabled(true);       
    196173                    } 
    197174                } 
    198175            }; 
    199  
     176         
    200177            Thread startThread = new Thread(startRun); 
    201178            startThread.start(); 
    202         } else 
    203         { 
     179        } 
     180        else { 
    204181            CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    205182            CADSimulator.theSoundPlayer.setAudioEnabled(true); 
    206183        } 
    207184    } 
    208  
    209     public void pauseSimulation() throws RemoteException 
    210     { 
     185     
     186     
     187    public void pauseSimulation() throws RemoteException {       
    211188        CADSimulator.theSimulationCntrlMgr.pauseSimulation(); 
    212189        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    213190    } 
    214  
    215     public void resetSimulation() throws RemoteException 
    216     { 
    217  
     191     
     192 
     193    public void resetSimulation() throws RemoteException {       
     194         
    218195        CADSimulator.theIncidentMgr.resetIncidents(); 
    219196        cadData.resetSimulation(); 
    220  
     197         
    221198        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    222199        CADSimulator.theSoundPlayer.deQueueAll(); 
    223  
     200         
    224201        CADSimulator.theViewer.setTime(0); 
    225  
     202         
    226203        setScriptStatus(SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED); 
    227  
     204         
    228205        CMSDiversionDB.getInstance().resetDiversions(); 
    229  
     206         
    230207        CADSimulator.theSimulationCntrlMgr.resetSimulation(); 
    231208        CADSimulator.theParamicsSimMgr.resetSimulation(); 
    232  
    233         notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null)); 
    234  
    235     } 
    236  
    237     public void gotoSimulationTime(final long newSimTime) throws RemoteException 
    238     { 
    239  
     209         
     210        notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null));       
     211 
     212    } 
     213 
     214         
     215    public void gotoSimulationTime(final long newSimTime) throws RemoteException { 
     216                 
    240217        boolean audioWasEnabled = CADSimulator.theSoundPlayer.getAudioEnabled(); 
    241  
     218         
    242219        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    243  
    244         long tempTime = 0; 
    245         while (tempTime < newSimTime) 
    246         { 
     220         
     221        long tempTime = 0;       
     222        while(tempTime < newSimTime) { 
    247223            tempTime++; 
    248224 
    249225            CADSimulator.theIncidentMgr.tick(tempTime); 
    250         } 
     226        }        
    251227        CADSimulator.theSoundPlayer.setAudioEnabled(audioWasEnabled); 
    252  
     228         
    253229 
    254230        CADSimulator.theSimulationCntrlMgr.gotoSimulationTime(newSimTime); 
    255  
    256         Runnable gotoRun = new Runnable() 
    257         { 
    258             public void run() 
    259             { 
     231         
     232        Runnable gotoRun = new Runnable() { 
     233         
     234            public void run() { 
    260235                CADSimulator.theViewer.setTime(newSimTime); 
    261  
    262                 if (managerInt != null) 
    263                 { 
    264                     try 
    265                     { 
     236                 
     237                if(managerInt != null) { 
     238                    try { 
    266239                        managerInt.tick(newSimTime); 
    267                     } catch (RemoteException re) 
    268                     { 
     240                    } 
     241                    catch (RemoteException re) { 
    269242                        //Simulation Manager has disappeared 
    270243                        managerInt = null; 
    271244                        CADSimulator.theViewer.setSimManagerStatus(false); 
    272  
    273                         coorLogger.logp(Level.SEVERE, "Coordinator", "gotoSimulationTime:run", 
     245                         
     246                        coorLogger.logp(Level.SEVERE, "Coordinator", "gotoSimulationTime:run",  
    274247                                "Connection to Simulation Manager has been dropped.", re); 
    275248                    } 
    276249                } 
    277             } 
     250            }            
    278251        }; 
    279  
     252         
    280253        Thread gotoThread = new Thread(gotoRun); 
    281         gotoThread.start(); 
    282  
    283     } 
    284  
    285     /** 
    286      * Sets the current script status. A thread is started to notify the 
    287      * CADSimulatorViewer and SimulationManager with the new status. 
    288      */ 
    289     public void setScriptStatus(final SCRIPT_STATUS status) 
    290     { 
    291  
    292         Runnable updateRun = new Runnable() 
    293         { 
    294             public void run() 
    295             { 
     254        gotoThread.start();      
     255         
     256    } 
     257     
     258 
     259    /** 
     260     * Sets the current script status.  A thread is started to notify 
     261     * the CADSimulatorViewer and SimulationManager with the new status. 
     262     */ 
     263    public void setScriptStatus(final SCRIPT_STATUS status) { 
     264         
     265        Runnable updateRun = new Runnable() { 
     266         
     267            public void run() { 
    296268 
    297269                CADSimulator.theViewer.setScriptStatus(status); 
    298  
    299                 if (managerInt != null) 
    300                 { 
    301                     try 
    302                     { 
     270         
     271                if(managerInt != null) { 
     272                    try {                            
    303273                        managerInt.setScriptStatus(status); 
    304                     } catch (RemoteException re) 
    305                     { 
     274                    } 
     275                    catch (RemoteException re) { 
    306276                        //Simulation Manager has disappeared 
    307277                        managerInt = null; 
    308278                        CADSimulator.theViewer.setSimManagerStatus(false); 
    309279 
    310                         coorLogger.logp(Level.SEVERE, "Coordinator", "setScriptStatus:run", 
     280                        coorLogger.logp(Level.SEVERE, "Coordinator", "setScriptStatus:run",  
    311281                                "Connection to Simulation Manager has been dropped.", re); 
    312                     } 
     282                    }                    
    313283                } 
    314284            } 
    315285        }; 
    316  
     286         
    317287        Thread updateThread = new Thread(updateRun); 
    318288        updateThread.start(); 
    319     } 
    320  
    321     /** 
    322      * Sets the current paramics status. A thread is started to notify the 
    323      * CADSimulatorViewer and SimulationManager with the new status. 
    324      */ 
    325     public void setParamicsStatus(final PARAMICS_STATUS status) 
    326     { 
    327  
    328         Runnable updateRun = new Runnable() 
    329         { 
    330             public void run() 
    331             { 
     289    }    
     290     
     291    /** 
     292     * Sets the current paramics status.  A thread is started to notify 
     293     * the CADSimulatorViewer and SimulationManager with the new status. 
     294     */ 
     295    public void setParamicsStatus(final PARAMICS_STATUS status) { 
     296 
     297        Runnable updateRun = new Runnable(){ 
     298         
     299            public void run() { 
    332300                CADSimulator.theViewer.setParamicsStatus(status); 
    333  
    334                 if (managerInt != null) 
    335                 { 
    336                     try 
    337                     { 
     301                 
     302                if(managerInt != null) { 
     303                    try {                            
    338304                        managerInt.setParamicsStatus(status); 
    339                     } catch (RemoteException re) 
    340                     { 
     305                    } 
     306                    catch (RemoteException re) { 
    341307                        //Simulation Manager has disappeared 
    342308                        managerInt = null; 
    343309                        CADSimulator.theViewer.setSimManagerStatus(false); 
    344310 
    345                         coorLogger.logp(Level.SEVERE, "Coordinator", "setParamicsStatus:run", 
     311                        coorLogger.logp(Level.SEVERE, "Coordinator", "setParamicsStatus:run",  
    346312                                "Connection to Simulation Manager has been dropped.", re); 
    347                     } 
    348                 } 
     313                    }                    
     314                }    
     315            }        
     316        }; 
     317         
     318        Thread updateThread = new Thread(updateRun); 
     319        updateThread.start();        
     320     
     321    } 
     322     
     323    public void connectToParamics() throws RemoteException { 
     324        CADSimulator.theParamicsSimMgr.connectToParamics(); 
     325    } 
     326    public void disconnectFromParamics() throws RemoteException { 
     327        CADSimulator.theParamicsSimMgr.disconnectFromParamics(); 
     328    } 
     329     
     330    public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException { 
     331        CADSimulator.theParamicsSimMgr.loadParamicsNetwork(networkID); 
     332    }    
     333     
     334    public PARAMICS_STATUS getParamicsStatus() throws RemoteException { 
     335        return CADSimulator.theParamicsSimMgr.getParamicsStatus(); 
     336    } 
     337     
     338    public int getParamicsNetworkLoaded() throws RemoteException { 
     339        return CADSimulator.theParamicsSimMgr.getParamicsNetworkLoaded(); 
     340    } 
     341 
     342    public long getCurrentSimulationTime() throws RemoteException { 
     343        return CADSimulator.theSimulationCntrlMgr.getCurrentSimTime();   
     344    }    
     345         
     346    public void triggerIncident(Integer incidentNumber) throws RemoteException, ScriptException { 
     347         
     348        if(!CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
     349            throw new ScriptException(ScriptException.SIM_NOT_STARTED); 
     350        else if(!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     351            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
     352 
     353        CADSimulator.theIncidentMgr.triggerIncident(incidentNumber,  
     354                CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()); 
     355    } 
     356     
     357    public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException { 
     358        CADSimulator.theIncidentMgr.deleteIncident(incidentNumber); 
     359         
     360        if(CADSimulator.theIncidentMgr.getIncidentList().size() == 0) { 
     361            setScriptStatus(SCRIPT_STATUS.NO_SCRIPT); 
     362        } 
     363         
     364        if(managerInt != null) { 
     365            try {                            
     366                managerInt.incidentRemoved(incidentNumber); 
    349367            } 
    350         }; 
    351  
    352         Thread updateThread = new Thread(updateRun); 
    353         updateThread.start(); 
    354  
    355     } 
    356  
    357     public void connectToParamics() throws RemoteException 
    358     { 
    359         CADSimulator.theParamicsSimMgr.connectToParamics(); 
    360     } 
    361  
    362     public void disconnectFromParamics() throws RemoteException 
    363     { 
    364         CADSimulator.theParamicsSimMgr.disconnectFromParamics(); 
    365     } 
    366  
    367     public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException 
    368     { 
    369         CADSimulator.theParamicsSimMgr.loadParamicsNetwork(networkID); 
    370     } 
    371  
    372     public PARAMICS_STATUS getParamicsStatus() throws RemoteException 
    373     { 
    374         return CADSimulator.theParamicsSimMgr.getParamicsStatus(); 
    375     } 
    376  
    377     public int getParamicsNetworkLoaded() throws RemoteException 
    378     { 
    379         return CADSimulator.theParamicsSimMgr.getParamicsNetworkLoaded(); 
    380     } 
    381  
    382     public long getCurrentSimulationTime() throws RemoteException 
    383     { 
    384         return CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
    385     } 
    386  
    387     public void triggerIncident(Integer incidentNumber) throws RemoteException, ScriptException 
    388     { 
    389  
    390         if (!CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
    391         { 
    392             throw new ScriptException(ScriptException.SIM_NOT_STARTED); 
    393         } else if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    394         { 
    395             throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    396         } 
    397  
    398         CADSimulator.theIncidentMgr.triggerIncident(incidentNumber, 
    399                 CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()); 
    400     } 
    401  
    402     public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException 
    403     { 
    404         CADSimulator.theIncidentMgr.deleteIncident(incidentNumber); 
    405  
    406         if (CADSimulator.theIncidentMgr.getIncidentList().size() == 0) 
    407         { 
    408             setScriptStatus(SCRIPT_STATUS.NO_SCRIPT); 
    409         } 
    410  
    411         if (managerInt != null) 
    412         { 
    413             try 
    414             { 
    415                 managerInt.incidentRemoved(incidentNumber); 
    416             } catch (RemoteException re) 
    417             { 
     368            catch (RemoteException re) { 
    418369                //Simulation Manager has disappeared 
    419370                managerInt = null; 
    420371                CADSimulator.theViewer.setSimManagerStatus(false); 
    421372 
    422                 coorLogger.logp(Level.SEVERE, "Coordinator", "deleteIncident", 
     373                coorLogger.logp(Level.SEVERE, "Coordinator", "deleteIncident",  
    423374                        "Connection to Simulation Manager has been dropped.", re); 
     375            }                    
     376        }    
     377    } 
     378     
     379    public void rescheduleIncident(Integer incidentNumber, long newTime)  
     380        throws RemoteException, ScriptException { 
     381         
     382        if (newTime < CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()) { 
     383            throw new ScriptException(ScriptException.TIME_PASSED); 
     384        } 
     385         
     386        CADSimulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 
     387    } 
     388     
     389    public void addIncident(Incident newIncident) throws RemoteException { 
     390 
     391        CADSimulator.theIncidentMgr.addIncident(newIncident); 
     392         
     393        if(managerInt != null) { 
     394            try {                            
     395                managerInt.incidentAdded(newIncident); 
    424396            } 
    425         } 
    426     } 
    427  
    428     public void rescheduleIncident(Integer incidentNumber, long newTime) 
    429             throws RemoteException, ScriptException 
    430     { 
    431  
    432         if (newTime < CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()) 
    433         { 
    434             throw new ScriptException(ScriptException.TIME_PASSED); 
    435         } 
    436  
    437         CADSimulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 
    438     } 
    439  
    440     public void addIncident(Incident newIncident) throws RemoteException 
    441     { 
    442  
    443         CADSimulator.theIncidentMgr.addIncident(newIncident); 
    444  
    445         if (managerInt != null) 
    446         { 
    447             try 
    448             { 
    449                 managerInt.incidentAdded(newIncident); 
    450             } catch (RemoteException re) 
    451             { 
     397            catch (RemoteException re) { 
    452398                //Simulation Manager has disappeared 
    453399                managerInt = null; 
    454400                CADSimulator.theViewer.setSimManagerStatus(false); 
    455401 
    456                 coorLogger.logp(Level.SEVERE, "Coordinator", "addIncident", 
     402                coorLogger.logp(Level.SEVERE, "Coordinator", "addIncident",  
    457403                        "Connection to Simulation Manager has been dropped.", re); 
    458             } 
    459         } 
    460     } 
    461  
    462     public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException 
    463     { 
    464  
    465  
    466         try 
    467         { 
     404            }                    
     405        }        
     406    } 
     407     
     408 
     409    public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException {        
     410         
     411         
     412        try { 
    468413            CADSimulator.theIncidentMgr.clearIncidents(); 
    469414            cadData.clearData(); 
    470  
     415             
    471416            ScriptHandler sh = new ScriptHandler(); 
    472  
     417             
    473418            SAXParserFactory.newInstance().newSAXParser().parse(scriptFile, sh); 
    474  
     419             
    475420            cadData.setIncidentsFromXML(sh.getIncidents()); 
    476421            cadData.setUnitsFromXML(sh.getUnits()); 
    477422            refreshClients(); 
    478423            CADSimulator.theIncidentMgr.addIncidents(sh.getIncidents()); 
    479  
    480             resetSimulation(); 
    481         } catch (Exception e) 
    482         { 
    483             e.printStackTrace(); 
    484         } 
    485  
    486     } 
    487  
    488     public Vector<Incident> getIncidentList() throws RemoteException 
    489     { 
     424             
     425            resetSimulation();      
     426        } 
     427        catch (Exception e) {e.printStackTrace();} 
     428 
     429    }    
     430 
     431    public Vector<Incident> getIncidentList() throws RemoteException { 
    490432        return CADSimulator.theIncidentMgr.getIncidentList(); 
    491433    } 
    492  
    493     public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException 
    494     { 
     434     
     435    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException { 
    495436        return CADSimulator.theIncidentMgr.getTriggeredEvents(); 
    496437    } 
    497438 
    498     public SCRIPT_STATUS getScriptStatus() throws RemoteException 
    499     { 
    500         if (CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    501         { 
    502             if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
    503             { 
     439    public SCRIPT_STATUS getScriptStatus() throws RemoteException { 
     440        if(CADSimulator.theIncidentMgr.areIncidentsLoaded()) { 
     441            if(CADSimulator.theSimulationCntrlMgr.simulationStarted())  
    504442                return SCRIPT_STATUS.SCRIPT_RUNNING; 
    505             } else 
    506             { 
    507                 for (Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) 
    508                 { 
    509                     if (inc.hasOccured() == true) 
    510                     { 
     443            else { 
     444                for(Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) { 
     445                    if(inc.hasOccured() == true)  
    511446                        return SCRIPT_STATUS.SCRIPT_PAUSED_STARTED; 
    512                     } 
    513447                } 
    514448                return SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED; 
     
    517451        return SCRIPT_STATUS.NO_SCRIPT; 
    518452    } 
    519  
    520     /** 
    521      * Route a message to a CAD terminal. If the new message is an incident 
    522      * update, the current message text will be the requested incident's log 
    523      * number. Set the message's text to the XML representation of the requested 
    524      * IncidentInquiry object. Notify observers with the new message. 
     453     
     454    /** 
     455     * Route a message to a CAD terminal.  If the new message is 
     456     * an incident update, the current message text will be the 
     457     * requested incident's log number.  Set the message's text  
     458     * to the XML representation of the requested IncidentInquiry  
     459     * object.  Notify observers with the new message. 
    525460     * 
    526461     * @param newMessage Routed message received from CAD Client. 
    527462     */ 
    528     public void routeMessage(CADRoutedMessage newMessage) 
    529     { 
    530  
     463    public void routeMessage(CADRoutedMessage newMessage) { 
     464         
    531465        //if this is an incidentUpdate 
    532466        /* 
    533467         * TODO  Is this a priority?? 
    534          if(newMessage.incidentUpdate) { 
    535          IncidentInquiryModel tempII = new IncidentInquiryModel( 
    536          newMessage.fromPosition, 
    537          CADScreenNum.ONE, 
    538          Integer.parseInt(newMessage.message)); 
    539  
    540          for(IncidentInquiryModel_obj iimo : getIncidentInquiryModelObjects( 
    541          Integer.parseInt(newMessage.message))) { 
    542          tempII.addModelObject(iimo); 
    543          } 
    544  
    545          XMLWriter tempWriter = new XMLWriter(); 
    546          tempII.toXML(tempWriter); 
    547          newMessage.message = tempWriter.getString(); 
    548          } 
    549          */ 
    550  
     468        if(newMessage.incidentUpdate) { 
     469            IncidentInquiryModel tempII = new IncidentInquiryModel( 
     470                    newMessage.fromPosition, 
     471                    CADScreenNum.ONE,  
     472                    Integer.parseInt(newMessage.message)); 
     473             
     474            for(IncidentInquiryModel_obj iimo : getIncidentInquiryModelObjects( 
     475                    Integer.parseInt(newMessage.message))) { 
     476                tempII.addModelObject(iimo); 
     477            } 
     478             
     479            XMLWriter tempWriter = new XMLWriter(); 
     480            tempII.toXML(tempWriter); 
     481            newMessage.message = tempWriter.getString(); 
     482        } 
     483        */ 
     484             
    551485        notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, 
    552486                newMessage)); 
    553487 
    554     } 
    555  
    556     public TreeSet<String> getCMSIDs() throws RemoteException 
    557     { 
     488    }    
     489    
     490  
     491    public TreeSet<String> getCMSIDs() throws RemoteException {      
    558492        return new TreeSet<String>(CMSDiversionDB.getInstance().getAllDiversions().keySet()); 
    559493    } 
    560  
    561     public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException 
    562     { 
     494     
     495    public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException {         
    563496        return CMSDiversionDB.getInstance().getDiversion(theCMSID); 
    564     } 
    565  
    566     public void applyDiversions(CMSInfo theDiversion) throws RemoteException 
    567     { 
     497    }     
     498     
     499    public void applyDiversions(CMSInfo theDiversion) throws RemoteException { 
    568500        CMSDiversionDB.getInstance().updateDiversions(theDiversion); 
    569501        CADSimulator.theParamicsSimMgr.updateDiversion(theDiversion); 
    570     } 
    571  
    572     /** 
    573      * Method updates the simulation with the new Incident information. The 
    574      * parameter IncidentInquiryModel_obj Object is used to create a new 
    575      * IncidentEvent Object which is finalized and sent to the IncidentManager 
    576      * for simulation updating. 
    577      * 
     502    }     
     503    
     504    /** 
     505     * Method updates the simulation with the new Incident information. 
     506     * The parameter IncidentInquiryModel_obj Object is used to create  
     507     * a new IncidentEvent Object which is finalized and sent to the 
     508     * IncidentManager for simulation updating.  
     509     *  
    578510     * @param update IncidentInquiryModel_obj containing CAD line update 
    579511     * @see IncidentManager 
    580512     */ 
    581     public void commandLineUpdate(IncidentInquiryModel_obj modelInfo) 
    582     { 
    583  
     513    public void commandLineUpdate(IncidentInquiryModel_obj modelInfo) { 
     514                 
    584515        long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
    585  
     516         
    586517        IncidentEvent triggeredEvent = new IncidentEvent(currentSimTime); 
    587         triggeredEvent.eventInfo = modelInfo; 
    588  
     518        triggeredEvent.eventInfo     = modelInfo; 
     519         
    589520        triggeredEvent.finalizeEvent(currentSimTime, CADSimulator.getCADTime()); 
    590521 
    591         CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 
    592  
     522        CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent);  
     523         
    593524        updateIncidentInGUI(modelInfo.getLogNumber(), triggeredEvent); 
    594  
    595     } 
    596  
    597     /** 
    598      * If the Simulation has started, spawn a thread to update the 
    599      * CADSimulatorViewer, SimulationManager, and IncidentManager with the new 
    600      * simulation time. If the current time is a 30 second interval, notify the 
     525         
     526    } 
     527     
     528     
     529    /** 
     530     * If the Simulation has started, spawn a thread to update the  
     531     * CADSimulatorViewer, SimulationManager, and IncidentManager with the new  
     532     * simulation time. If the current time is a 30 second interval, notify the  
    601533     * ParamicsControlManager to send an IncidentUpdate. 
    602      * 
     534     *  
    603535     * @see SimulationControlManager 
    604536     * @see ParamicsControlManager 
    605537     * @see IncidentManager 
    606538     */ 
    607     public void tick() 
    608     { 
    609         if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
    610         { 
    611  
     539    public void tick() { 
     540        if(CADSimulator.theSimulationCntrlMgr.simulationStarted()) { 
     541             
    612542            final long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
    613  
    614             Runnable timeRun = new Runnable() 
    615             { 
    616                 public void run() 
    617                 { 
     543             
     544            Runnable timeRun = new Runnable() { 
     545             
     546                public void run() { 
    618547                    CADSimulator.theViewer.setTime(currentSimTime); 
    619  
     548                     
    620549                    //send an update every 30 seconds 
    621                     if (currentSimTime % 30 == 0) 
    622                     { 
     550                    if(currentSimTime % 30 == 0) 
    623551                        CADSimulator.theParamicsSimMgr.sendIncidentUpdate(currentSimTime); 
    624                     } 
    625  
    626                     if (managerInt != null) 
    627                     { 
    628                         try 
    629                         { 
     552                     
     553                    if(managerInt != null) { 
     554                        try { 
    630555                            managerInt.tick(currentSimTime); 
    631                         } catch (RemoteException re) 
    632                         { 
     556                        } 
     557                        catch (RemoteException re) { 
    633558                            //Simulation Manager has disappeared 
    634559                            managerInt = null; 
    635560                            CADSimulator.theViewer.setSimManagerStatus(false); 
    636561 
    637                             coorLogger.logp(Level.SEVERE, "Coordinator", "tick:run", 
     562                            coorLogger.logp(Level.SEVERE, "Coordinator", "tick:run",  
    638563                                    "Connection to Simulation Manager has been dropped.", re); 
    639564                        } 
    640565                    } 
    641  
     566                     
    642567                    CADSimulator.theIncidentMgr.tick(currentSimTime); 
    643                 } 
     568                }            
    644569            }; 
    645  
     570             
    646571            Thread timeThread = new Thread(timeRun); 
    647             timeThread.start(); 
    648         } 
    649     } 
     572            timeThread.start();                      
     573        } 
     574    }    
     575     
    650576 
    651577    /** 
    652578     * Method notifies observers with an IncidentSummaryModel_obj to signify 
    653      * that a new Incident has started. Then spawn a thread to notify the 
     579     * that a new Incident has started.  Then spawn a thread to notify the 
    654580     * SimulationManager with the Incident's log number has started. 
    655      * 
     581     *  
    656582     * @param completedEvent Completed IncidentEvent. 
    657583     */ 
    658     public void incidentStarted(final IncidentEvent completedEvent) 
    659     { 
     584    public void incidentStarted(final IncidentEvent completedEvent) { 
    660585        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_SUMMARY, 
    661                 new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader()))); 
    662  
     586                new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader())));     
     587         
    663588        incidentStartedInGUI(completedEvent.eventInfo.getLogNumber()); 
    664  
    665         Runnable startRun = new Runnable() 
    666         { 
    667             public void run() 
    668             { 
    669                 if (managerInt != null) 
    670                 { 
    671                     try 
    672                     { 
     589         
     590        Runnable startRun = new Runnable() {                             
     591            public void run() { 
     592                if(managerInt != null) { 
     593                    try {                            
    673594                        managerInt.incidentStarted(completedEvent.eventInfo.getLogNumber()); 
    674                     } catch (RemoteException re) 
    675                     { 
     595                    } 
     596                    catch (RemoteException re) { 
    676597                        //Simulation Manager has disappeared 
    677598                        managerInt = null; 
    678599                        CADSimulator.theViewer.setSimManagerStatus(false); 
    679600 
    680                         coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents", 
     601                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents",  
    681602                                "Connection to Simulation Manager has been dropped.", re); 
     603                    }                        
     604                }                    
     605            }                    
     606        };       
     607         
     608        Thread startThread = new Thread(startRun); 
     609        startThread.start(); 
     610    }       
     611 
     612    /** 
     613     * Method notifies observers with the IncidentEvent Object to signify 
     614     * that a new IncidentEvent has completed.  All XMLIncident Objects 
     615     * in the completed IncidentEvent is sent to the ParamicsControlManager 
     616     * for transmission to Paramics.  All CCTVInfo Objects are sent to the 
     617     * MediaManager for media control.  A thread is then spawned to notify the 
     618     * SimulationManager with the completed IncidentEvent. 
     619     *  
     620     * @param completedEvent Completed IncidentEvent. 
     621     * @see ParamicsControlManager 
     622     * @see MediaManager 
     623     */ 
     624    public void incidentUpdated(final IncidentEvent completedEvent) { 
     625        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_INQUIRY, 
     626                completedEvent.eventInfo));      
     627         
     628        for(XMLIncident xmlInc : completedEvent.XMLIncidents) 
     629            CADSimulator.theParamicsSimMgr.updateIncident(xmlInc); 
     630 
     631         
     632        /*for(CCTVInfo info : completedEvent.cctvInfos) { 
     633            CADSimulator.theMediaMgr.triggerIncident(info,  
     634                    completedEvent.eventInfo.getLogNumber()); 
     635        }*/ 
     636         
     637        Runnable displayRun = new Runnable() {                   
     638            public void run() { 
     639                if(managerInt != null) { 
     640                    try { 
     641                        managerInt.eventOccured( 
     642                                completedEvent.eventInfo.getLogNumber(),  
     643                                completedEvent); 
    682644                    } 
     645                    catch (RemoteException re) { 
     646                        //Simulation Manager has disappeared 
     647                        managerInt = null; 
     648                        CADSimulator.theViewer.setSimManagerStatus(false); 
     649 
     650                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents:run",  
     651                                "Connection to Simulation Manager has been dropped.", re); 
     652                    }                    
    683653                } 
    684654            } 
    685655        }; 
    686656 
    687         Thread startThread = new Thread(startRun); 
    688         startThread.start(); 
    689     } 
    690  
    691     /** 
    692      * Method notifies observers with the IncidentEvent Object to signify that a 
    693      * new IncidentEvent has completed. All XMLIncident Objects in the completed 
    694      * IncidentEvent is sent to the ParamicsControlManager for transmission to 
    695      * Paramics. All CCTVInfo Objects are sent to the MediaManager for media 
    696      * control. A thread is then spawned to notify the SimulationManager with 
    697      * the completed IncidentEvent. 
    698      * 
    699      * @param completedEvent Completed IncidentEvent. 
    700      * @see ParamicsControlManager 
    701      * @see MediaManager 
    702      */ 
    703     public void incidentUpdated(final IncidentEvent completedEvent) 
    704     { 
    705         notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_INQUIRY, 
    706                 completedEvent.eventInfo)); 
    707  
    708         for (XMLIncident xmlInc : completedEvent.XMLIncidents) 
    709         { 
    710             CADSimulator.theParamicsSimMgr.updateIncident(xmlInc); 
    711         } 
    712  
    713  
    714         /*for(CCTVInfo info : completedEvent.cctvInfos) { 
    715          CADSimulator.theMediaMgr.triggerIncident(info, 
    716          completedEvent.eventInfo.getLogNumber()); 
    717          }*/ 
    718  
    719         Runnable displayRun = new Runnable() 
    720         { 
    721             public void run() 
    722             { 
    723                 if (managerInt != null) 
    724                 { 
    725                     try 
    726                     { 
    727                         managerInt.eventOccured( 
    728                                 completedEvent.eventInfo.getLogNumber(), 
    729                                 completedEvent); 
    730                     } catch (RemoteException re) 
    731                     { 
    732                         //Simulation Manager has disappeared 
    733                         managerInt = null; 
    734                         CADSimulator.theViewer.setSimManagerStatus(false); 
    735  
    736                         coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents:run", 
    737                                 "Connection to Simulation Manager has been dropped.", re); 
    738                     } 
    739                 } 
    740             } 
    741         }; 
    742  
    743657        Thread displayThread = new Thread(displayRun); 
    744         displayThread.start(); 
    745     } 
    746  
     658        displayThread.start();         
     659    }       
     660     
    747661    /** 
    748662     * @see IncidentManager 
    749663     */ 
    750     public boolean incidentExists(Integer logNumber) 
    751     { 
     664    public boolean incidentExists(Integer logNumber) { 
    752665        return CADSimulator.theIncidentMgr.incidentExists(logNumber); 
    753666    } 
     
    756669     * @see IncidentManager 
    757670     */ 
    758     public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() 
    759     { 
     671    public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() { 
    760672        return CADSimulator.theIncidentMgr.getIncidentBoardModelObjects(); 
    761     } 
     673    }        
    762674 
    763675    /** 
    764676     * @see IncidentManager 
    765677     */ 
    766     public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) 
    767     { 
     678    public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) { 
    768679        return CADSimulator.theIncidentMgr.getIncidentInquiryModelObjects(logNumber); 
    769     } 
     680    }     
    770681 
    771682    /** 
    772683     * @see IncidentManager 
    773684     */ 
    774     public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() 
    775     { 
     685    public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() { 
    776686        return CADSimulator.theIncidentMgr.getIncidentSummaryModelObjects(); 
    777     } 
    778  
     687    }      
     688     
     689   
    779690    /** 
    780691     * Adds an observer to the list of observers. 
     
    782693     * @param o New observer object. 
    783694     */ 
    784     public void addObserver(Observer o) 
    785     { 
    786         observerList.add(o); 
    787     } 
    788  
    789     /** 
    790      * Removes an observer from the list of observers. If the observer is not 
    791      * found, this method returns false, else true is returned for a successful 
    792      * removal. 
     695    public void addObserver(Observer o) { 
     696        observerList.add(o);     
     697    } 
     698     
     699    /**  
     700     * Removes an observer from the list of observers.  If the observer 
     701     * is not found, this method returns false, else true is returned for 
     702     * a successful removal.  
    793703     * 
    794704     * @param o Observer to be removed. 
    795705     * @returns True if remove was successful, false if not. 
    796      */ 
    797     public boolean removeObserver(Observer o) 
    798     { 
     706     */      
     707    public boolean removeObserver(Observer o) { 
    799708        return observerList.remove(o); 
    800709    } 
    801  
    802     /** 
    803      * Notify all registered observers with the parameter ObserverMessage 
    804      * object. 
     710     
     711    /** 
     712     * Notify all registered observers with the parameter ObserverMessage object. 
    805713     * 
    806714     * @param newMsg The ObserverMessage to be sent. 
    807715     */ 
    808     private void notifyObservers(ObserverMessage newMsg) 
    809     { 
    810         for (Observer o : observerList) 
    811         { 
    812             o.update(null, newMsg); 
    813         } 
    814     } 
    815  
    816     public void refreshClients() throws RemoteException 
    817     { 
    818         for (int i = 0; i < clientList.size(); i++) 
    819         { 
     716    private void notifyObservers(ObserverMessage newMsg) { 
     717        for(Observer o : observerList)  
     718            o.update(null, newMsg);  
     719    } 
     720     
     721    public void refreshClients() throws RemoteException{ 
     722        for(int i = 0; i < clientList.size(); i++){ 
    820723            clientList.get(i).refresh(); 
    821724        } 
    822725    } 
    823  
     726     
    824727    /** 
    825728     * Checks the CADData for an existing incident with id 
    826      * 
    827729     * @param id the incident id 
    828730     * @return true if CADData contains such an incident, otherwise false. 
    829731     * @throws RemoteException 
    830732     */ 
    831     public boolean checkForValidIncidentID(int id) throws RemoteException 
    832     { 
     733     public boolean checkForValidIncidentID(int id) throws RemoteException{ 
    833734        return cadData.checkForValidId(id); 
    834     } 
    835  
    836     /** 
     735     } 
     736     
     737      
     738     /** 
    837739     * Uses an Incident's masterInc to lookup its ID. 
    838      * 
    839740     * @param masterInc the Incident to look up 
    840741     * @return the same Incident's ID, -1 if invalid masterInc 
    841742     * @throws RemoteException 
    842743     */ 
    843     public int getIncidentId(String masterInc) throws RemoteException 
    844     { 
    845         return cadData.getIncidentId(masterInc); 
    846     } 
    847  
     744     public int getIncidentId(String masterInc) throws RemoteException{ 
     745         return cadData.getIncidentId(masterInc); 
     746     } 
     747     
    848748    /** 
    849749     * Returns a table model out of CADData based on tag. 
    850      * 
    851      * @param tag a CADDataEnums tag 
    852      * @throws RemoteException 
    853      */ 
    854     public DefaultTableModel getCadDataTable(TABLE tag) throws RemoteException 
    855     { 
    856         if (tag.equals(TABLE.ASSIGNED_INCIDENTS)) 
    857         { 
     750     * @param tag a CADDataEnums tag 
     751     * @throws RemoteException 
     752     */ 
     753    public DefaultTableModel getCadDataTable(TABLE tag) throws RemoteException{ 
     754        if(tag.equals(TABLE.ASSIGNED_INCIDENTS)){ 
    858755            return cadData.tableForAssignedIncidents(); 
    859         } else if (tag.equals(TABLE.UNIT_STATUS)) 
    860         { 
     756        } 
     757        else if(tag.equals(TABLE.UNIT_STATUS)){ 
    861758            return cadData.tableForUnitStatus(); 
    862         } else if (tag.equals(TABLE.PENDING_INCIDENTS)) 
    863         { 
     759        } 
     760        else if(tag.equals(TABLE.PENDING_INCIDENTS)){ 
    864761            return cadData.tableForPendingIncidents(); 
    865         } else if (tag.equals(TABLE.INCIDENT_EDITOR)) 
    866         { 
     762        } 
     763        else if(tag.equals(TABLE.INCIDENT_EDITOR)){ 
    867764            return cadData.tableForIncidentEditor(); 
    868         } else 
    869         { 
     765        } 
     766        else{ 
    870767            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataTable"); 
    871768        } 
    872769    } 
    873  
     770     
    874771    /** 
    875772     * Returns the specified incident's table based on the tag. 
    876      * 
    877773     * @param tag a CADDataEnums tag 
    878774     * @param incidentId the incident's ID to look up 
     
    880776     * @throws RemoteException 
    881777     */ 
    882     public DefaultTableModel getCadDataIncidentTable(INC_TABLE tag, int incidentId) throws RemoteException 
    883     { 
    884         if (tag.equals(INC_TABLE.COMMENTS_NOTES)) 
    885         { 
    886             return cadData.getIncident(incidentId).getCommentsNotesTable(); 
    887         } 
    888         return null; 
    889     } 
    890  
     778    public DefaultTableModel getCadDataIncidentTable(INC_TABLE tag, int incidentId) throws RemoteException{ 
     779     if(tag.equals(INC_TABLE.COMMENTS_NOTES)){ 
     780         return cadData.getIncident(incidentId).getCommentsNotesTable(); 
     781     } 
     782     return null; 
     783    } 
     784     
    891785    /** 
    892786     * Adds a row of data to a specified incident's table based on the tag. 
    893      * 
    894787     * @param tag a CADDataEnums tag 
    895788     * @param incidentId the incident's ID to look up 
     
    897790     * @throws RemoteException 
    898791     */ 
    899     public void addCadDataIncidentTable(INC_TABLE tag, int incidentId, String[] fields) throws RemoteException 
    900     { 
    901         if (tag.equals(INC_TABLE.COMMENTS_NOTES)) 
    902         { 
    903             cadData.getIncident(incidentId).addToCommentsNotesTable(fields); 
    904         } 
    905     } 
    906  
     792    public void addCadDataIncidentTable(INC_TABLE tag, int incidentId, String[] fields) throws RemoteException{ 
     793     if(tag.equals(INC_TABLE.COMMENTS_NOTES)){ 
     794         cadData.getIncident(incidentId).addToCommentsNotesTable(fields); 
     795     } 
     796    } 
     797     
    907798    /** 
    908799     * Adds a row to the specified data table based on the incoming fields. 
    909      * 
    910      * @param tag a CADDataEnums tag 
    911      * @param incidentId the incident's ID to look up 
    912      * @throws RemoteException 
    913      */ 
    914     public void addCadDataTableRow(TABLE tag, String field1, String field2, String field3, String field4) throws RemoteException 
    915     { 
    916     } 
    917  
     800     * @param tag a CADDataEnums tag 
     801     * @param incidentId the incident's ID to look up 
     802     * @throws RemoteException 
     803     */ 
     804     public void addCadDataTableRow(TABLE tag, String field1, String field2, String field3, String field4) throws RemoteException{ 
     805          
     806     } 
     807     
     808      
     809      
    918810    /** 
    919811     * Returns an object out of Incident based on tag. 
    920      * 
    921      * @param tag a CADDataEnums tag 
    922      * @param incidentId the incident's ID to look up 
    923      * @throws RemoteException 
    924      */ 
    925     public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException 
    926     { 
    927         if (tag.equals(INC_VAL.LOG_NUM)) 
    928         { 
     812     * @param tag a CADDataEnums tag 
     813     * @param incidentId the incident's ID to look up 
     814     * @throws RemoteException 
     815     */ 
     816    public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException{ 
     817    if(tag.equals(INC_VAL.LOG_NUM)){ 
    929818            return cadData.getIncident(incidentId).getLogNum(); 
    930         } else if (tag.equals(INC_VAL.MASTER_INC)) 
    931         { 
     819        } 
     820        else if(tag.equals(INC_VAL.MASTER_INC)){ 
    932821            return cadData.getIncident(incidentId).getMasterInc(); 
    933         } else if (tag.equals(INC_VAL.OAU)) 
    934         { 
     822        } 
     823        else if(tag.equals(INC_VAL.OAU)){ 
    935824            return cadData.getIncident(incidentId).getOau(); 
    936         } else if (tag.equals(INC_VAL.P)) 
    937         { 
     825        } 
     826        else if(tag.equals(INC_VAL.P)){ 
    938827            return cadData.getIncident(incidentId).getP(); 
    939         } else if (tag.equals(INC_VAL.DESCRIPTION)) 
    940         { 
     828        } 
     829        else if(tag.equals(INC_VAL.DESCRIPTION)){ 
    941830            return cadData.getIncident(incidentId).getDescription(); 
    942         } else if (tag.equals(INC_VAL.RP)) 
    943         { 
     831        } 
     832        else if(tag.equals(INC_VAL.RP)){ 
    944833            return cadData.getIncident(incidentId).getRp(); 
    945         } else if (tag.equals(INC_VAL.RP_TYPE)) 
    946         { 
     834        } 
     835        else if(tag.equals(INC_VAL.RP_TYPE)){ 
    947836            return cadData.getIncident(incidentId).getRpType(); 
    948         } else if (tag.equals(INC_VAL.ALI)) 
    949         { 
     837        } 
     838        else if(tag.equals(INC_VAL.ALI)){ 
    950839            return cadData.getIncident(incidentId).getAli(); 
    951         } else if (tag.equals(INC_VAL.MEDIA)) 
    952         { 
     840        } 
     841        else if(tag.equals(INC_VAL.MEDIA)){ 
    953842            return cadData.getIncident(incidentId).getMedia(); 
    954         } else 
    955         { 
     843        } 
     844        else{ 
    956845            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncVal"); 
    957846        } 
    958847    } 
    959  
     848     
    960849    /** 
    961850     * Set incidentId's field based on tag to value. 
    962      * 
    963      * @param tag a CADDataEnums tag 
    964      * @param incidentId the incident's ID to look up 
    965      * @throws RemoteException 
    966      */ 
    967     public void setCadDataIncVal(INC_VAL tag, int incidentId, String value) throws RemoteException 
    968     { 
    969         if (tag.equals(INC_VAL.OAU)) 
    970         { 
     851     * @param tag a CADDataEnums tag 
     852     * @param incidentId the incident's ID to look up 
     853     * @throws RemoteException 
     854     */ 
     855    public void setCadDataIncVal(INC_VAL tag, int incidentId, String value) throws RemoteException{ 
     856        if(tag.equals(INC_VAL.OAU)){ 
    971857            cadData.getIncident(incidentId).setOau(value); 
    972         } else if (tag.equals(INC_VAL.P)) 
    973         { 
     858        } 
     859        else if(tag.equals(INC_VAL.P)){ 
    974860            cadData.getIncident(incidentId).setP(value); 
    975         } else if (tag.equals(INC_VAL.DESCRIPTION)) 
    976         { 
     861        } 
     862        else if(tag.equals(INC_VAL.DESCRIPTION)){ 
    977863            cadData.getIncident(incidentId).setDescription(value); 
    978         } else if (tag.equals(INC_VAL.RP)) 
    979         { 
     864        } 
     865        else if(tag.equals(INC_VAL.RP)){ 
    980866            cadData.getIncident(incidentId).setRp(value); 
    981         } else if (tag.equals(INC_VAL.RP_TYPE)) 
    982         { 
     867        } 
     868        else if(tag.equals(INC_VAL.RP_TYPE)){ 
    983869            cadData.getIncident(incidentId).setRpType(value); 
    984         } else if (tag.equals(INC_VAL.ALI)) 
    985         { 
     870        } 
     871        else if(tag.equals(INC_VAL.ALI)){ 
    986872            cadData.getIncident(incidentId).setAli(value); 
    987         } else if (tag.equals(INC_VAL.MEDIA)) 
    988         { 
     873        } 
     874        else if(tag.equals(INC_VAL.MEDIA)){ 
    989875            cadData.getIncident(incidentId).setMedia(value); 
    990         } else 
    991         { 
     876        } 
     877        else{ 
    992878            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncVal"); 
    993879        } 
    994880    } 
     881     
    995882 
    996883    /** 
    997884     * Returns a string out of IncidentLocation based on tag. 
    998      * 
    999      * @param tag a CADDataEnums tag 
    1000      * @param incidentId the incident's ID to look up 
    1001      * @throws RemoteException 
    1002      */ 
    1003     public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException 
    1004     { 
    1005         if (tag.equals(INC_LOC.ADDRESS)) 
    1006         { 
     885     * @param tag a CADDataEnums tag 
     886     * @param incidentId the incident's ID to look up 
     887     * @throws RemoteException 
     888     */ 
     889    public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException { 
     890        if(tag.equals(INC_LOC.ADDRESS)){ 
    1007891            return cadData.getIncident(incidentId).getIncidentLocation().getAddress(); 
    1008         } else if (tag.equals(INC_LOC.LOC)) 
    1009         { 
     892        } 
     893        else if(tag.equals(INC_LOC.LOC)){ 
    1010894            return cadData.getIncident(incidentId).getIncidentLocation().getLoc(); 
    1011         } else if (tag.equals(INC_LOC.CITY)) 
    1012         { 
     895        } 
     896        else if(tag.equals(INC_LOC.CITY)){ 
    1013897            return cadData.getIncident(incidentId).getIncidentLocation().getCity(); 
    1014         } else if (tag.equals(INC_LOC.COUNTY)) 
    1015         { 
     898        } 
     899        else if(tag.equals(INC_LOC.COUNTY)){ 
    1016900            return cadData.getIncident(incidentId).getIncidentLocation().getCounty(); 
    1017         } else if (tag.equals(INC_LOC.STATE)) 
    1018         { 
     901        } 
     902        else if(tag.equals(INC_LOC.STATE)){ 
    1019903            return cadData.getIncident(incidentId).getIncidentLocation().getState(); 
    1020         } else if (tag.equals(INC_LOC.ZIP)) 
    1021         { 
     904        } 
     905        else if(tag.equals(INC_LOC.ZIP)){ 
    1022906            return cadData.getIncident(incidentId).getIncidentLocation().getZip(); 
    1023         } else if (tag.equals(INC_LOC.BEAT)) 
    1024         { 
     907        } 
     908        else if(tag.equals(INC_LOC.BEAT)){ 
    1025909            return cadData.getIncident(incidentId).getIncidentLocation().getBeat(); 
    1026         } else if (tag.equals(INC_LOC.AREA)) 
    1027         { 
     910        } 
     911        else if(tag.equals(INC_LOC.AREA)){ 
    1028912            return cadData.getIncident(incidentId).getIncidentLocation().getArea(); 
    1029         } else if (tag.equals(INC_LOC.SECTOR)) 
    1030         { 
     913        } 
     914        else if(tag.equals(INC_LOC.SECTOR)){ 
    1031915            return cadData.getIncident(incidentId).getIncidentLocation().getSector(); 
    1032         } else if (tag.equals(INC_LOC.SECTOR_CODE)) 
    1033         { 
     916        } 
     917        else if(tag.equals(INC_LOC.SECTOR_CODE)){ 
    1034918            return cadData.getIncident(incidentId).getIncidentLocation().getSectorCode(); 
    1035         } else if (tag.equals(INC_LOC.DIVISION)) 
    1036         { 
     919        } 
     920        else if(tag.equals(INC_LOC.DIVISION)){ 
    1037921            return cadData.getIncident(incidentId).getIncidentLocation().getDivision(); 
    1038         } else if (tag.equals(INC_LOC.APT)) 
    1039         { 
     922        } 
     923        else if(tag.equals(INC_LOC.APT)){ 
    1040924            return cadData.getIncident(incidentId).getIncidentLocation().getApt(); 
    1041         } else if (tag.equals(INC_LOC.BUILDING)) 
    1042         { 
     925        } 
     926        else if(tag.equals(INC_LOC.BUILDING)){ 
    1043927            return cadData.getIncident(incidentId).getIncidentLocation().getBuilding(); 
    1044         } else if (tag.equals(INC_LOC.CROSS_ST)) 
    1045         { 
     928        } 
     929        else if(tag.equals(INC_LOC.CROSS_ST)){ 
    1046930            return cadData.getIncident(incidentId).getIncidentLocation().getCrossSt(); 
    1047         } else if (tag.equals(INC_LOC.LAW)) 
    1048         { 
     931        } 
     932        else if(tag.equals(INC_LOC.LAW)){ 
    1049933            return cadData.getIncident(incidentId).getIncidentLocation().getLaw(); 
    1050         } else if (tag.equals(INC_LOC.FIRE)) 
    1051         { 
     934        } 
     935        else if(tag.equals(INC_LOC.FIRE)){ 
    1052936            return cadData.getIncident(incidentId).getIncidentLocation().getFire(); 
    1053         } else if (tag.equals(INC_LOC.EMS)) 
    1054         { 
     937        } 
     938        else if(tag.equals(INC_LOC.EMS)){ 
    1055939            return cadData.getIncident(incidentId).getIncidentLocation().getEms(); 
    1056         } else 
    1057         { 
     940        } 
     941        else{ 
    1058942            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncLoc"); 
    1059943        } 
     
    1062946    /** 
    1063947     * Set incidentId's field based on tag to value. 
    1064      * 
    1065      * @param tag a CADDataEnums tag 
    1066      * @param incidentId the incident's ID to look up 
    1067      * @throws RemoteException 
    1068      */ 
    1069     public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException 
    1070     { 
    1071         if (tag.equals(INC_LOC.ADDRESS)) 
    1072         { 
     948     * @param tag a CADDataEnums tag 
     949     * @param incidentId the incident's ID to look up 
     950     * @throws RemoteException 
     951     */ 
     952    public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException{ 
     953        if(tag.equals(INC_LOC.ADDRESS)){ 
    1073954            cadData.getIncident(incidentId).getIncidentLocation().setAddress(value); 
    1074         } else if (tag.equals(INC_LOC.LOC)) 
    1075         { 
     955        } 
     956        else if(tag.equals(INC_LOC.LOC)){ 
    1076957            cadData.getIncident(incidentId).getIncidentLocation().setLoc(value); 
    1077         } else if (tag.equals(INC_LOC.CITY)) 
    1078         { 
     958        } 
     959        else if(tag.equals(INC_LOC.CITY)){ 
    1079960            cadData.getIncident(incidentId).getIncidentLocation().setCity(value); 
    1080         } else if (tag.equals(INC_LOC.COUNTY)) 
    1081         { 
     961        } 
     962        else if(tag.equals(INC_LOC.COUNTY)){ 
    1082963            cadData.getIncident(incidentId).getIncidentLocation().setCounty(value); 
    1083         } else if (tag.equals(INC_LOC.STATE)) 
    1084         { 
     964        } 
     965        else if(tag.equals(INC_LOC.STATE)){ 
    1085966            cadData.getIncident(incidentId).getIncidentLocation().setState(value); 
    1086         } else if (tag.equals(INC_LOC.ZIP)) 
    1087         { 
     967        } 
     968        else if(tag.equals(INC_LOC.ZIP)){ 
    1088969            cadData.getIncident(incidentId).getIncidentLocation().setZip(value); 
    1089         } else if (tag.equals(INC_LOC.BEAT)) 
    1090         { 
     970        } 
     971        else if(tag.equals(INC_LOC.BEAT)){ 
    1091972            cadData.getIncident(incidentId).getIncidentLocation().setBeat(value); 
    1092         } else if (tag.equals(INC_LOC.AREA)) 
    1093         { 
     973        } 
     974        else if(tag.equals(INC_LOC.AREA)){ 
    1094975            cadData.getIncident(incidentId).getIncidentLocation().setArea(value); 
    1095         } else if (tag.equals(INC_LOC.SECTOR)) 
    1096         { 
     976        } 
     977        else if(tag.equals(INC_LOC.SECTOR)){ 
    1097978            cadData.getIncident(incidentId).getIncidentLocation().setSector(value); 
    1098         } else if (tag.equals(INC_LOC.SECTOR_CODE)) 
    1099         { 
     979        } 
     980        else if(tag.equals(INC_LOC.SECTOR_CODE)){ 
    1100981            cadData.getIncident(incidentId).getIncidentLocation().setSectorCode(value); 
    1101         } else if (tag.equals(INC_LOC.DIVISION)) 
    1102         { 
     982        } 
     983        else if(tag.equals(INC_LOC.DIVISION)){ 
    1103984            cadData.getIncident(incidentId).getIncidentLocation().setDivision(value); 
    1104         } else if (tag.equals(INC_LOC.APT)) 
    1105         { 
     985        } 
     986        else if(tag.equals(INC_LOC.APT)){ 
    1106987            cadData.getIncident(incidentId).getIncidentLocation().setApt(value); 
    1107         } else if (tag.equals(INC_LOC.BUILDING)) 
    1108         { 
     988        } 
     989        else if(tag.equals(INC_LOC.BUILDING)){ 
    1109990            cadData.getIncident(incidentId).getIncidentLocation().setBuilding(value); 
    1110         } else if (tag.equals(INC_LOC.CROSS_ST)) 
    1111         { 
     991        } 
     992        else if(tag.equals(INC_LOC.CROSS_ST)){ 
    1112993            cadData.getIncident(incidentId).getIncidentLocation().setCrossSt(value); 
    1113         } else if (tag.equals(INC_LOC.LAW)) 
    1114         { 
     994        } 
     995        else if(tag.equals(INC_LOC.LAW)){ 
    1115996            cadData.getIncident(incidentId).getIncidentLocation().setLaw(value); 
    1116         } else if (tag.equals(INC_LOC.FIRE)) 
    1117         { 
     997        } 
     998        else if(tag.equals(INC_LOC.FIRE)){ 
    1118999            cadData.getIncident(incidentId).getIncidentLocation().setFire(value); 
    1119         } else if (tag.equals(INC_LOC.EMS)) 
    1120         { 
     1000        } 
     1001        else if(tag.equals(INC_LOC.EMS)){ 
    11211002            cadData.getIncident(incidentId).getIncidentLocation().setEms(value); 
    1122         } else 
    1123         { 
     1003        } 
     1004        else{ 
    11241005            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncLoc"); 
    11251006        } 
    11261007    } 
    1127  
     1008     
    11281009    /** 
    11291010     * Returns a string out of IncidentCaller based on tag. 
    1130      * 
    1131      * @param tag a CADDataEnums tag 
    1132      * @param incidentId the incident's ID to look up 
    1133      * @throws RemoteException 
    1134      */ 
    1135     public String getCadDataIncCaller(INC_CALLER tag, int incidentId) throws RemoteException 
    1136     { 
    1137         if (tag.equals(INC_CALLER.TYPE)) 
    1138         { 
     1011     * @param tag a CADDataEnums tag 
     1012     * @param incidentId the incident's ID to look up 
     1013     * @throws RemoteException 
     1014     */ 
     1015    public String getCadDataIncCaller(INC_CALLER tag, int incidentId) throws RemoteException { 
     1016        if(tag.equals(INC_CALLER.TYPE)){ 
    11391017            return cadData.getIncident(incidentId).getIncidentCaller().getCallerType(); 
    1140         } else if (tag.equals(INC_CALLER.NAME)) 
    1141         { 
     1018        } 
     1019        else if(tag.equals(INC_CALLER.NAME)){ 
    11421020            return cadData.getIncident(incidentId).getIncidentCaller().getCallerName(); 
    1143         } else if (tag.equals(INC_CALLER.PHONE)) 
    1144         { 
     1021        } 
     1022        else if(tag.equals(INC_CALLER.PHONE)){ 
    11451023            return cadData.getIncident(incidentId).getIncidentCaller().getPhone(); 
    1146         } else if (tag.equals(INC_CALLER.EXT)) 
    1147         { 
     1024        } 
     1025        else if(tag.equals(INC_CALLER.EXT)){ 
    11481026            return cadData.getIncident(incidentId).getIncidentCaller().getExt(); 
    1149         } else 
    1150         { 
     1027        } 
     1028        else{ 
    11511029            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCaller"); 
    11521030        } 
     
    11551033    /** 
    11561034     * Set incidentId's field based on tag to value. 
    1157      * 
    1158      * @param tag a CADDataEnums tag 
    1159      * @param incidentId the incident's ID to look up 
    1160      * @throws RemoteException 
    1161      */ 
    1162     public void setCadDataIncCaller(INC_CALLER tag, int incidentId, String value) throws RemoteException 
    1163     { 
    1164         if (tag.equals(INC_CALLER.TYPE)) 
    1165         { 
     1035     * @param tag a CADDataEnums tag 
     1036     * @param incidentId the incident's ID to look up 
     1037     * @throws RemoteException 
     1038     */ 
     1039    public void setCadDataIncCaller(INC_CALLER tag, int incidentId, String value) throws RemoteException{ 
     1040        if(tag.equals(INC_CALLER.TYPE)){ 
    11661041            cadData.getIncident(incidentId).getIncidentCaller().setCallerType(value); 
    1167         } else if (tag.equals(INC_CALLER.NAME)) 
    1168         { 
     1042        } 
     1043        else if(tag.equals(INC_CALLER.NAME)){ 
    11691044            cadData.getIncident(incidentId).getIncidentCaller().setCallerName(value); 
    1170         } else if (tag.equals(INC_CALLER.PHONE)) 
    1171         { 
     1045        } 
     1046        else if(tag.equals(INC_CALLER.PHONE)){ 
    11721047            cadData.getIncident(incidentId).getIncidentCaller().setPhone(value); 
    1173         } else if (tag.equals(INC_CALLER.EXT)) 
    1174         { 
     1048        } 
     1049        else if(tag.equals(INC_CALLER.EXT)){ 
    11751050            cadData.getIncident(incidentId).getIncidentCaller().setExt(value); 
    1176         } else 
    1177         { 
     1051        } 
     1052        else{ 
    11781053            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncCaller"); 
    11791054        } 
    11801055    } 
    1181  
     1056     
    11821057    /** 
    11831058     * Returns a string out of IncidentProblem based on tag. 
    1184      * 
    1185      * @param tag a CADDataEnums tag 
    1186      * @param incidentId the incident's ID to look up 
    1187      * @throws RemoteException 
    1188      */ 
    1189     public String getCadDataIncProblem(INC_PROBLEM tag, int incidentId) throws RemoteException 
    1190     { 
    1191         if (tag.equals(INC_PROBLEM.PROBLEM)) 
    1192         { 
     1059     * @param tag a CADDataEnums tag 
     1060     * @param incidentId the incident's ID to look up 
     1061     * @throws RemoteException 
     1062     */ 
     1063    public String getCadDataIncProblem(INC_PROBLEM tag, int incidentId) throws RemoteException { 
     1064        if(tag.equals(INC_PROBLEM.PROBLEM)){ 
    11931065            return cadData.getIncident(incidentId).getProblem().getProblem(); 
    1194         } else if (tag.equals(INC_PROBLEM.CODE)) 
    1195         { 
     1066        } 
     1067        else if(tag.equals(INC_PROBLEM.CODE)){ 
    11961068            return cadData.getIncident(incidentId).getProblem().getProblemCode(); 
    1197         } else if (tag.equals(INC_PROBLEM.PRIORITY)) 
    1198         { 
     1069        } 
     1070        else if(tag.equals(INC_PROBLEM.PRIORITY)){ 
    11991071            return cadData.getIncident(incidentId).getProblem().getPriority(); 
    1200         } else 
    1201         { 
     1072        } 
     1073        else{ 
    12021074            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncProblem"); 
    12031075        } 
    12041076    } 
    1205  
     1077     
    12061078    /** 
    12071079     * Set incidentId's field based on tag to value. 
    1208      * 
    1209      * @param tag a CADDataEnums tag 
    1210      * @param incidentId the incident's ID to look up 
    1211      * @throws RemoteException 
    1212      */ 
    1213     public void setCadDataIncProblem(INC_PROBLEM tag, int incidentId, String value) throws RemoteException 
    1214     { 
    1215         if (tag.equals(INC_PROBLEM.PROBLEM)) 
    1216         { 
     1080     * @param tag a CADDataEnums tag 
     1081     * @param incidentId the incident's ID to look up 
     1082     * @throws RemoteException 
     1083     */ 
     1084    public void setCadDataIncProblem(INC_PROBLEM tag, int incidentId, String value) throws RemoteException{ 
     1085        if(tag.equals(INC_PROBLEM.PROBLEM)){ 
    12171086            cadData.getIncident(incidentId).getProblem().setProblem(value); 
    1218         } else if (tag.equals(INC_PROBLEM.CODE)) 
    1219         { 
     1087        } 
     1088        else if(tag.equals(INC_PROBLEM.CODE)){ 
    12201089            cadData.getIncident(incidentId).getProblem().setProblemCode(value); 
    1221         } else if (tag.equals(INC_PROBLEM.PRIORITY)) 
    1222         { 
     1090        } 
     1091        else if(tag.equals(INC_PROBLEM.PRIORITY)){ 
    12231092            cadData.getIncident(incidentId).getProblem().setPriority(value); 
    1224         } else 
    1225         { 
     1093        } 
     1094        else{ 
    12261095            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncProblem"); 
    12271096        } 
     
    12301099    /** 
    12311100     * Returns a string out of IncidentGeneralInfo based on tag. 
    1232      * 
    1233      * @param tag a CADDataEnums tag 
    1234      * @param incidentId the incident's ID to look up 
    1235      * @throws RemoteException 
    1236      */ 
    1237     public String getCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId) throws RemoteException 
    1238     { 
    1239         if (tag.equals(INC_GEN_INFO.JURISDICTION)) 
    1240         { 
     1101     * @param tag a CADDataEnums tag 
     1102     * @param incidentId the incident's ID to look up 
     1103     * @throws RemoteException 
     1104     */ 
     1105    public String getCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId) throws RemoteException { 
     1106        if(tag.equals(INC_GEN_INFO.JURISDICTION)){ 
    12411107            return cadData.getIncident(incidentId).getGenInfo().getJurisdiction(); 
    1242         } else if (tag.equals(INC_GEN_INFO.ALARM)) 
    1243         { 
     1108        } 
     1109        else if(tag.equals(INC_GEN_INFO.ALARM)){ 
    12441110            return cadData.getIncident(incidentId).getGenInfo().getAlarm(); 
    1245         } else if (tag.equals(INC_GEN_INFO.AGY)) 
    1246         { 
     1111        } 
     1112        else if(tag.equals(INC_GEN_INFO.AGY)){ 
    12471113            return cadData.getIncident(incidentId).getGenInfo().getAgy(); 
    1248         } else 
    1249         { 
     1114        } 
     1115        else{ 
    12501116            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncGenInfo"); 
    12511117        } 
     
    12541120    /** 
    12551121     * Set incidentId's field based on tag to value. 
    1256      * 
    1257      * @param tag a CADDataEnums tag 
    1258      * @param incidentId the incident's ID to look up 
    1259      * @throws RemoteException 
    1260      */ 
    1261     public void setCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId, String value) throws RemoteException 
    1262     { 
    1263         if (tag.equals(INC_GEN_INFO.JURISDICTION)) 
    1264         { 
     1122     * @param tag a CADDataEnums tag 
     1123     * @param incidentId the incident's ID to look up 
     1124     * @throws RemoteException 
     1125     */ 
     1126    public void setCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId, String value) throws RemoteException{ 
     1127        if(tag.equals(INC_GEN_INFO.JURISDICTION)){ 
    12651128            cadData.getIncident(incidentId).getGenInfo().setJurisdiction(value); 
    1266         } else if (tag.equals(INC_GEN_INFO.ALARM)) 
    1267         { 
     1129        } 
     1130        else if(tag.equals(INC_GEN_INFO.ALARM)){ 
    12681131            cadData.getIncident(incidentId).getGenInfo().setAlarm(value); 
    1269         } else if (tag.equals(INC_GEN_INFO.AGY)) 
    1270         { 
     1132        } 
     1133        else if(tag.equals(INC_GEN_INFO.AGY)){ 
    12711134            cadData.getIncident(incidentId).getGenInfo().setAgy(value); 
    1272         } else 
    1273         { 
     1135        } 
     1136        else{ 
    12741137            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncGenInfo"); 
    12751138        } 
    12761139    } 
    1277  
     1140     
    12781141    /** 
    12791142     * Returns a string out of IncidentResponse based on tag. 
    1280      * 
    1281      * @param tag a CADDataEnums tag 
    1282      * @param incidentId the incident's ID to look up 
    1283      * @throws RemoteException 
    1284      */ 
    1285     public String getCadDataIncResp(INC_RESP tag, int incidentId) throws RemoteException 
    1286     { 
    1287         if (tag.equals(INC_RESP.PLAN)) 
    1288         { 
     1143     * @param tag a CADDataEnums tag 
     1144     * @param incidentId the incident's ID to look up 
     1145     * @throws RemoteException 
     1146     */ 
     1147    public String getCadDataIncResp(INC_RESP tag, int incidentId) throws RemoteException { 
     1148        if(tag.equals(INC_RESP.PLAN)){ 
    12891149            return cadData.getIncident(incidentId).getResponse().getPlan(); 
    1290         } else if (tag.equals(INC_RESP.AREA)) 
    1291         { 
     1150        } 
     1151        else if(tag.equals(INC_RESP.AREA)){ 
    12921152            return cadData.getIncident(incidentId).getResponse().getArea(); 
    1293         } else 
    1294         { 
     1153        } 
     1154        else{ 
    12951155            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncResp"); 
    12961156        } 
    12971157    } 
    1298  
     1158     
    12991159    /** 
    13001160     * Set incidentId's field based on tag to value. 
    1301      * 
    1302      * @param tag a CADDataEnums tag 
    1303      * @param incidentId the incident's ID to look up 
    1304      * @throws RemoteException 
    1305      */ 
    1306     public void setCadDataIncResp(INC_RESP tag, int incidentId, String value) throws RemoteException 
    1307     { 
    1308         if (tag.equals(INC_RESP.PLAN)) 
    1309         { 
     1161     * @param tag a CADDataEnums tag 
     1162     * @param incidentId the incident's ID to look up 
     1163     * @throws RemoteException 
     1164     */ 
     1165    public void setCadDataIncResp(INC_RESP tag, int incidentId, String value) throws RemoteException{ 
     1166        if(tag.equals(INC_RESP.PLAN)){ 
    13101167            cadData.getIncident(incidentId).getResponse().setPlan(value); 
    1311         } else if (tag.equals(INC_RESP.AREA)) 
    1312         { 
     1168        } 
     1169        else if(tag.equals(INC_RESP.AREA)){ 
    13131170            cadData.getIncident(incidentId).getResponse().setArea(value); 
    1314         } else 
    1315         { 
     1171        } 
     1172        else{ 
    13161173            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncResp"); 
    13171174        } 
     
    13201177    /** 
    13211178     * Returns a string out of IncidentAdditionalInfo based on tag. 
    1322      * 
    1323      * @param tag a CADDataEnums tag 
    1324      * @param incidentId the incident's ID to look up 
    1325      * @throws RemoteException 
    1326      */ 
    1327     public String getCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId) throws RemoteException 
    1328     { 
    1329         if (tag.equals(INC_ADD_INFO.TYPE)) 
    1330         { 
     1179     * @param tag a CADDataEnums tag 
     1180     * @param incidentId the incident's ID to look up 
     1181     * @throws RemoteException 
     1182     */ 
     1183    public String getCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId) throws RemoteException { 
     1184        if(tag.equals(INC_ADD_INFO.TYPE)){ 
    13311185            return cadData.getIncident(incidentId).getAdditionalInfo().getType(); 
    1332         } else if (tag.equals(INC_ADD_INFO.TYPE_CODE)) 
    1333         { 
     1186        } 
     1187        else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){ 
    13341188            return cadData.getIncident(incidentId).getAdditionalInfo().getTypeCode(); 
    1335         } else if (tag.equals(INC_ADD_INFO.MACHINE)) 
    1336         { 
     1189        } 
     1190        else if(tag.equals(INC_ADD_INFO.MACHINE)){ 
    13371191            return cadData.getIncident(incidentId).getAdditionalInfo().getMachine(); 
    1338         } else if (tag.equals(INC_ADD_INFO.CALL_STATUS)) 
    1339         { 
     1192        } 
     1193        else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){ 
    13401194            return cadData.getIncident(incidentId).getAdditionalInfo().getCallStatus(); 
    1341         } else if (tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)) 
    1342         { 
     1195        } 
     1196        else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){ 
    13431197            return cadData.getIncident(incidentId).getAdditionalInfo().getCallTakerExt(); 
    1344         } else if (tag.equals(INC_ADD_INFO.ALARM_LEVEL)) 
    1345         { 
     1198        } 
     1199        else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){ 
    13461200            return cadData.getIncident(incidentId).getAdditionalInfo().getAlarmLevel(); 
    1347         } else if (tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)) 
    1348         { 
     1201        } 
     1202        else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){ 
    13491203            return cadData.getIncident(incidentId).getAdditionalInfo().getRotationProviderArea(); 
    1350         } else if (tag.equals(INC_ADD_INFO.COMMENT)) 
    1351         { 
     1204        } 
     1205        else if(tag.equals(INC_ADD_INFO.COMMENT)){ 
    13521206            return cadData.getIncident(incidentId).getAdditionalInfo().getComment(); 
    1353         } else 
    1354         { 
     1207        } 
     1208        else{ 
    13551209            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncAddInfo"); 
    13561210        } 
     
    13591213    /** 
    13601214     * Set incidentId's field based on tag to value. 
    1361      * 
    1362      * @param tag a CADDataEnums tag 
    1363      * @param incidentId the incident's ID to look up 
    1364      * @throws RemoteException 
    1365      */ 
    1366     public void setCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId, String value) throws RemoteException 
    1367     { 
    1368         if (tag.equals(INC_ADD_INFO.TYPE)) 
    1369         { 
     1215     * @param tag a CADDataEnums tag 
     1216     * @param incidentId the incident's ID to look up 
     1217     * @throws RemoteException 
     1218     */ 
     1219    public void setCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId, String value) throws RemoteException{ 
     1220        if(tag.equals(INC_ADD_INFO.TYPE)){ 
    13701221            cadData.getIncident(incidentId).getAdditionalInfo().setType(value); 
    1371         } else if (tag.equals(INC_ADD_INFO.TYPE_CODE)) 
    1372         { 
     1222        } 
     1223        else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){ 
    13731224            cadData.getIncident(incidentId).getAdditionalInfo().setTypeCode(value); 
    1374         } else if (tag.equals(INC_ADD_INFO.MACHINE)) 
    1375         { 
     1225        } 
     1226        else if(tag.equals(INC_ADD_INFO.MACHINE)){ 
    13761227            cadData.getIncident(incidentId).getAdditionalInfo().setMachine(value); 
    1377         } else if (tag.equals(INC_ADD_INFO.CALL_STATUS)) 
    1378         { 
     1228        } 
     1229        else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){ 
    13791230            cadData.getIncident(incidentId).getAdditionalInfo().setCallStatus(value); 
    1380         } else if (tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)) 
    1381         { 
     1231        } 
     1232        else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){ 
    13821233            cadData.getIncident(incidentId).getAdditionalInfo().setCallTakerExt(value); 
    1383         } else if (tag.equals(INC_ADD_INFO.ALARM_LEVEL)) 
    1384         { 
     1234        } 
     1235        else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){ 
    13851236            cadData.getIncident(incidentId).getAdditionalInfo().setAlarmLevel(value); 
    1386         } else if (tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)) 
    1387         { 
     1237        } 
     1238        else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){ 
    13881239            cadData.getIncident(incidentId).getAdditionalInfo().setRotationProviderArea(value); 
    1389         } else if (tag.equals(INC_ADD_INFO.COMMENT)) 
    1390         { 
     1240        } 
     1241        else if(tag.equals(INC_ADD_INFO.COMMENT)){ 
    13911242            cadData.getIncident(incidentId).getAdditionalInfo().setComment(value); 
    1392         } else 
    1393         { 
     1243        } 
     1244        else{ 
    13941245            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncAddInfo"); 
    13951246        } 
    13961247    } 
    1397  
     1248     
    13981249    /** 
    13991250     * Returns a string out of IncidentActivities based on tag. 
    1400      * 
    1401      * @param tag a CADDataEnums tag 
    1402      * @param incidentId the incident's ID to look up 
    1403      * @throws RemoteException 
    1404      */ 
    1405     public String getCadDataIncActivities(INC_ACTIVITIES tag, int incidentId) throws RemoteException 
    1406     { 
    1407         if (tag.equals(INC_ACTIVITIES.VEHICLE)) 
    1408         { 
     1251     * @param tag a CADDataEnums tag 
     1252     * @param incidentId the incident's ID to look up 
     1253     * @throws RemoteException 
     1254     */ 
     1255    public String getCadDataIncActivities(INC_ACTIVITIES tag, int incidentId) throws RemoteException { 
     1256        if(tag.equals(INC_ACTIVITIES.VEHICLE)){ 
    14091257            return cadData.getIncident(incidentId).getActivities().getVehicle(); 
    1410         } else if (tag.equals(INC_ACTIVITIES.ACTIVITY)) 
    1411         { 
     1258        } 
     1259        else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){ 
    14121260            return cadData.getIncident(incidentId).getActivities().getActivity(); 
    1413         } else if (tag.equals(INC_ACTIVITIES.LOCATION)) 
    1414         { 
     1261        } 
     1262        else if(tag.equals(INC_ACTIVITIES.LOCATION)){ 
    14151263            return cadData.getIncident(incidentId).getActivities().getLocation(); 
    1416         } else if (tag.equals(INC_ACTIVITIES.COMMENT)) 
    1417         { 
     1264        } 
     1265        else if(tag.equals(INC_ACTIVITIES.COMMENT)){ 
    14181266            return cadData.getIncident(incidentId).getActivities().getComment(); 
    1419         } else if (tag.equals(INC_ACTIVITIES.DISP)) 
    1420         { 
     1267        } 
     1268        else if(tag.equals(INC_ACTIVITIES.DISP)){ 
    14211269            return cadData.getIncident(incidentId).getActivities().getDisp(); 
    1422         } else 
    1423         { 
     1270        } 
     1271        else{ 
    14241272            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncActivities"); 
    14251273        } 
     
    14281276    /** 
    14291277     * Set incidentId's field based on tag to value. 
    1430      * 
    1431      * @param tag a CADDataEnums tag 
    1432      * @param incidentId the incident's ID to look up 
    1433      * @throws RemoteException 
    1434      */ 
    1435     public void setCadDataIncActivities(INC_ACTIVITIES tag, int incidentId, String value) throws RemoteException 
    1436     { 
    1437         if (tag.equals(INC_ACTIVITIES.VEHICLE)) 
    1438         { 
     1278     * @param tag a CADDataEnums tag 
     1279     * @param incidentId the incident's ID to look up 
     1280     * @throws RemoteException 
     1281     */ 
     1282    public void setCadDataIncActivities(INC_ACTIVITIES tag, int incidentId, String value) throws RemoteException{ 
     1283        if(tag.equals(INC_ACTIVITIES.VEHICLE)){ 
    14391284            cadData.getIncident(incidentId).getActivities().setVehicle(value); 
    1440         } else if (tag.equals(INC_ACTIVITIES.ACTIVITY)) 
    1441         { 
     1285        } 
     1286        else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){ 
    14421287            cadData.getIncident(incidentId).getActivities().setActivity(value); 
    1443         } else if (tag.equals(INC_ACTIVITIES.LOCATION)) 
    1444         { 
     1288        } 
     1289        else if(tag.equals(INC_ACTIVITIES.LOCATION)){ 
    14451290            cadData.getIncident(incidentId).getActivities().setLocation(value); 
    1446         } else if (tag.equals(INC_ACTIVITIES.COMMENT)) 
    1447         { 
     1291        } 
     1292        else if(tag.equals(INC_ACTIVITIES.COMMENT)){ 
    14481293            cadData.getIncident(incidentId).getActivities().setComment(value); 
    1449         } else if (tag.equals(INC_ACTIVITIES.DISP)) 
    1450         { 
     1294        } 
     1295        else if(tag.equals(INC_ACTIVITIES.DISP)){ 
    14511296            cadData.getIncident(incidentId).getActivities().setDisp(value); 
    1452         } else 
    1453         { 
     1297        } 
     1298        else{ 
    14541299            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncActivities"); 
    14551300        } 
    14561301    } 
    1457  
     1302     
    14581303    /** 
    14591304     * Returns a string out of IncidentCallback based on tag. 
    1460      * 
    1461      * @param tag a CADDataEnums tag 
    1462      * @param incidentId the incident's ID to look up 
    1463      * @throws RemoteException 
    1464      */ 
    1465     public String getCadDataIncCallBack(INC_CALLBACK tag, int incidentId) throws RemoteException 
    1466     { 
    1467         if (tag.equals(INC_CALLBACK.INITIAL)) 
    1468         { 
     1305     * @param tag a CADDataEnums tag 
     1306     * @param incidentId the incident's ID to look up 
     1307     * @throws RemoteException 
     1308     */ 
     1309    public String getCadDataIncCallBack(INC_CALLBACK tag, int incidentId) throws RemoteException { 
     1310        if(tag.equals(INC_CALLBACK.INITIAL)){ 
    14691311            return cadData.getIncident(incidentId).getCallBacks().getInitial(); 
    1470         } else if (tag.equals(INC_CALLBACK.COMMENT)) 
    1471         { 
     1312        } 
     1313        else if(tag.equals(INC_CALLBACK.COMMENT)){ 
    14721314            return cadData.getIncident(incidentId).getCallBacks().getComment(); 
    1473         } else 
    1474         { 
     1315        } 
     1316        else{ 
    14751317            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCallBack"); 
    14761318        } 
     
    14791321    /** 
    14801322     * Returns a string out of IncidentEditLog based on tag. 
    1481      * 
    1482      * @param tag a CADDataEnums tag 
    1483      * @param incidentId the incident's ID to look up 
    1484      * @throws RemoteException 
    1485      */ 
    1486     public String getCadDataIncEditLog(INC_EDIT_LOG tag, int incidentId) throws RemoteException 
    1487     { 
    1488         if (tag.equals(INC_EDIT_LOG.EDIT)) 
    1489         { 
     1323     * @param tag a CADDataEnums tag 
     1324     * @param incidentId the incident's ID to look up 
     1325     * @throws RemoteException 
     1326     */ 
     1327    public String getCadDataIncEditLog(INC_EDIT_LOG tag, int incidentId) throws RemoteException { 
     1328        if(tag.equals(INC_EDIT_LOG.EDIT)){ 
    14901329            return cadData.getIncident(incidentId).getEditLog().getEdit(); 
    1491         } else if (tag.equals(INC_EDIT_LOG.REASON)) 
    1492         { 
     1330        } 
     1331        else if(tag.equals(INC_EDIT_LOG.REASON)){ 
    14931332            return cadData.getIncident(incidentId).getEditLog().getReason(); 
    1494         } else if (tag.equals(INC_EDIT_LOG.CHANGE_BY)) 
    1495         { 
     1333        } 
     1334        else if(tag.equals(INC_EDIT_LOG.CHANGE_BY)){ 
    14961335            return cadData.getIncident(incidentId).getEditLog().getChangeBy(); 
    1497         } else if (tag.equals(INC_EDIT_LOG.TERMINAL)) 
    1498         { 
     1336        } 
     1337        else if(tag.equals(INC_EDIT_LOG.TERMINAL)){ 
    14991338            return cadData.getIncident(incidentId).getEditLog().getTerminal(); 
    1500         } else 
    1501         { 
     1339        } 
     1340        else{ 
    15021341            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncEditLog"); 
    15031342        } 
     
    15061345    /** 
    15071346     * Returns a string out of IncidentInfo based on tag. 
    1508      * 
    1509      * @param tag a CADDataEnums tag 
    1510      * @param incidentId the incident's ID to look up 
    1511      * @throws RemoteException 
    1512      */ 
    1513     public String getCadDataIncInfo(INC_INFO tag, int incidentId) throws RemoteException 
    1514     { 
    1515         if (tag.equals(INC_INFO.CALL_INITIATED)) 
    1516         { 
     1347     * @param tag a CADDataEnums tag 
     1348     * @param incidentId the incident's ID to look up 
     1349     * @throws RemoteException 
     1350     */ 
     1351    public String getCadDataIncInfo(INC_INFO tag, int incidentId) throws RemoteException { 
     1352        if(tag.equals(INC_INFO.CALL_INITIATED)){ 
    15171353            return cadData.getIncident(incidentId).getInfo().getCallInit(); 
    1518         } else if (tag.equals(INC_INFO.CALL_TAKEN)) 
    1519         { 
     1354        } 
     1355        else if(tag.equals(INC_INFO.CALL_TAKEN)){ 
    15201356            return cadData.getIncident(incidentId).getInfo().getCallTaken(); 
    1521         } else if (tag.equals(INC_INFO.TIME_IN_Q)) 
    1522         { 
     1357        } 
     1358        else if(tag.equals(INC_INFO.TIME_IN_Q)){ 
    15231359            return cadData.getIncident(incidentId).getInfo().getTimeInQ(); 
    1524         } else if (tag.equals(INC_INFO.LAST_UPDATED)) 
    1525         { 
     1360        } 
     1361        else if(tag.equals(INC_INFO.LAST_UPDATED)){ 
    15261362            return cadData.getIncident(incidentId).getInfo().getLastUpdated(); 
    1527         } else 
    1528         { 
     1363        } 
     1364        else{ 
    15291365            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncInfo"); 
    15301366        } 
     
    15331369    /** 
    15341370     * Returns a string out of IncidentTimes based on tag. 
    1535      * 
    1536      * @param tag a CADDataEnums tag 
    1537      * @param incidentId the incident's ID to look up 
    1538      * @throws RemoteException 
    1539      */ 
    1540     public String getCadDataIncTimes(INC_TIMES tag, int incidentId) throws RemoteException 
    1541     { 
     1371     * @param tag a CADDataEnums tag 
     1372     * @param incidentId the incident's ID to look up 
     1373     * @throws RemoteException 
     1374     */ 
     1375    public String getCadDataIncTimes(INC_TIMES tag, int incidentId) throws RemoteException { 
    15421376        // TODO Auto-generated method stub 
    15431377        return null; 
    15441378    } 
    1545  
     1379     
    15461380    /** 
    15471381     * Returns a CardfileList matching the tag. 
    15481382     */ 
    1549     public CardfileList getCardfileList(CARDFILE tag) throws RemoteException 
    1550     { 
    1551         if (tag.equals(CARDFILE.COASTAL_DIVISION_UNITS)) 
    1552         { 
     1383    public CardfileList getCardfileList(CARDFILE tag) throws RemoteException{ 
     1384        if(tag.equals(CARDFILE.COASTAL_DIVISION_UNITS)){ 
    15531385            return cardfileData.getCoastalDivisionUnitList(); 
    1554         } else if (tag.equals(CARDFILE.POLICE_SHERIFF_CORONER)) 
    1555         { 
     1386        } 
     1387        else if(tag.equals(CARDFILE.POLICE_SHERIFF_CORONER)){ 
    15561388            return cardfileData.getPoliceSheriffCoronerList(); 
    1557         } else if (tag.equals(CARDFILE.COURTS)) 
    1558         { 
     1389        } 
     1390        else if(tag.equals(CARDFILE.COURTS)){ 
    15591391            return cardfileData.getCourtsList(); 
    1560         } else if (tag.equals(CARDFILE.PUBLIC_TRANSPORTATION)) 
    1561         { 
     1392        } 
     1393        else if(tag.equals(CARDFILE.PUBLIC_TRANSPORTATION)){ 
    15621394            return cardfileData.getPublicTransportationList(); 
    1563         } else if (tag.equals(CARDFILE.GG_OTHER)) 
    1564         { 
     1395        } 
     1396        else if(tag.equals(CARDFILE.GG_OTHER)){ 
    15651397            return cardfileData.getGgOtherList(); 
    1566         } else if (tag.equals(CARDFILE.MY_MISC)) 
    1567         { 
     1398        } 
     1399        else if(tag.equals(CARDFILE.MY_MISC)){ 
    15681400            return cardfileData.getMyMiscList(); 
    1569         } else if (tag.equals(CARDFILE.SL_MISC)) 
    1570         { 
     1401        } 
     1402        else if(tag.equals(CARDFILE.SL_MISC)){ 
    15711403            return cardfileData.getSlMiscList(); 
    1572         } else if (tag.equals(CARDFILE.VT_MISC)) 
    1573         { 
     1404        } 
     1405        else if(tag.equals(CARDFILE.VT_MISC)){ 
    15741406            return cardfileData.getVlMiscList(); 
    1575         } else if (tag.equals(CARDFILE.CHP_OFFICES)) 
    1576         { 
     1407        } 
     1408        else if(tag.equals(CARDFILE.CHP_OFFICES)){ 
    15771409            return cardfileData.getChpOfficesList(); 
    1578         } else if (tag.equals(CARDFILE.STATE_AGENCIES_FACILITIES)) 
    1579         { 
     1410        } 
     1411        else if(tag.equals(CARDFILE.STATE_AGENCIES_FACILITIES)){ 
    15801412            return cardfileData.getStateAgenciesFacilitiesList(); 
    1581         } else if (tag.equals(CARDFILE.GOVERNMENT_OFFICIALS)) 
    1582         { 
     1413        } 
     1414        else if(tag.equals(CARDFILE.GOVERNMENT_OFFICIALS)){ 
    15831415            return cardfileData.getGovernmentOfficialsList(); 
    1584         } else if (tag.equals(CARDFILE.FEDERAL_AGENCIES)) 
    1585         { 
     1416        } 
     1417        else if(tag.equals(CARDFILE.FEDERAL_AGENCIES)){ 
    15861418            return cardfileData.getFederalAgenciesList(); 
    1587         } else if (tag.equals(CARDFILE.RANCHES_LIVESTOCK)) 
    1588         { 
     1419        } 
     1420        else if(tag.equals(CARDFILE.RANCHES_LIVESTOCK)){ 
    15891421            return cardfileData.getRanchesLivestockList(); 
    1590         } else if (tag.equals(CARDFILE.FIRE_EMS)) 
    1591         { 
     1422        } 
     1423        else if(tag.equals(CARDFILE.FIRE_EMS)){ 
    15921424            return cardfileData.getFireEmsList(); 
    1593         } else if (tag.equals(CARDFILE.JAILS)) 
    1594         { 
     1425        } 
     1426        else if(tag.equals(CARDFILE.JAILS)){ 
    15951427            return cardfileData.getJailsList(); 
    1596         } else if (tag.equals(CARDFILE.HOSPITALS_MED_CENTERS)) 
    1597         { 
     1428        } 
     1429        else if(tag.equals(CARDFILE.HOSPITALS_MED_CENTERS)){ 
    15981430            return cardfileData.getHospitalsMedCentersList(); 
    1599         } else if (tag.equals(CARDFILE.TOW_COMPANIES)) 
    1600         { 
     1431        } 
     1432        else if(tag.equals(CARDFILE.TOW_COMPANIES)){ 
    16011433            return cardfileData.getTowCompaniesList(); 
    1602         } else if (tag.equals(CARDFILE.CALTRANS)) 
    1603         { 
     1434        } 
     1435        else if(tag.equals(CARDFILE.CALTRANS)){ 
    16041436            return cardfileData.getCalTransList(); 
    1605         } else if (tag.equals(CARDFILE.COUNTY_ROADS)) 
    1606         { 
     1437        } 
     1438        else if(tag.equals(CARDFILE.COUNTY_ROADS)){ 
    16071439            return cardfileData.getCountyRoadsList(); 
    1608         } else if (tag.equals(CARDFILE.UTILITIES)) 
    1609         { 
     1440        } 
     1441        else if(tag.equals(CARDFILE.UTILITIES)){ 
    16101442            return cardfileData.getUtilitiesList(); 
    1611         } else if (tag.equals(CARDFILE.ANIMAL_CONTROL)) 
    1612         { 
     1443        } 
     1444        else if(tag.equals(CARDFILE.ANIMAL_CONTROL)){ 
    16131445            return cardfileData.getAnimalControlList(); 
    1614         } else if (tag.equals(CARDFILE.AIRPORTS)) 
    1615         { 
     1446        } 
     1447        else if(tag.equals(CARDFILE.AIRPORTS)){ 
    16161448            return cardfileData.getAirportsList(); 
    1617         } else if (tag.equals(CARDFILE.CREDIT_CARDS)) 
    1618         { 
     1449        } 
     1450        else if(tag.equals(CARDFILE.CREDIT_CARDS)){ 
    16191451            return cardfileData.getCreditCardsList(); 
    1620         } else if (tag.equals(CARDFILE.GG_CRISIS_SHELTERS)) 
    1621         { 
     1452        } 
     1453        else if(tag.equals(CARDFILE.GG_CRISIS_SHELTERS)){ 
    16221454            return cardfileData.getGgCrisisSheltersList(); 
    1623         } else if (tag.equals(CARDFILE.RANGES)) 
    1624         { 
     1455        } 
     1456        else if(tag.equals(CARDFILE.RANGES)){ 
    16251457            return cardfileData.getRangesList(); 
    1626         } else if (tag.equals(CARDFILE.HOTLINES)) 
    1627         { 
     1458        } 
     1459        else if(tag.equals(CARDFILE.HOTLINES)){ 
    16281460            return cardfileData.getHotlinesList(); 
    1629         } else if (tag.equals(CARDFILE.HWY_PATROLS_OOS)) 
    1630         { 
     1461        } 
     1462        else if(tag.equals(CARDFILE.HWY_PATROLS_OOS)){ 
    16311463            return cardfileData.getHwyPatrolsOosList(); 
    1632         } else if (tag.equals(CARDFILE.PARKS_RECREATION)) 
    1633         { 
     1464        } 
     1465        else if(tag.equals(CARDFILE.PARKS_RECREATION)){ 
    16341466            return cardfileData.getParksRecreationList(); 
    1635         } else if (tag.equals(CARDFILE.SHELTERS)) 
    1636         { 
     1467        } 
     1468        else if(tag.equals(CARDFILE.SHELTERS)){ 
    16371469            return cardfileData.getSheltersList(); 
    1638         } else if (tag.equals(CARDFILE.SL_COUNTY_SERVICES)) 
    1639         { 
     1470        } 
     1471        else if(tag.equals(CARDFILE.SL_COUNTY_SERVICES)){ 
    16401472            return cardfileData.getSlCountyServicesList(); 
    1641         } else if (tag.equals(CARDFILE.SL_RESOURCES)) 
    1642         { 
     1473        } 
     1474        else if(tag.equals(CARDFILE.SL_RESOURCES)){ 
    16431475            return cardfileData.getSlResourcesList(); 
    1644         } else if (tag.equals(CARDFILE.TRUCK_TIRE_REPAIR)) 
    1645         { 
     1476        } 
     1477        else if(tag.equals(CARDFILE.TRUCK_TIRE_REPAIR)){ 
    16461478            return cardfileData.getTruckTireRepairList(); 
    1647         } else if (tag.equals(CARDFILE.MCC_EMPLOYEES)) 
    1648         { 
     1479        } 
     1480        else if(tag.equals(CARDFILE.MCC_EMPLOYEES)){ 
    16491481            return cardfileData.getMccEmployeesList(); 
    1650         } else if (tag.equals(CARDFILE.GATE_ACCESS_CODES)) 
    1651         { 
     1482        } 
     1483        else if(tag.equals(CARDFILE.GATE_ACCESS_CODES)){ 
    16521484            return cardfileData.getGateAccessCodesList(); 
    1653         } else if (tag.equals(CARDFILE.VT_CALL_SIGNS)) 
    1654         { 
     1485        } 
     1486        else if(tag.equals(CARDFILE.VT_CALL_SIGNS)){ 
    16551487            return cardfileData.getVtCallSignsList(); 
    1656         } else if (tag.equals(CARDFILE.SLCC_EMPLOYEES)) 
    1657         { 
     1488        } 
     1489        else if(tag.equals(CARDFILE.SLCC_EMPLOYEES)){ 
    16581490            return cardfileData.getSlccEmployeesList(); 
    1659         } else 
    1660         { 
     1491        } 
     1492        else{ 
    16611493            throw new RemoteException("Wrong Enum sent into Coordinator.getCardfileList"); 
    16621494        } 
    16631495    } 
    1664  
    1665     /** 
    1666      * Receives the fields of the ChangeLog in Cardfile.java and uses those 
    1667      * fields to make changes to its own copy of the Cardfiledata. 
    1668      */ 
    1669     public void editCardfile(ChangeLog log) throws RemoteException 
    1670     { 
    1671  
     1496     
     1497    /** 
     1498     * Receives the fields of the ChangeLog in Cardfile.java and uses those fields 
     1499     * to make changes to its own copy of the Cardfiledata. 
     1500     */ 
     1501    public void editCardfile(ChangeLog log) throws RemoteException{ 
     1502         
    16721503        CardfileList selectedList; 
    1673  
    1674         if (log.listTitle.equals(CARDFILE.COASTAL_DIVISION_UNITS.tag)) 
    1675         { 
     1504         
     1505        if(log.listTitle.equals(CARDFILE.COASTAL_DIVISION_UNITS.tag)){ 
    16761506            selectedList = cardfileData.getCoastalDivisionUnitList(); 
    1677         } else if (log.listTitle.equals(CARDFILE.POLICE_SHERIFF_CORONER.tag)) 
    1678         { 
     1507        } 
     1508        else if(log.listTitle.equals(CARDFILE.POLICE_SHERIFF_CORONER.tag)){ 
    16791509            selectedList = cardfileData.getPoliceSheriffCoronerList(); 
    1680         } else if (log.listTitle.equals(CARDFILE.COURTS.tag)) 
    1681         { 
     1510        } 
     1511        else if(log.listTitle.equals(CARDFILE.COURTS.tag)){ 
    16821512            selectedList = cardfileData.getCourtsList(); 
    1683         } else if (log.listTitle.equals(CARDFILE.PUBLIC_TRANSPORTATION.tag)) 
    1684         { 
     1513        } 
     1514        else if(log.listTitle.equals(CARDFILE.PUBLIC_TRANSPORTATION.tag)){ 
    16851515            selectedList = cardfileData.getPublicTransportationList(); 
    1686         } else if (log.listTitle.equals(CARDFILE.GG_OTHER.tag)) 
    1687         { 
     1516        } 
     1517        else if(log.listTitle.equals(CARDFILE.GG_OTHER.tag)){ 
    16881518            selectedList = cardfileData.getGgOtherList(); 
    1689         } else if (log.listTitle.equals(CARDFILE.MY_MISC.tag)) 
    1690         { 
     1519        } 
     1520        else if(log.listTitle.equals(CARDFILE.MY_MISC.tag)){ 
    16911521            selectedList = cardfileData.getMyMiscList(); 
    1692         } else if (log.listTitle.equals(CARDFILE.SL_MISC.tag)) 
    1693         { 
     1522        } 
     1523        else if(log.listTitle.equals(CARDFILE.SL_MISC.tag)){ 
    16941524            selectedList = cardfileData.getSlMiscList(); 
    1695         } else if (log.listTitle.equals(CARDFILE.VT_MISC.tag)) 
    1696         { 
     1525        } 
     1526        else if(log.listTitle.equals(CARDFILE.VT_MISC.tag)){ 
    16971527            selectedList = cardfileData.getVlMiscList(); 
    1698         } else if (log.listTitle.equals(CARDFILE.CHP_OFFICES.tag)) 
    1699         { 
     1528        } 
     1529        else if(log.listTitle.equals(CARDFILE.CHP_OFFICES.tag)){ 
    17001530            selectedList = cardfileData.getChpOfficesList(); 
    1701         } else if (log.listTitle.equals(CARDFILE.STATE_AGENCIES_FACILITIES.tag)) 
    1702         { 
     1531        } 
     1532        else if(log.listTitle.equals(CARDFILE.STATE_AGENCIES_FACILITIES.tag)){ 
    17031533            selectedList = cardfileData.getStateAgenciesFacilitiesList(); 
    1704         } else if (log.listTitle.equals(CARDFILE.GOVERNMENT_OFFICIALS.tag)) 
    1705         { 
     1534        } 
     1535        else if(log.listTitle.equals(CARDFILE.GOVERNMENT_OFFICIALS.tag)){ 
    17061536            selectedList = cardfileData.getGovernmentOfficialsList(); 
    1707         } else if (log.listTitle.equals(CARDFILE.FEDERAL_AGENCIES.tag)) 
    1708         { 
     1537        } 
     1538        else if(log.listTitle.equals(CARDFILE.FEDERAL_AGENCIES.tag)){ 
    17091539            selectedList = cardfileData.getFederalAgenciesList(); 
    1710         } else if (log.listTitle.equals(CARDFILE.RANCHES_LIVESTOCK.tag)) 
    1711         { 
     1540        } 
     1541        else if(log.listTitle.equals(CARDFILE.RANCHES_LIVESTOCK.tag)){ 
    17121542            selectedList = cardfileData.getRanchesLivestockList(); 
    1713         } else if (log.listTitle.equals(CARDFILE.FIRE_EMS.tag)) 
    1714         { 
     1543        } 
     1544        else if(log.listTitle.equals(CARDFILE.FIRE_EMS.tag)){ 
    17151545            selectedList = cardfileData.getFireEmsList(); 
    1716         } else if (log.listTitle.equals(CARDFILE.JAILS.tag)) 
    1717         { 
     1546        } 
     1547        else if(log.listTitle.equals(CARDFILE.JAILS.tag)){ 
    17181548            selectedList = cardfileData.getJailsList(); 
    1719         } else if (log.listTitle.equals(CARDFILE.HOSPITALS_MED_CENTERS.tag)) 
    1720         { 
     1549        } 
     1550        else if(log.listTitle.equals(CARDFILE.HOSPITALS_MED_CENTERS.tag)){ 
    17211551            selectedList = cardfileData.getHospitalsMedCentersList(); 
    1722         } else if (log.listTitle.equals(CARDFILE.TOW_COMPANIES.tag)) 
    1723         { 
     1552        } 
     1553        else if(log.listTitle.equals(CARDFILE.TOW_COMPANIES.tag)){ 
    17241554            selectedList = cardfileData.getTowCompaniesList(); 
    1725         } else if (log.listTitle.equals(CARDFILE.CALTRANS.tag)) 
    1726         { 
     1555        } 
     1556        else if(log.listTitle.equals(CARDFILE.CALTRANS.tag)){ 
    17271557            selectedList = cardfileData.getCalTransList(); 
    1728         } else if (log.listTitle.equals(CARDFILE.COUNTY_ROADS.tag)) 
    1729         { 
     1558        } 
     1559        else if(log.listTitle.equals(CARDFILE.COUNTY_ROADS.tag)){ 
    17301560            selectedList = cardfileData.getCountyRoadsList(); 
    1731         } else if (log.listTitle.equals(CARDFILE.UTILITIES.tag)) 
    1732         { 
     1561        } 
     1562        else if(log.listTitle.equals(CARDFILE.UTILITIES.tag)){ 
    17331563            selectedList = cardfileData.getUtilitiesList(); 
    1734         } else if (log.listTitle.equals(CARDFILE.ANIMAL_CONTROL.tag)) 
    1735         { 
     1564        } 
     1565        else if(log.listTitle.equals(CARDFILE.ANIMAL_CONTROL.tag)){ 
    17361566            selectedList = cardfileData.getAnimalControlList(); 
    1737         } else if (log.listTitle.equals(CARDFILE.AIRPORTS.tag)) 
    1738         { 
     1567        } 
     1568        else if(log.listTitle.equals(CARDFILE.AIRPORTS.tag)){ 
    17391569            selectedList = cardfileData.getAirportsList(); 
    1740         } else if (log.listTitle.equals(CARDFILE.CREDIT_CARDS.tag)) 
    1741         { 
     1570        } 
     1571        else if(log.listTitle.equals(CARDFILE.CREDIT_CARDS.tag)){ 
    17421572            selectedList = cardfileData.getCreditCardsList(); 
    1743         } else if (log.listTitle.equals(CARDFILE.GG_CRISIS_SHELTERS.tag)) 
    1744         { 
     1573        } 
     1574        else if(log.listTitle.equals(CARDFILE.GG_CRISIS_SHELTERS.tag)){ 
    17451575            selectedList = cardfileData.getGgCrisisSheltersList(); 
    1746         } else if (log.listTitle.equals(CARDFILE.RANGES.tag)) 
    1747         { 
     1576        } 
     1577        else if(log.listTitle.equals(CARDFILE.RANGES.tag)){ 
    17481578            selectedList = cardfileData.getRangesList(); 
    1749         } else if (log.listTitle.equals(CARDFILE.HOTLINES.tag)) 
    1750         { 
     1579        } 
     1580        else if(log.listTitle.equals(CARDFILE.HOTLINES.tag)){ 
    17511581            selectedList = cardfileData.getHotlinesList(); 
    1752         } else if (log.listTitle.equals(CARDFILE.HWY_PATROLS_OOS.tag)) 
    1753         { 
     1582        } 
     1583        else if(log.listTitle.equals(CARDFILE.HWY_PATROLS_OOS.tag)){ 
    17541584            selectedList = cardfileData.getHwyPatrolsOosList(); 
    1755         } else if (log.listTitle.equals(CARDFILE.PARKS_RECREATION.tag)) 
    1756         { 
     1585        } 
     1586        else if(log.listTitle.equals(CARDFILE.PARKS_RECREATION.tag)){ 
    17571587            selectedList = cardfileData.getParksRecreationList(); 
    1758         } else if (log.listTitle.equals(CARDFILE.SHELTERS.tag)) 
    1759         { 
     1588        } 
     1589        else if(log.listTitle.equals(CARDFILE.SHELTERS.tag)){ 
    17601590            selectedList = cardfileData.getSheltersList(); 
    1761         } else if (log.listTitle.equals(CARDFILE.SL_COUNTY_SERVICES.tag)) 
    1762         { 
     1591        } 
     1592        else if(log.listTitle.equals(CARDFILE.SL_COUNTY_SERVICES.tag)){ 
    17631593            selectedList = cardfileData.getSlCountyServicesList(); 
    1764         } else if (log.listTitle.equals(CARDFILE.SL_RESOURCES.tag)) 
    1765         { 
     1594        } 
     1595        else if(log.listTitle.equals(CARDFILE.SL_RESOURCES.tag)){ 
    17661596            selectedList = cardfileData.getSlResourcesList(); 
    1767         } else if (log.listTitle.equals(CARDFILE.TRUCK_TIRE_REPAIR.tag)) 
    1768         { 
     1597        } 
     1598        else if(log.listTitle.equals(CARDFILE.TRUCK_TIRE_REPAIR.tag)){ 
    17691599            selectedList = cardfileData.getTruckTireRepairList(); 
    1770         } else if (log.listTitle.equals(CARDFILE.MCC_EMPLOYEES.tag)) 
    1771         { 
     1600        } 
     1601        else if(log.listTitle.equals(CARDFILE.MCC_EMPLOYEES.tag)){ 
    17721602            selectedList = cardfileData.getMccEmployeesList(); 
    1773         } else if (log.listTitle.equals(CARDFILE.GATE_ACCESS_CODES.tag)) 
    1774         { 
     1603        } 
     1604        else if(log.listTitle.equals(CARDFILE.GATE_ACCESS_CODES.tag)){ 
    17751605            selectedList = cardfileData.getGateAccessCodesList(); 
    1776         } else if (log.listTitle.equals(CARDFILE.VT_CALL_SIGNS.tag)) 
    1777         { 
     1606        } 
     1607        else if(log.listTitle.equals(CARDFILE.VT_CALL_SIGNS.tag)){ 
    17781608            selectedList = cardfileData.getVtCallSignsList(); 
    1779         } else if (log.listTitle.equals(CARDFILE.SLCC_EMPLOYEES.tag)) 
    1780         { 
     1609        } 
     1610        else if(log.listTitle.equals(CARDFILE.SLCC_EMPLOYEES.tag)){ 
    17811611            selectedList = cardfileData.getSlccEmployeesList(); 
    1782         } else 
    1783         { 
     1612        } 
     1613        else{ 
    17841614            throw new RemoteException("Wrong Enum sent into Coordinator.editCardfileDataObject"); 
    17851615        } 
    1786  
     1616         
    17871617        CardfileDataObject cfdo = cardfileData.getCardfileDataObject(selectedList, log.id); 
    1788         if (cfdo != null && log.command.equals(EditCommand.NAME)) 
    1789         { 
     1618        if(cfdo != null && log.command.equals(EditCommand.NAME)){ 
    17901619            cfdo.setName(log.newValue); 
    1791             selectedList.resort(cardfileData.getCardfileDataIndex(selectedList, log.id)); 
    1792         } else if (cfdo != null && log.command.equals(EditCommand.ADDRESS)) 
    1793         { 
     1620            selectedList.resort(cardfileData.getCardfileDataIndex(selectedList,log.id)); 
     1621        } 
     1622        else if(cfdo != null && log.command.equals(EditCommand.ADDRESS)){ 
    17941623            cfdo.setAddress(log.newValue); 
    1795         } else if (cfdo != null && log.command.equals(EditCommand.CITY)) 
    1796         { 
     1624        } 
     1625        else if(cfdo != null && log.command.equals(EditCommand.CITY)){ 
    17971626            cfdo.setCity(log.newValue); 
    1798         } else if (cfdo != null && log.command.equals(EditCommand.STATE)) 
    1799         { 
     1627        } 
     1628        else if(cfdo != null && log.command.equals(EditCommand.STATE)){ 
    18001629            cfdo.setState(log.newValue); 
    1801         } else if (cfdo != null && log.command.equals(EditCommand.ZIP)) 
    1802         { 
     1630        } 
     1631        else if(cfdo != null && log.command.equals(EditCommand.ZIP)){ 
    18031632            cfdo.setZip(log.newValue); 
    1804         } else if (cfdo != null && log.command.equals(EditCommand.PHONE1)) 
    1805         { 
     1633        } 
     1634        else if(cfdo != null && log.command.equals(EditCommand.PHONE1)){ 
    18061635            cfdo.setPhone1(log.newValue); 
    1807         } else if (cfdo != null && log.command.equals(EditCommand.PHONE2)) 
    1808         { 
     1636        } 
     1637        else if(cfdo != null && log.command.equals(EditCommand.PHONE2)){ 
    18091638            cfdo.setPhone2(log.newValue); 
    1810         } else if (cfdo != null && log.command.equals(EditCommand.FAX)) 
    1811         { 
     1639        } 
     1640        else if(cfdo != null && log.command.equals(EditCommand.FAX)){ 
    18121641            cfdo.setFax(log.newValue); 
    1813         } else if (log.command.equals(EditCommand.OBJECT_DELETE)) 
    1814         { 
    1815             selectedList.removeDataObject(cardfileData.getCardfileDataIndex(selectedList, log.id)); 
    1816         } else if (log.command.equals(EditCommand.OBJECT_ADD)) 
    1817         { 
     1642        } 
     1643        else if(log.command.equals(EditCommand.OBJECT_DELETE)){ 
     1644            selectedList.removeDataObject(cardfileData.getCardfileDataIndex(selectedList,log.id)); 
     1645        } 
     1646        else if(log.command.equals(EditCommand.OBJECT_ADD)){ 
    18181647            selectedList.addDataObject(log.newCardfileObject); 
    1819         } else if (log.command.equals(EditCommand.TABLE_ADD)) 
    1820         { 
    1821             if (cfdo != null) 
    1822             { 
    1823                 cfdo.addComment(log.tableFields); 
     1648        } 
     1649        else if(log.command.equals(EditCommand.TABLE_ADD)){ 
     1650            if(cfdo != null){ 
     1651               cfdo.addComment(log.tableFields); 
    18241652            } 
    1825         } else if (log.command.equals(EditCommand.TABLE_DELETE)) 
    1826         { 
    1827             if (cfdo != null) 
    1828             { 
     1653        } 
     1654        else if(log.command.equals(EditCommand.TABLE_DELETE)){ 
     1655            if(cfdo != null){ 
    18291656                cfdo.removeComment(log.timeStamp); 
    18301657            } 
    1831         } else 
    1832         { 
    1833         } 
    1834  
    1835  
    1836     } 
    1837  
     1658        } 
     1659        else{ 
     1660             
     1661        } 
     1662         
     1663         
     1664    } 
     1665     
    18381666    /** 
    18391667     * Obtain a new unique ID for a cardfileDataObject. 
    18401668     */ 
    1841     public int obtainNewUniqueId() throws RemoteException 
    1842     { 
     1669    public int obtainNewUniqueId() throws RemoteException{ 
    18431670        return cardfileData.obtainNewUniqueId(); 
    18441671    } 
    1845  
     1672     
    18461673    /** 
    18471674     * Returns a value from Unit based on tag. 
    1848      * 
    18491675     * @param unitNum the unitNum to look up 
    1850      * @throws RemoteException 
    1851      */ 
    1852     public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException 
    1853     { 
     1676     * @throws RemoteException  
     1677     */ 
     1678    public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException{ 
    18541679        return cadData.getUnit(unitNum).getUnitStatus(); 
    18551680    } 
    1856  
     1681     
    18571682    /** 
    18581683     * Returns a string field from Unit based on tag. 
    1859      * 
    18601684     * @param tag a CADScriptTags tag 
    18611685     * @param unitNum the unitNum to look up 
     
    18631687     * @throws RemoteException 
    18641688     */ 
    1865     public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException 
    1866     { 
    1867         if (tag.equals(UNIT_TAGS.MASTER_INC_NUM)) 
    1868         { 
     1689    public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException{ 
     1690        if(tag.equals(UNIT_TAGS.MASTER_INC_NUM)){ 
    18691691            return cadData.getUnit(unitNum).getMasterInc(); 
    1870         } else if (tag.equals(UNIT_TAGS.STATUS)) 
    1871         { 
     1692        } 
     1693        else if(tag.equals(UNIT_TAGS.STATUS)){ 
    18721694            return cadData.getUnit(unitNum).getStatus(); 
    1873         } else if (tag.equals(UNIT_TAGS.OOS)) 
    1874         { 
     1695        } 
     1696        else if(tag.equals(UNIT_TAGS.OOS)){ 
    18751697            return cadData.getUnit(unitNum).getOos(); 
    1876         } else if (tag.equals(UNIT_TAGS.TYPE)) 
    1877         { 
     1698        } 
     1699        else if(tag.equals(UNIT_TAGS.TYPE)){ 
    18781700            return cadData.getUnit(unitNum).getType(); 
    1879         } else if (tag.equals(UNIT_TAGS.CURR_LOC)) 
    1880         { 
     1701        } 
     1702        else if(tag.equals(UNIT_TAGS.CURR_LOC)){ 
    18811703            return cadData.getUnit(unitNum).getCurrentLocation(); 
    1882         } else if (tag.equals(UNIT_TAGS.DESTINATION)) 
    1883         { 
     1704        } 
     1705        else if(tag.equals(UNIT_TAGS.DESTINATION)){ 
    18841706            return cadData.getUnit(unitNum).getDestination(); 
    1885         } else if (tag.equals(UNIT_TAGS.MISC_INFO)) 
    1886         { 
     1707        } 
     1708        else if(tag.equals(UNIT_TAGS.MISC_INFO)){ 
    18871709            return cadData.getUnit(unitNum).getMisc(); 
    1888         } else if (tag.equals(UNIT_TAGS.STACK)) 
    1889         { 
     1710        } 
     1711        else if(tag.equals(UNIT_TAGS.STACK)){ 
    18901712            return cadData.getUnit(unitNum).getStack(); 
    1891         } else if (tag.equals(UNIT_TAGS.AREA)) 
    1892         { 
     1713        } 
     1714        else if(tag.equals(UNIT_TAGS.AREA)){ 
    18931715            return cadData.getUnit(unitNum).getArea(); 
    1894         } else if (tag.equals(UNIT_TAGS.OFFICER)) 
    1895         { 
     1716        } 
     1717        else if(tag.equals(UNIT_TAGS.OFFICER)){ 
    18961718            return cadData.getUnit(unitNum).getOfficer(); 
    1897         } else if (tag.equals(UNIT_TAGS.BADGE_NUM)) 
    1898         { 
     1719        } 
     1720        else if(tag.equals(UNIT_TAGS.BADGE_NUM)){ 
    18991721            return cadData.getUnit(unitNum).getBadge(); 
    1900         } else if (tag.equals(UNIT_TAGS.TIMER)) 
    1901         { 
     1722        } 
     1723        else if(tag.equals(UNIT_TAGS.TIMER)){ 
    19021724            return cadData.getUnit(unitNum).getTimerInString(); 
    1903         } else if (tag.equals(UNIT_TAGS.OFFICE)) 
    1904         { 
     1725        } 
     1726        else if(tag.equals(UNIT_TAGS.OFFICE)){ 
    19051727            return cadData.getUnit(unitNum).getOffice(); 
    1906         } else if (tag.equals(UNIT_TAGS.P)) 
    1907         { 
     1728        } 
     1729        else if(tag.equals(UNIT_TAGS.P)){ 
    19081730            return cadData.getUnit(unitNum).getP(); 
    1909         } else if (tag.equals(UNIT_TAGS.AGY)) 
    1910         { 
     1731        } 
     1732        else if(tag.equals(UNIT_TAGS.AGY)){ 
    19111733            return cadData.getUnit(unitNum).getAgy(); 
    1912         } else if (tag.equals(UNIT_TAGS.ALIAS)) 
    1913         { 
     1734        } 
     1735        else if(tag.equals(UNIT_TAGS.ALIAS)){ 
    19141736            return cadData.getUnit(unitNum).getAlias(); 
    1915         } else 
    1916         { 
     1737        } 
     1738        else{ 
    19171739            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataUnitValue"); 
    19181740        } 
     
    19211743    /** 
    19221744     * Sets a field from Unit based on tag. 
    1923      * 
    19241745     * @param tag a CADScriptTags tag 
    19251746     * @param unitNum the unitNum to look up 
     
    19271748     * @throws RemoteException 
    19281749     */ 
    1929     public void setCadDataUnitValue(String unitNum, UNIT_TAGS tag, Object value) throws RemoteException 
    1930     { 
    1931         if (tag.equals(UNIT_TAGS.MASTER_INC_NUM)) 
    1932         { 
    1933             cadData.getUnit(unitNum).setMasterInc((String) value); 
    1934         } else if (tag.equals(UNIT_TAGS.STATUS)) 
    1935         { 
    1936             cadData.getUnit(unitNum).setStatus((String) value); 
    1937         } else if (tag.equals(UNIT_TAGS.OOS)) 
    1938         { 
    1939             cadData.getUnit(unitNum).setOos((String) value); 
    1940         } else if (tag.equals(UNIT_TAGS.TYPE)) 
    1941         { 
    1942             cadData.getUnit(unitNum).setType((String) value); 
    1943         } else if (tag.equals(UNIT_TAGS.CURR_LOC)) 
    1944         { 
    1945             cadData.getUnit(unitNum).setCurrentLocation((String) value); 
    1946         } else if (tag.equals(UNIT_TAGS.DESTINATION)) 
    1947         { 
    1948             cadData.getUnit(unitNum).setDestination((String) value); 
    1949         } else if (tag.equals(UNIT_TAGS.MISC_INFO)) 
    1950         { 
    1951             cadData.getUnit(unitNum).setMisc((String) value); 
    1952         } else if (tag.equals(UNIT_TAGS.STACK)) 
    1953         { 
    1954             cadData.getUnit(unitNum).setStack((String) value); 
    1955         } else if (tag.equals(UNIT_TAGS.AREA)) 
    1956         { 
    1957             cadData.getUnit(unitNum).setArea((String) value); 
    1958         } else if (tag.equals(UNIT_TAGS.OFFICER)) 
    1959         { 
    1960             cadData.getUnit(unitNum).setOfficer((String) value); 
    1961         } else if (tag.equals(UNIT_TAGS.BADGE_NUM)) 
    1962         { 
    1963             cadData.getUnit(unitNum).setBadge((String) value); 
    1964         } else if (tag.equals(UNIT_TAGS.UNIT_STATUS)) 
    1965         { 
    1966             cadData.getUnit(unitNum).setUnitStatus((UnitStatusEnums) value); 
    1967         } else if (tag.equals(UNIT_TAGS.OFFICE)) 
    1968         { 
    1969             cadData.getUnit(unitNum).setOffice((String) value); 
    1970         } else if (tag.equals(UNIT_TAGS.P)) 
    1971         { 
    1972             cadData.getUnit(unitNum).setP((String) value); 
    1973         } else if (tag.equals(UNIT_TAGS.AGY)) 
    1974         { 
    1975             cadData.getUnit(unitNum).setAgy((String) value); 
    1976         } else if (tag.equals(UNIT_TAGS.ALIAS)) 
    1977         { 
    1978             cadData.getUnit(unitNum).setAlias((String) value); 
    1979         } else 
    1980         { 
     1750    public void setCadDataUnitValue(String unitNum, UNIT_TAGS tag, Object value) throws RemoteException{ 
     1751        if(tag.equals(UNIT_TAGS.MASTER_INC_NUM)){ 
     1752            cadData.getUnit(unitNum).setMasterInc((String)value); 
     1753        } 
     1754        else if(tag.equals(UNIT_TAGS.STATUS)){ 
     1755            cadData.getUnit(unitNum).setStatus((String)value); 
     1756        } 
     1757        else if(tag.equals(UNIT_TAGS.OOS)){ 
     1758            cadData.getUnit(unitNum).setOos((String)value); 
     1759        } 
     1760        else if(tag.equals(UNIT_TAGS.TYPE)){ 
     1761            cadData.getUnit(unitNum).setType((String)value); 
     1762        } 
     1763        else if(tag.equals(UNIT_TAGS.CURR_LOC)){ 
     1764            cadData.getUnit(unitNum).setCurrentLocation((String)value); 
     1765        } 
     1766        else if(tag.equals(UNIT_TAGS.DESTINATION)){ 
     1767            cadData.getUnit(unitNum).setDestination((String)value); 
     1768        } 
     1769        else if(tag.equals(UNIT_TAGS.MISC_INFO)){ 
     1770            cadData.getUnit(unitNum).setMisc((String)value); 
     1771        } 
     1772        else if(tag.equals(UNIT_TAGS.STACK)){ 
     1773            cadData.getUnit(unitNum).setStack((String)value); 
     1774        } 
     1775        else if(tag.equals(UNIT_TAGS.AREA)){ 
     1776            cadData.getUnit(unitNum).setArea((String)value); 
     1777        } 
     1778        else if(tag.equals(UNIT_TAGS.OFFICER)){ 
     1779            cadData.getUnit(unitNum).setOfficer((String)value); 
     1780        } 
     1781        else if(tag.equals(UNIT_TAGS.BADGE_NUM)){ 
     1782            cadData.getUnit(unitNum).setBadge((String)value); 
     1783        } 
     1784        else if(tag.equals(UNIT_TAGS.UNIT_STATUS)){ 
     1785            cadData.getUnit(unitNum).setUnitStatus((UnitStatusEnums)value); 
     1786        } 
     1787        else if(tag.equals(UNIT_TAGS.OFFICE)){ 
     1788            cadData.getUnit(unitNum).setOffice((String)value); 
     1789        } 
     1790        else if(tag.equals(UNIT_TAGS.P)){ 
     1791            cadData.getUnit(unitNum).setP((String)value); 
     1792        } 
     1793        else if(tag.equals(UNIT_TAGS.AGY)){ 
     1794            cadData.getUnit(unitNum).setAgy((String)value); 
     1795        } 
     1796        else if(tag.equals(UNIT_TAGS.ALIAS)){ 
     1797            cadData.getUnit(unitNum).setAlias((String)value); 
     1798        } 
     1799        else{ 
    19811800            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataUnitValue"); 
    19821801        } 
    19831802    } 
    1984  
     1803     
    19851804    /** 
    19861805     * Assigns a unit to the specified incident. 
    1987      * 
    19881806     * @param unitNum the unitNum to look up 
    19891807     * @param id the incident id that this unit is assigned to. 
    19901808     * @throws RemoteException 
    19911809     */ 
    1992     public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException 
    1993     { 
     1810    public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException{ 
    19941811        cadData.getUnit(unitNum).setAssignedIncidentId(id); 
    19951812    } 
    1996  
     1813     
    19971814    /** 
    19981815     * Adds a unit to the incident's list of assigned units. 
    1999      * 
    20001816     * @param incidentId the incident 
    20011817     * @param assignedUnitNum the unit that's been assigned to the incident 
    20021818     * @throws RemoteException 
    20031819     */ 
    2004     public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException 
    2005     { 
     1820    public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException{ 
    20061821        cadData.getIncident(incidentId).addAssignedUnitNum(assignedUnitNum); 
    20071822    } 
    2008  
     1823     
    20091824    /** 
    20101825     * Sets the specified incident to the specified status. 
    2011      * 
    20121826     * @param incidentId the incident 
    20131827     * @param status the status of the incident 
    20141828     * @throws RemoteException 
    20151829     */ 
    2016     public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException 
    2017     { 
     1830    public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException{ 
    20181831        cadData.getIncident(incidentId).setIncidentStatus(status); 
    20191832    } 
    2020  
    2021     /** 
     1833     
     1834    /**  
    20221835     * Returns a LinkedList containing entries that match the search string. 
    2023      * 
    20241836     * @param search the string entry to be searched 
    20251837     * @return linked list of CardfileDataObjects matching search 
    20261838     */ 
    2027     public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException 
    2028     { 
     1839    public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException{ 
    20291840        return cardfileData.getSearchList(search); 
    20301841    } 
    2031  
    2032     /** 
    2033      * Updates the server database so clients can view additional informations 
    2034      * as events complete 
    2035      * 
     1842     
     1843    /**  
     1844     * Updates the server database so clients can view additional informations as events complete 
    20361845     * @param incidentNumber the incident in which the event occurred 
    2037      * @return completedEvent IncidentEvent with information to be added to 
    2038      * server database 
    2039      */ 
    2040     public void updateIncidentInGUI(Integer incidentNumber, IncidentEvent completedEvent) 
    2041     { 
     1846     * @return completedEvent IncidentEvent with information to be added to server database 
     1847     */ 
     1848    public void updateIncidentInGUI(Integer incidentNumber, IncidentEvent completedEvent) { 
    20421849        updateDetailsInGUI(incidentNumber, completedEvent); 
    20431850        updateUnitsInGUI(incidentNumber, completedEvent); 
    20441851    } 
    2045  
    2046     /** 
    2047      * Updates the server database so clients can view details as events 
    2048      * complete 
    2049      * 
     1852     
     1853    /**  
     1854     * Updates the server database so clients can view details as events complete 
    20501855     * @param incidentNumber the incident in which the event occurred 
    2051      * @return completedEvent IncidentEvent with details to be added to server 
    2052      * database 
    2053      */ 
    2054     public void updateDetailsInGUI(Integer incidentNumber, IncidentEvent completedEvent) 
    2055     { 
     1856     * @return completedEvent IncidentEvent with details to be added to server database 
     1857     */ 
     1858    public void updateDetailsInGUI(Integer incidentNumber, IncidentEvent completedEvent) { 
    20561859        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
    20571860        DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
    2058         for (int i = 0; i < completedEvent.eventInfo.getDetails().size(); i++) 
    2059         { 
    2060             String[] fields = 
    2061             { 
    2062                 dateFormat.format(new Date()), 
    2063                 timeFormat.format(new Date()), 
    2064                 "", "", completedEvent.eventInfo.getDetails().elementAt(i).details 
    2065             }; 
    2066  
    2067             try 
    2068             { 
     1861        for(int i = 0; i < completedEvent.eventInfo.getDetails().size(); i++){ 
     1862            String[] fields = {dateFormat.format(new Date()), 
     1863                       timeFormat.format(new Date()), 
     1864                       "","",completedEvent.eventInfo.getDetails().elementAt(i).details}; 
     1865     
     1866            try{ 
    20691867                addCadDataIncidentTable(INC_TABLE.COMMENTS_NOTES, incidentNumber, fields); 
    2070             } catch (RemoteException e) 
    2071             { 
     1868            }catch(RemoteException e){ 
    20721869                e.printStackTrace(); 
    2073             } 
    2074         } 
    2075     } 
    2076  
    2077     /** 
    2078      * Updates the server database so clients can view unit updates as events 
    2079      * complete 
    2080      * 
     1870            }    
     1871        } 
     1872    } 
     1873     
     1874    /**  
     1875     * Updates the server database so clients can view unit updates as events complete 
    20811876     * @param incidentNumber the incident in which the event occurred 
    2082      * @return completedEvent IncidentEvent with unit updates to be added to 
    2083      * server database 
    2084      */ 
    2085     public void updateUnitsInGUI(Integer incidentNumber, IncidentEvent completedEvent) 
    2086     { 
    2087         for (int i = 0; i < completedEvent.eventInfo.getUnits().size(); i++) 
    2088         { 
     1877     * @return completedEvent IncidentEvent with unit updates to be added to server database 
     1878     */ 
     1879    public void updateUnitsInGUI(Integer incidentNumber, IncidentEvent completedEvent) { 
     1880        for(int i = 0; i < completedEvent.eventInfo.getUnits().size(); i++){ 
    20891881            IncidentInquiryUnitsAssigned unit = completedEvent.eventInfo.getUnits().get(i); 
    2090             if (unit.statusType.equals("ENRT")) 
    2091             { 
     1882            if(unit.statusType.equals("ENRT")){ 
    20921883                cadData.unitAssignedToIncident(unit.beat, incidentNumber, unit.isPrimary); 
    2093             } else if (unit.statusType.equals("1097")) 
    2094             { 
     1884            }else if(unit.statusType.equals("1097")){ 
    20951885                cadData.unitArrivedAtIncidentScene(unit.beat, incidentNumber, unit.isPrimary); 
    2096             } else if (unit.statusType.equals("1098")) 
    2097             { 
     1886            }else if(unit.statusType.equals("1098")){ 
    20981887                cadData.unitAvailable(unit.beat); 
    20991888            } 
    21001889        } 
    21011890    } 
    2102  
     1891     
    21031892    /** 
    21041893     * Sets the specified incidentNumber to viewable in the GUI. 
    2105      * 
    21061894     * @param incidentNumber the number of the Incident started 
    21071895     */ 
    2108     public void incidentStartedInGUI(Integer incidentNumber) 
    2109     { 
     1896    public void incidentStartedInGUI(Integer incidentNumber){ 
    21101897        Date date = new Date(); 
    21111898        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); 
  • /trunk/src/tmcsim/cadsimulator/viewer/CADSimulatorViewer.java

    r24 r8  
    33import java.awt.AWTEvent; 
    44import java.awt.Dimension; 
    5 import java.awt.event.ActionEvent; 
    6 import java.awt.event.KeyEvent; 
    75import java.awt.event.WindowEvent; 
     6 
    87import javax.swing.JFrame; 
    98import javax.swing.JMenu; 
     
    1211import javax.swing.JOptionPane; 
    1312import javax.swing.JTabbedPane; 
    14 import javax.swing.KeyStroke; 
     13 
    1514import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate; 
    1615import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate; 
     
    2120 
    2221/** 
    23  * This class provides a GUI to view current status information for the CAD 
    24  * Simulator. 
     22 * This class provides a GUI to view current status information for the 
     23 * CAD Simulator. 
    2524 * 
    2625 * @see SimulationStatusPanel 
    2726 * @see MediaStatusPanel 
    28  * @author Matthew Cechini 
     27 * @author Matthew Cechini  
    2928 * @version $Revision: 1.3 $ $Date: 2006/06/06 20:46:41 $ 
    3029 */ 
    3130@SuppressWarnings("serial") 
    32 public class CADSimulatorViewer extends JFrame 
    33 { 
     31public class CADSimulatorViewer extends JFrame { 
    3432 
    35     /** 
    36      * Panel to display simulation information. 
    37      */ 
     33    /** Panel to display simulation information. */ 
    3834    private SimulationStatusPanel simulationPanel; 
    39     /** 
    40      * Panel to display media control information. 
    41      */ 
     35     
     36    /** Panel to display media control information. */ 
    4237    private MediaStatusPanel mediaPanel; 
    43  
    44     /** 
    45      * Constructor. 
    46      */ 
    47     public CADSimulatorViewer() 
    48     { 
     38     
     39    /** Constructor. */ 
     40    public CADSimulatorViewer() { 
    4941        super("CAD Simulator"); 
    50  
     42         
    5143        initComponents(); 
    52     } 
    53  
    54     /** 
     44    }     
     45     
     46    /**  
    5547     * @see SimulationStatusPanel 
    5648     */ 
    57     public void connectClient() 
    58     { 
     49    public void connectClient() { 
    5950        simulationPanel.connectClient(); 
    6051    } 
    61  
    62     /** 
     52     
     53    /**  
    6354     * @see SimulationStatusPanel 
    6455     */ 
    65     public void disconnectClient() 
    66     { 
     56    public void disconnectClient() { 
    6757        simulationPanel.disconnectClient(); 
    6858    } 
    69  
    70     /** 
     59     
     60    /**  
    7161     * @see SimulationStatusPanel 
    7262     */ 
    73     public void setSimManagerStatus(boolean connection) 
    74     { 
    75         simulationPanel.setSimManagerStatus(connection); 
     63    public void setSimManagerStatus(boolean connection) { 
     64        simulationPanel.setSimManagerStatus(connection);         
    7665    } 
    77  
    78     /** 
     66     
     67    /**  
    7968     * @see SimulationStatusPanel 
    8069     */ 
    81     public void setTime(long seconds) 
    82     { 
     70    public void setTime(long seconds) { 
    8371        simulationPanel.setTime(seconds); 
    8472    } 
    8573 
    86     /** 
     74    /**  
    8775     * @see SimulationStatusPanel 
    8876     */ 
    89     public void setScriptStatus(SCRIPT_STATUS newStatus) 
    90     { 
    91         simulationPanel.setScriptStatus(newStatus); 
     77    public void setScriptStatus(SCRIPT_STATUS newStatus) { 
     78        simulationPanel.setScriptStatus(newStatus);          
     79    } 
     80     
     81    /**  
     82     * @see SimulationStatusPanel 
     83     */ 
     84    public void setParamicsStatus(PARAMICS_STATUS newStatus) { 
     85        simulationPanel.setParamicsStatus(newStatus);        
     86    } 
     87     
     88    /**  
     89     * @see SimulationStatusPanel 
     90     */ 
     91    public void setParamicsNetworkLoaded(String networkID) { 
     92        simulationPanel.setParamicsNetworkLoaded(networkID);         
    9293    } 
    9394 
    94     /** 
    95      * @see SimulationStatusPanel 
    96      */ 
    97     public void setParamicsStatus(PARAMICS_STATUS newStatus) 
    98     { 
    99         simulationPanel.setParamicsStatus(newStatus); 
    100     } 
    101  
    102     /** 
    103      * @see SimulationStatusPanel 
    104      */ 
    105     public void setParamicsNetworkLoaded(String networkID) 
    106     { 
    107         simulationPanel.setParamicsNetworkLoaded(networkID); 
    108     } 
    109  
    110     /** 
     95    /**  
    11196     * @see MediaStatusPanel 
    11297     */ 
    113     public void updateDVDStatus(DVDStatusUpdate update) 
    114     { 
     98    public void updateDVDStatus(DVDStatusUpdate update) { 
    11599        mediaPanel.updateDVDStatus(update); 
    116100    } 
    117101 
    118     /** 
     102    /**  
    119103     * @see MediaStatusPanel 
    120104     */ 
    121     public void updateDVDTitle(DVDTitleUpdate update) 
    122     { 
     105    public void updateDVDTitle(DVDTitleUpdate update) { 
    123106        mediaPanel.updateDVDTitle(update); 
    124107    } 
    125  
     108     
    126109    /** 
    127      * Method calls the processEvent() method with a WINDOW_CLOSING WindowEvent 
    128      * to start the application closing process. 
     110     * Method calls the processEvent() method with a WINDOW_CLOSING 
     111     * WindowEvent to start the application closing process. 
    129112     */ 
    130     public void closeViewer() 
    131     { 
     113    public void closeViewer() { 
    132114        processEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); 
    133115    } 
    134116 
    135117    /** 
    136      * Overloads the processEvent method. If the AWTEvent is a WINDOW_CLOSING 
    137      * event, prompt the user to confirm the action. If confirmed, close the 
    138      * application. 
     118     * Overloads the processEvent method.  If the AWTEvent is a  
     119     * WINDOW_CLOSING event, prompt the user to confirm the action. 
     120     * If confirmed, close the application. 
    139121     */ 
    140     protected void processEvent(AWTEvent evt) 
    141     { 
    142  
    143         if (evt.getID() == WindowEvent.WINDOW_CLOSING) 
    144         { 
     122    protected void processEvent(AWTEvent evt) { 
     123         
     124        if(evt.getID() == WindowEvent.WINDOW_CLOSING) { 
    145125            int option = JOptionPane.showConfirmDialog(null, 
    146                     "Closing the CAD Simulator will stop the current " 
    147                     + "simulation.  Do you wish to continue exiting?", 
     126                    "Closing the CAD Simulator will stop the current " + 
     127                    "simulation.  Do you wish to continue exiting?", 
    148128                    "Confirm Exit", 
    149129                    JOptionPane.YES_NO_OPTION); 
     130             
     131            if(option != JOptionPane.NO_OPTION) { 
     132                System.exit(0); 
     133            }        
     134        } 
     135     } 
     136     
     137    /** Initialize GUI Components */ 
     138    private void initComponents() { 
    150139 
    151             if (option != JOptionPane.NO_OPTION) 
    152             { 
    153                 System.exit(0); 
    154             } 
    155         } 
    156     } 
    157  
    158     /** 
    159      * Initialize GUI Components 
    160      */ 
    161     private void initComponents() 
    162     { 
    163  
    164  
     140         
    165141        simulationPanel = new SimulationStatusPanel(); 
    166         mediaPanel = new MediaStatusPanel(); 
    167  
     142        mediaPanel      = new MediaStatusPanel(); 
     143         
    168144        cadSimTabbedPane = new JTabbedPane(); 
    169145        cadSimTabbedPane.addTab("Status", simulationPanel); 
    170146        cadSimTabbedPane.addTab("Media", mediaPanel); 
    171  
    172         add(cadSimTabbedPane); 
     147         
     148        add(cadSimTabbedPane);       
    173149 
    174150        menubar = new JMenuBar(); 
    175  
     151         
    176152        fileMenu = new JMenu("File"); 
    177         fileMenu.setMnemonic(KeyEvent.VK_F); 
    178153        menubar.add(fileMenu); 
    179  
     154         
    180155        exitMenuItem = new JMenuItem(new ExitAction(this)); 
    181         exitMenuItem.setAccelerator(KeyStroke.getKeyStroke( 
    182                 KeyEvent.VK_X, ActionEvent.ALT_MASK)); 
    183156        fileMenu.add(exitMenuItem); 
    184  
     157         
    185158        javax.swing.JMenu helpMenu = new javax.swing.JMenu("Help"); 
    186159        javax.swing.JMenuItem aboutItem = new javax.swing.JMenuItem("About"); 
     
    196169        helpMenu.add(aboutItem); 
    197170        menubar.add(helpMenu); 
    198  
     171         
    199172        setJMenuBar(menubar); 
    200  
    201         setPreferredSize(new Dimension(500, 575)); 
     173         
     174        setPreferredSize(new Dimension(500, 575));   
    202175        pack(); 
    203176        setResizable(false); 
    204177    } 
     178     
     179     
    205180    private JTabbedPane cadSimTabbedPane; 
     181     
    206182    private JMenuBar menubar; 
     183     
    207184    private JMenu fileMenu; 
     185     
    208186    private JMenuItem exitMenuItem; 
     187     
    209188} 
  • /trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java

    r24 r2  
    22 
    33import java.awt.event.ActionEvent; 
     4 
    45import javax.swing.AbstractAction; 
     6 
    57import tmcsim.cadsimulator.viewer.CADSimulatorViewer; 
    68 
    79/** 
    8  * Abstract action to exit the CADSimulator. When the action is performed the 
    9  * CADSimulatorView.closeViewer() method is called. 
    10  * 
     10 * Abstract action to exit the CADSimulator. When the action is performed 
     11 * the CADSimulatorView.closeViewer() method is called. 
     12 *   
    1113 * @author Matthew Cechini 
    12  * @version 
     14 * @version  
    1315 */ 
    1416@SuppressWarnings("serial") 
    15 public class ExitAction extends AbstractAction 
    16 { 
     17public class ExitAction extends AbstractAction { 
    1718 
    18     /** 
    19      * Reference to the CADSimulatorViewer. 
    20      */ 
     19    /** Reference to the CADSimulatorViewer. */ 
    2120    private CADSimulatorViewer theViewer; 
    2221 
    23     public ExitAction(CADSimulatorViewer viewer) 
    24     { 
     22    public ExitAction(CADSimulatorViewer viewer) { 
    2523        super("Exit"); 
    26  
     24         
    2725        theViewer = viewer; 
    2826    } 
     27     
     28    public void actionPerformed(ActionEvent arg0) {      
     29        theViewer.closeViewer(); 
     30    } 
    2931 
    30     public void actionPerformed(ActionEvent arg0) 
    31     { 
    32         //theViewer.closeViewer(); 
    33         /* closeViewer() will prompt the user for confirmation. 
    34          * 26 Apr 2016 I'm tired of seeing the confirmation message, 
    35          * so if the user chooses File>Exit, assume they intend to exit 
    36          * and don't ask for confirmation.  If they click window close 
    37          * button, they will still get the confirmation prompt. jdalbey 
    38          */ 
    39         System.exit(0); 
    40     } 
    4132} 
  • /trunk/src/tmcsim/paramicscommunicator/ParamicsFileWriter.java

    r25 r2  
    11package tmcsim.paramicscommunicator; 
     2 
    23 
    34import java.io.File; 
     
    1011import java.util.logging.Level; 
    1112import java.util.logging.Logger; 
     13 
    1214import org.apache.xml.serialize.OutputFormat; 
    1315import org.apache.xml.serialize.XMLSerializer; 
    1416import org.w3c.dom.Element; 
     17 
    1518import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE; 
    1619 
    1720/** 
    18  * The ParamicsFileWriter handles writing messages to a target file which is 
    19  * read by Paramics. Messages are received through the writeMessage() method. 
     21 * The ParamicsFileWriter handles writing messages to a target file which 
     22 * is read by Paramics. Messages are received through the writeMessage() method. 
    2023 * This object handles queueing messages and writing as the file becomes 
    21  * available. New data is written to the target file when it has been modified 
    22  * (cleared) by Paramics. If this does not happen, messages are queued and a 
    23  * timer is used to periodically determine if the file has become available for 
    24  * writing. 
    25  * 
     24 * available.  New data is written to the target file when it has been 
     25 * modified (cleared) by Paramics.  If this does not happen, messages 
     26 * are queued and a timer is used to periodically determine if the 
     27 * file has become available for writing. 
     28 *  
    2629 * @author Matthew Cechini 
    2730 * @version 
    2831 */ 
    29 public class ParamicsFileWriter extends Observable 
    30 { 
    31  
    32     /** 
    33      * Duration (in ms) that the TimerTask will be scheduled to retry writing to 
    34      * the target file. Default = 2000ms 
     32public class ParamicsFileWriter extends Observable { 
     33     
     34    /**  
     35     * Duration (in  ms) that the TimerTask will be scheduled to 
     36     * retry writing to the target file. Default = 2000ms 
    3537     */ 
    3638    private static long TIMER_DURATION = 2000; 
    37     /** 
    38      * Error Logger. 
    39      */ 
     39     
     40    /** Error Logger. */ 
    4041    private Logger paramLogger = Logger.getLogger("tmcsim.paramicscommunicator"); 
    41     /** 
    42      * Linked List of messages that have been received 
    43      */ 
     42     
     43    /** Linked List of messages that have been received */ 
    4444    private LinkedList<Element> queuedMessages = null; 
    45     /** 
    46      * 
    47      */ 
     45     
     46    /**  */ 
    4847    private String writerID = null; 
    49     /** 
    50      * File name of the file where data is written 
    51      */ 
     48 
     49    /** File name of the file where data is written */ 
    5250    private String outputFile = null; 
    53     /** 
    54      * FileWriter used to write data to the output file. 
    55      */ 
     51     
     52    /** FileWriter used to write data to the output file. */ 
    5653    private FileWriter fileWriter = null; 
    57     /** 
    58      * Value (seconds since 1/1/1970) of output file's last modifcation time 
    59      */ 
    60     private long lastModified = 0; 
    61     /** 
    62      * Timer used to schedule file writing tasks. 
    63      */ 
     54     
     55    /** Value (seconds since 1/1/1970) of output file's last modifcation time */ 
     56    private long lastModified = 0;   
     57     
     58    /** Timer used to schedule file writing tasks. */ 
    6459    private Timer writerTimer = null; 
    65     /** 
    66      * Synchronizing lock to protect File IO and message queuing. 
    67      */ 
    68     private Object lock = null; 
    69  
     60     
    7061    /** 
    7162     * A TimerTask to retry writing messages that have been queued within this 
    72      * ParamicsWriter. If a message has been queued, see if the target file has 
    73      * been modified since last write. If so, write the first queued message to 
    74      * the file and remove the message from the queue. If writing is 
    75      * unsuccessful, do not remove the message from the queue. If there are no 
    76      * more messages in the queue, cancel this timer. 
    77      */ 
    78     private class WriterTimerTask extends TimerTask 
    79     { 
    80  
    81         public void run() 
    82         { 
    83  
    84             synchronized (lock) 
    85             { 
    86                 paramLogger.log(Level.INFO, "ParamicsFileWriter, WriterTimerTask " 
    87                         + "run() started, current queue size = " + queuedMessages.size()); 
    88  
     63     * ParamicsWriter.  If a message has been queued, see if the target file 
     64     * has been modified since last write.  If so, write the first queued message 
     65     * to the file and remove the message from the queue.  If writing is unsuccessful, 
     66     * do not remove the message from the queue.  If there are no more messages in  
     67     * the queue, cancel this timer. 
     68     */ 
     69    private class WriterTimerTask extends TimerTask { 
     70        public void run() { 
     71 
     72            synchronized(lock) { 
     73             
    8974                //if we've queued something, continue. 
    90                 if (queuedMessages.size() > 0) 
    91                 { 
    92  
     75                if(queuedMessages.size() > 0) {          
     76                     
    9377                    //if file has been modified, write to it 
    94                     if (lastModified < new File(outputFile).lastModified()) 
    95                     { 
    96                         try 
    97                         { 
     78                    if(lastModified < new File(outputFile).lastModified()) 
     79                    {        
     80                        try { 
    9881                            writeToFile(queuedMessages.getFirst()); 
    9982                            queuedMessages.remove(0); 
    100                         } catch (IOException ioe) 
    101                         { 
    102                             paramLogger.logp(Level.SEVERE, "ParamicsFileWriter.WriterTimerTask", 
    103                                     "run()", "Exception in writing to the target file: " 
    104                                     + outputFile + ".  Queue size = " + queuedMessages.size(), ioe); 
    10583                        } 
    106  
     84                        catch (IOException ioe) { 
     85                            paramLogger.logp(Level.SEVERE, "ParamicsFileWriter.WriterTimerTask",  
     86                                    "run()", "Exception in writing to the target file: " +  
     87                                    outputFile + ".  Queue size = " + queuedMessages.size(), ioe); 
     88                        } 
     89                         
    10790                        //all queued messages gone, cancel timer 
    108                         if (queuedMessages.size() == 0) 
    109                         { 
     91                        if(queuedMessages.size() == 0) 
    11092                            this.cancel(); 
    111                         } 
    112                     } 
     93                    }    
    11394                } 
    114             } 
     95            }                
    11596        } 
    11697    } 
    117  
    118     /** 
    119      * Constructor. Initialize data objects. If the target file exists, delete 
    120      * it, and then create a new file. 
     98     
     99    /** Synchronizing lock to protect File IO and message queuing. */ 
     100    private Object lock = null;      
     101     
     102    /** 
     103     * Constructor.  Initialize data objects.  If the target file exists, delete  
     104     * it, and then create a new file.   
    121105     * 
    122106     * @param workingDir Directory path where the output file is to be written 
    123107     * @param mess The ParamicsCommMessage containing the outputFile filename. 
    124108     */ 
    125     public ParamicsFileWriter(String id, String workingDir, String targetFile) 
    126     { 
    127  
    128         try 
    129         { 
     109    public ParamicsFileWriter(String id, String workingDir, String targetFile) { 
     110 
     111        try { 
    130112            writerID = id; 
    131  
    132             queuedMessages = new LinkedList<Element>(); 
    133             lock = new Object(); 
    134  
    135             outputFile = workingDir + targetFile; 
    136  
    137             File tempFile = new File(outputFile); 
    138             if (tempFile.exists()) 
    139             { 
     113     
     114            queuedMessages  = new LinkedList<Element>();     
     115            lock            = new Object(); 
     116                         
     117            outputFile      = workingDir + targetFile;   
     118             
     119            File tempFile = new File(outputFile);            
     120            if(tempFile.exists()) { 
    140121                tempFile.delete(); 
    141122            } 
    142123 
    143             tempFile.createNewFile(); 
    144  
    145             writerTimer = new Timer(); 
    146  
    147         } catch (IOException ioe) 
    148         { 
    149             paramLogger.logp(Level.SEVERE, "ParamicsFileWriter", "Constructor", 
     124            tempFile.createNewFile();            
     125                                                 
     126            writerTimer     = new Timer(); 
     127             
     128        } catch (IOException ioe) { 
     129            paramLogger.logp(Level.SEVERE, "ParamicsFileWriter", "Constructor",  
    150130                    "Unable to create Paramics File Writer.", ioe); 
    151131        } 
    152  
     132         
    153133    } 
    154  
     134     
     135     
    155136    /** 
    156137     * Method is called when a message has been received from the CAD Simulator. 
    157      * If the message queue is not empty, add the new message to the queue. If 
    158      * the output file has not been modified (read) since last write, add the 
    159      * message to the queue and set a timer to repeatedly check for modification 
    160      * to the output file. Else, write the new message to the file. If there is 
    161      * an error in writing the data, queue the message start a timer to retry 
    162      * the writing. 
     138     * If the message queue is not empty, add the new message to the queue. 
     139     * If the output file has not been modified (read) since last write, 
     140     * add the message to the queue and set a timer to repeatedly check for  
     141     * modification to the output file.  Else, write the new message to the file.   
     142     * If there is an error in writing the data, queue the message start a timer 
     143     * to retry the writing. 
    163144     * 
    164      * @param newMessage The received message which is to be written to the 
    165      * output file. 
    166      */ 
    167     public void writeMessage(Element messageElem) 
    168     { 
    169  
    170         synchronized (lock) 
    171         { 
    172             paramLogger.log(Level.INFO, "ParamicsFileWriter, writeMessage " 
    173                     + "current queue size = " + queuedMessages.size()); 
    174  
    175             //messages already queued... get in line. 
    176             if (queuedMessages.size() > 0) 
    177             { 
     145     * @param newMessage The received message which is to be written to  
     146     * the output file. 
     147     */ 
     148    public void writeMessage(Element messageElem) { 
     149         
     150        synchronized(lock) { 
     151             
     152            //messages already queued... get in line.            
     153            if(queuedMessages.size() > 0) { 
    178154                queuedMessages.add(messageElem); 
    179155 
    180                 paramLogger.log(Level.INFO, "Queueing message, new queue " 
    181                         + "size = " + queuedMessages.size()); 
    182             } //No modification since last write. (first queue) 
    183             else if (lastModified >= new File(outputFile).lastModified()) 
    184             { 
    185                 paramLogger.log(Level.INFO, "ParamicsFileWriter, writeMessage " 
    186                         + "adding msg to queue."); 
    187                 queuedMessages.add(messageElem); 
    188  
    189                 writerTimer.scheduleAtFixedRate(new WriterTimerTask(), 
     156                paramLogger.log(Level.INFO, "Queueing message, new queue " + 
     157                        "size = " + queuedMessages.size()); 
     158            }                
     159            //No modification since last write. (first queue)                
     160            else if (lastModified >= new File(outputFile).lastModified()) { 
     161                queuedMessages.add(messageElem);                 
     162                                 
     163                writerTimer.scheduleAtFixedRate(new WriterTimerTask(),  
    190164                        0L, TIMER_DURATION); 
    191165 
    192166                paramLogger.log(Level.INFO, "First message queued"); 
    193             } //free and clear, write. 
    194             else 
    195             { 
    196                 paramLogger.log(Level.INFO, "ParamicsFileWriter, writeMessage " 
    197                         + "try to writeToFile" + outputFile); 
    198                 try 
    199                 { 
     167            }            
     168            //free and clear, write. 
     169            else { 
     170                try { 
    200171                    writeToFile(messageElem); 
    201                 } catch (IOException ioe) 
    202                 { 
    203                     paramLogger.logp(Level.SEVERE, "ParamicsFileWriter", 
    204                             "writeMessage()", "Exception in writing to the " 
    205                             + "target file: " + outputFile, ioe); 
    206  
     172                } 
     173                catch(IOException ioe) { 
     174                    paramLogger.logp(Level.SEVERE, "ParamicsFileWriter",  
     175                            "writeMessage()", "Exception in writing to the " + 
     176                            "target file: " + outputFile, ioe); 
     177                     
    207178                    queuedMessages.add(messageElem); 
    208  
    209                     writerTimer.scheduleAtFixedRate(new WriterTimerTask(), 
     179                     
     180                    writerTimer.scheduleAtFixedRate(new WriterTimerTask(),  
    210181                            0L, TIMER_DURATION); 
    211182                } 
    212                 paramLogger.log(Level.INFO, "ParamicsFileWriter, writeMessage " 
    213                         + "writeToFile succeeded."); 
    214183            } 
    215184        } 
    216185    } 
    217  
     186         
    218187    /** 
    219188     * Method writes data to the output file. 
    220      * 
     189     *  
    221190     * @param output Data to be written to the file. 
    222191     */ 
    223     private void writeToFile(Element output) throws IOException 
    224     { 
    225  
     192    private void writeToFile(Element output) throws IOException {        
     193         
    226194        fileWriter = new FileWriter(outputFile); 
    227  
    228         OutputFormat of = new OutputFormat("XML", "ISO-8859-1", true); 
     195         
     196        OutputFormat of = new OutputFormat("XML","ISO-8859-1",true); 
    229197        of.setIndent(1); 
    230198        of.setIndenting(true); 
    231  
     199         
    232200        XMLSerializer serializer = new XMLSerializer(fileWriter, of); 
    233201        serializer.asDOMSerializer(); 
    234202        serializer.serialize(output); 
    235203 
    236         /** 
    237          * Added by Nathaniel Lehrer 
    238          */ 
    239         try 
    240         { 
     204        /** Added by Nathaniel Lehrer */ 
     205        try { 
    241206            java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream(); 
    242207            new XMLSerializer(outputStream, of).serialize(output); 
    243208            tmcsim.paramicslog.ParamicsLog.getInstance().writeToLog(outputStream.toString()); 
    244         } catch (Exception e) 
    245         { 
     209        } catch(Exception e) { 
    246210            System.out.println(e); 
    247211        } 
    248         /** 
    249          * End Add by Nathaniel Lehrer 
    250          */ 
     212        /** End Add by Nathaniel Lehrer */ 
     213         
    251214        fileWriter.flush(); 
    252215        fileWriter.close(); 
    253  
    254         lastModified = new File(outputFile).lastModified(); 
    255  
     216         
     217        lastModified = new File(outputFile).lastModified();      
     218         
    256219        setChanged(); 
    257220        notifyObservers(new FileIOUpdate(IO_TYPE.WRITE, writerID, new File(outputFile).length())); 
    258  
    259     } 
     221                             
     222    }                
    260223} 
  • /trunk/src/tmcsim/paramicscommunicator/ParamicsCommunicator.java

    r26 r6  
    7474 
    7575        SOCKET_PORT("SocketPort"), 
    76         WORKING_DIR("WorkingDirectory"), 
    77         GUI_VISIBLE("GUIvisible"); 
     76        WORKING_DIR("WorkingDirectory"); 
    7877        public String name; 
    7978 
     
    140139        readers = new TreeMap<String, ParamicsFileReader>(); 
    141140 
     141        theGUI = new ParamicsCommunicatorGUI(); 
     142        addObserver(theGUI); 
     143        theGUI.addWindowListener(new WindowListener() 
     144        { 
     145            public void windowActivated(WindowEvent arg0) 
     146            { 
     147            } 
     148 
     149            ; 
     150            public void windowClosed(WindowEvent arg0) 
     151            { 
     152            } 
     153 
     154            ; 
     155            public void windowClosing(WindowEvent arg0) 
     156            { 
     157                System.exit(0); 
     158            } 
     159 
     160            public void windowDeactivated(WindowEvent arg0) 
     161            { 
     162            } 
     163 
     164            ; 
     165            public void windowDeiconified(WindowEvent arg0) 
     166            { 
     167            } 
     168 
     169            ; 
     170            public void windowIconified(WindowEvent arg0) 
     171            { 
     172            } 
     173 
     174            ; 
     175            public void windowOpened(WindowEvent arg0) 
     176            { 
     177            } 
     178        ; 
     179        }); 
     180 
    142181        try 
    143182        { 
     
    208247        } 
    209248 
    210         // Should we display the GUI? 
    211         String visibleProp = paramicsCommProp.getProperty(PROPERTIES.GUI_VISIBLE.name); 
    212         // If no property was given, or if it was given and says True 
    213         if (visibleProp == null || (visibleProp.toLowerCase().equals("true"))) 
    214         { 
    215             theGUI = new ParamicsCommunicatorGUI(); // it sets itself visible 
    216             addObserver(theGUI); 
    217             theGUI.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); 
    218         } 
    219249 
    220250        try 
     
    329359 
    330360    /** 
    331      * Perform the action represented in XML document message received from the 
    332      * CAD Simulator. First determine if the action is from a READER, WRITER, 
    333      * and RESET. If the paramics action is REGISTER, add a new 
    334      * ParamicsFileReader/Writer to the local list of readers/writers and update 
    335      * the GUI with a FileRegUpdate object. If the paramics action is 
    336      * UNREGISTER, remove the ParamicsFileReader/Writer from the local list of 
    337      * readers/writers and update the GUI with a FileRegUpdate object. If RESET 
    338      * is received, clear all readers and writers. 
     361     * Perform the action represented in the received XML document message. 
     362     * First determine if the action is from a READER, WRITER, and RESET. If the 
     363     * paramics action is REGISTER, add a new ParamicsFileReader/Writer to the 
     364     * local list of readers/writers and update the GUI with a FileRegUpdate 
     365     * object. If the paramics action is UNREGISTER, remove the 
     366     * ParamicsFileReader/Writer from the local list of readers/writers and 
     367     * update the GUI with a FileRegUpdate object. If RESET is received, clear 
     368     * all readers and writers. 
    339369     * 
    340370     * @param mess Received XML document message. 
     
    452482            } catch (SocketTimeoutException ste) 
    453483            { 
    454                 System.out.println("...waiting for socket connection from the CAD Simulator..."); 
     484                System.out.println("...waiting..."); 
    455485            } catch (IOException ioe) 
    456486            { 
  • /trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java

    r25 r6  
    8080        public void run() 
    8181        { 
    82             paramLogger.logp(Level.INFO, 
    83                     "ParamicsFileReader.ReaderTimerTask", "run()", 
    84                     "Waiting for " + inputFile + " to be modified."); 
     82 
    8583            if (lastModified < inputFile.lastModified()) 
    8684            { 
    87                 paramLogger.logp(Level.INFO, 
    88                         "ParamicsFileReader.ReaderTimerTask", "run()", 
    89                         "Cool, " + inputFile + " has been modified, let's read it."); 
    9085 
    9186                try 
     
    10196                    Element messageElem = readerDoc.createElement(PARAMICS_COMM_TAGS.MESSAGE.tag); 
    10297                    String fileContents = readFromFile(); 
    103                     paramLogger.logp(Level.INFO, 
    104                             "ParamicsFileReader.ReaderTimerTask", "run()", 
    105                             "Nice, we read " + fileContents); 
    10698                    messageElem.appendChild(readerDoc.createTextNode(fileContents)); 
    10799                    readerElem.appendChild(messageElem); 
  • /trunk/src/tmcsim/paramicscommunicator/gui/ParamicsCommunicatorGUI.java

    r29 r6  
    1111import java.util.logging.LogRecord; 
    1212import java.util.logging.Logger; 
    13  
    1413import javax.swing.BorderFactory; 
    1514import javax.swing.Box; 
     
    2120import javax.swing.JTabbedPane; 
    2221import javax.swing.JTextArea; 
    23  
    2422import tmcsim.common.RevisionNumber; 
    2523import tmcsim.paramicscommunicator.FileIOUpdate; 
     
    209207        this.setJMenuBar(menuBar); 
    210208 
    211         fileReaderTabs = new JTabbedPane(); 
    212         fileReaderTabs.setAlignmentX(Box.CENTER_ALIGNMENT); 
    213         fileReaderTabs.setMinimumSize(new Dimension(420, 480)); 
    214         fileReaderTabs.setPreferredSize(new Dimension(420, 480)); 
    215         fileReaderTabs.setMaximumSize(new Dimension(420, 480)); 
    216         fileReaderTabs.setBorder(BorderFactory.createCompoundBorder( 
     209        fileIOTabs = new JTabbedPane(); 
     210        fileIOTabs.setAlignmentX(Box.CENTER_ALIGNMENT); 
     211        fileIOTabs.setMinimumSize(new Dimension(420, 480)); 
     212        fileIOTabs.setPreferredSize(new Dimension(420, 480)); 
     213        fileIOTabs.setMaximumSize(new Dimension(420, 480)); 
     214        fileIOTabs.setBorder(BorderFactory.createCompoundBorder( 
    217215                BorderFactory.createTitledBorder( 
    218                 BorderFactory.createRaisedBevelBorder(), "Registered Readers "), 
    219                 BorderFactory.createEmptyBorder(5, 5, 5, 5))); 
    220          
    221         fileWriterTabs = new JTabbedPane(); 
    222         fileWriterTabs.setAlignmentX(Box.CENTER_ALIGNMENT); 
    223         fileWriterTabs.setMinimumSize(new Dimension(420, 480)); 
    224         fileWriterTabs.setPreferredSize(new Dimension(420, 480)); 
    225         fileWriterTabs.setMaximumSize(new Dimension(420, 480)); 
    226         fileWriterTabs.setBorder(BorderFactory.createCompoundBorder( 
    227                 BorderFactory.createTitledBorder( 
    228                 BorderFactory.createRaisedBevelBorder(), "Registered Writers "), 
     216                BorderFactory.createRaisedBevelBorder(), "Registered I/O"), 
    229217                BorderFactory.createEmptyBorder(5, 5, 5, 5))); 
    230218 
     
    240228                BorderFactory.createEmptyBorder(5, 5, 5, 5))); 
    241229 
    242         Box tabbedBox = new Box(BoxLayout.X_AXIS); 
    243         tabbedBox.add(fileReaderTabs); 
    244         tabbedBox.add(fileWriterTabs); 
    245          
     230 
    246231        Box guiBox = new Box(BoxLayout.Y_AXIS); 
    247         guiBox.add(tabbedBox); 
     232        guiBox.add(fileIOTabs); 
    248233        guiBox.add(Box.createVerticalStrut(10)); 
    249234        guiBox.add(errorPane); 
     
    252237 
    253238        setMinimumSize(new Dimension(420, 680)); 
    254         setPreferredSize(new Dimension(840, 680)); 
     239        setPreferredSize(new Dimension(420, 680)); 
    255240        setResizable(false); 
    256241        pack(); 
     
    275260            case READ: 
    276261                tabName = "Reader " + update.ioID; 
    277                 fileReaderTabs.add(tabName, new ParamicsIOInfoPanel(update, model)); 
    278262                break; 
    279263            case WRITE: 
    280264                tabName = "Writer " + update.ioID; 
    281                 fileWriterTabs.add(tabName, new ParamicsIOInfoPanel(update, model)); 
    282265                break; 
    283266        } 
    284267 
    285     } 
    286      
    287     private JTabbedPane fileReaderTabs; 
    288     private JTabbedPane fileWriterTabs; 
     268        fileIOTabs.add(tabName, new ParamicsIOInfoPanel(update, model)); 
     269    } 
     270    private JTabbedPane fileIOTabs; 
    289271    private JScrollPane errorPane; 
    290272    private JTextArea errorTA; 
  • /trunk/test/tmcsim/cadsimulator/CADSimulatorFixture.java

    r26 r19  
    3434            + "ATMSProperties         = empty.txt\n" 
    3535            + "MediaProperties        = empty.txt\n"; 
    36     static final String configpData = "ParamicsCommHost = 192.168.251.45\n" 
     36    static final String paramicsData = "ParamicsCommHost      = 192.168.251.45\n" 
    3737            + "ParamicsCommPort       = 4450\n" 
    3838            + "IncidentUpdateInterval = 30\n" 
     
    4242            + "CameraStatusInterval   = 30\n" 
    4343            + "CameraStatusFile       = camera_status.xml\n"; 
    44     static final String paramConfig    = "SocketPort=4450\n" 
    45             +"WorkingDirectory=.\nGUIvisible=false"; 
    4644    static final String cardfileURL = "http://pastebin.com/raw/Yr26nfp7"; 
    4745    static final String smallXMLURL = "http://pastebin.com/raw/Eqj2N5qD"; 
     
    6058        System.setOut(ps); 
    6159        writedata("config.txt", configData); 
    62         writedata("pconfig.txt", configpData); 
    63         writedata("pmcprops.txt", paramConfig); 
     60        writedata("pconfig.txt", paramicsData); 
    6461        writedata("empty.txt", ""); 
    6562        writeScriptfiles(); 
  • /trunk/IDE_metadata/Eclipse

    • Property svn:ignore deleted
  • /trunk/IDE_metadata/Eclipse/build.xml

    r30 r18  
    5454 
    5555 
     56    <echo message="Packaging TMC into a single JAR at ${deploy.jar}"/> 
    5657 
    5758    <delete dir="${deploy.dir}"/> 
    5859    <mkdir dir="${deploy.dir}"/> 
    5960 
    60      
     61    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip"> 
     62        <zipgroupfileset dir="${workdir}/lib" includes="xercesImpl.jar"/> 
     63 
     64        <manifest> 
     65            <attribute name="Main-Class" value="${main.class}"/> 
     66        </manifest> 
     67    </jar> 
     68 
     69    <zip destfile="${deploy.jar}"> 
     70        <zipfileset src="${deploy.dir}/temp_final.jar" 
     71        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/> 
     72    </zip> 
     73 
     74    <delete file="${deploy.dir}/temp_final.jar"/> 
     75 
    6176    <!--                   *** Build CAD Server Only Jar ***         --> 
    6277      <jar destfile="${deploy.dir}/CADserver.jar" 
  • /trunk/IDE_metadata/NetBeans/TMCSim/build.xml

    r23 r20  
    131131      </jar> 
    132132</target> 
    133  
    134 <target description="Build separate jar files for each component of the TMC system."  
    135         name="ZipForInstall" depends="package-jars"> 
    136     <!-- Notes:    Create a zip file with jars and all external resources for distributing 
    137     to other machines. 
    138     Zip the Jar files. 
    139     Zip folders for config, images, audio, scripts. 
    140     Write .bat files and .bash files to launch each app.  Put these in root folder. 
    141     Zip it all up! 
    142     --> 
    143 </target> 
    144  
    145133    <!-- 
    146134 
  • /trunk/config/paramics_communicator_logging.properties

    r21 r14  
    1616 
    1717LogFile = paramics_communication_log.xml 
    18  
    19 # Set properties for 2016 --jd 
    20 LogFile=C:\\paramics_communicator.log 
    21 # Ethernet cable in operator room 
    22 #CADSimulatorHost=192.168.251.119 
    23 # PC1 in operator room (Service Tag BHLLD42) 
    24 CADSimulatorHost=192.168.251.116 
    25 # Virtual Host: TMCSIM Manager 
    26 #CADSimulatorHost=192.168.251.88 
    27 # For local testing 
    2818CADSimulatorHost = 127.0.0.1 
    29  
    30 CADSimulatorRMIPort=4445 
    31 #CADSimulatorRMIPort = 4450 
     19CADSimulatorRMIPort = 4450 
  • /trunk/config/cad_simulator_paramics_config.properties

    r21 r14  
    1 ParamicsCommHost       = 192.168.251.45 
     1#ParamicsCommHost       = 192.168.251.45 
    22# For development testing 
    3 #ParamicsCommHost       = 127.0.0.1 
     3ParamicsCommHost       = 127.0.0.1 
    44ParamicsCommPort       = 4450 
    55IncidentUpdateInterval = 30 
Note: See TracChangeset for help on using the changeset viewer.