Changeset 27 in tmcsimulator


Ignore:
Timestamp:
04/26/2016 08:07:52 PM (10 years ago)
Author:
jdalbey
Message:

Coordinator: added diagnostic log messages to startSimulation().

File:
1 edited

Legend:

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

    r2 r27  
    1  
    21package tmcsim.cadsimulator; 
    32 
    4 import java.awt.List; 
    53import java.io.File; 
    64import java.rmi.RemoteException; 
     
    1614import java.util.logging.Level; 
    1715import java.util.logging.Logger; 
    18  
    19 import javax.swing.JList; 
    20 import javax.swing.Timer; 
    2116import javax.swing.table.DefaultTableModel; 
    2217import javax.xml.parsers.SAXParserFactory; 
    23  
    2418import tmcsim.cadmodels.CADRoutedMessage; 
    2519import tmcsim.cadmodels.CMSInfo; 
     
    4337import tmcsim.client.cadclientgui.data.Incident; 
    4438import tmcsim.client.cadclientgui.data.IncidentEvent; 
    45 import tmcsim.client.cadclientgui.enums.CADDataEnums.*; 
     39import tmcsim.client.cadclientgui.enums.CADDataEnums.CARDFILE; 
     40import tmcsim.client.cadclientgui.enums.CADDataEnums.EditCommand; 
     41import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_ACTIVITIES; 
     42import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_ADD_INFO; 
     43import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_CALLBACK; 
     44import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_CALLER; 
     45import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_EDIT_LOG; 
     46import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_GEN_INFO; 
     47import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_INFO; 
     48import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_LOC; 
     49import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_PROBLEM; 
     50import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_RESP; 
     51import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_TABLE; 
     52import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_TIMES; 
     53import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_VAL; 
     54import tmcsim.client.cadclientgui.enums.CADDataEnums.TABLE; 
    4655import tmcsim.client.cadclientgui.enums.CADScriptTags.UNIT_TAGS; 
    4756import tmcsim.client.cadclientgui.enums.IncidentEnums; 
    4857import tmcsim.client.cadclientgui.enums.UnitStatusEnums; 
    49 import tmcsim.client.cadclientgui.screens.ScreenManager; 
    50 import tmcsim.common.CCTVInfo; 
     58import tmcsim.common.CADEnums.PARAMICS_STATUS; 
     59import tmcsim.common.CADEnums.SCRIPT_STATUS; 
    5160import tmcsim.common.ObserverMessage; 
    5261import tmcsim.common.ScriptException; 
    5362import tmcsim.common.SimulationException; 
    5463import tmcsim.common.XMLIncident; 
    55 import tmcsim.common.CADEnums.PARAMICS_STATUS; 
    56 import tmcsim.common.CADEnums.SCRIPT_STATUS; 
    5764import tmcsim.interfaces.CADClientInterface; 
    5865import tmcsim.interfaces.CoordinatorInterface; 
     
    6067 
    6168/** 
    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  
     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 
    6572 * SimulationManagerInterface Object is used to provide communication to a 
    66  * remotely connected SimulationManager.  Observers may register with the 
     73 * remotely connected SimulationManager. Observers may register with the 
    6774 * Coordinator to listen for simulation data updates. 
    6875 * 
     
    7380 * @see SimulationControlManager 
    7481 * @author Matthew Cechini 
    75  * @version  
     82 * @version 
    7683 */ 
    7784@SuppressWarnings("serial") 
    7885public class Coordinator extends UnicastRemoteObject 
    79     implements CoordinatorInterface { 
    80  
    81     /** Error logger. */ 
     86        implements CoordinatorInterface 
     87{ 
     88 
     89    /** 
     90     * Error logger. 
     91     */ 
    8292    private Logger coorLogger = Logger.getLogger("tmcsim.cadsimulator"); 
    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.  
     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. 
    8796     * Therefore, the list is managed manually. 
    8897     */ 
    8998    private Vector<Observer> observerList = 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. 
     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. 
    94103     */ 
    95104    private static SimulationManagerInterface managerInt = null; 
    96      
    97105    private static LinkedList<CADClientInterface> clientList; 
    98              
    99106    private static CADData cadData; 
    100      
    101107    private static CardfileData cardfileData; 
    102      
    103     /** 
    104      * Constructor.  Call UnicastRemoteObject constructor and call  
     108 
     109    /** 
     110     * Constructor. Call UnicastRemoteObject constructor and call 
    105111     * initializeSimulation. 
    106112     * 
    107113     * @throws RemoteException 
    108114     */ 
    109     public Coordinator() throws RemoteException {            
     115    public Coordinator() throws RemoteException 
     116    { 
    110117        super(); 
    111118        clientList = new LinkedList<CADClientInterface>(); 
    112119        cadData = new CADData(); 
    113       cardfileData = new CardfileData(); 
    114         try { 
     120        cardfileData = new CardfileData(); 
     121        try 
     122        { 
    115123            CardfileReader cfr = new CardfileReader("scripts/Cardfile.xml", cardfileData); 
    116         } catch (Exception e) { 
     124        } catch (Exception e) 
     125        { 
    117126            System.out.println("Could not load cardfile script"); 
    118127        } 
    119          
     128 
    120129        observerList = new Vector<Observer>(); 
    121130    } 
    122      
    123     public void registerForCallback(CADClientInterface client) throws RemoteException{ 
     131 
     132    public void registerForCallback(CADClientInterface client) throws RemoteException 
     133    { 
    124134        clientList.add(client); 
    125135        CADSimulator.theViewer.connectClient(); 
    126     }    
    127      
    128     public void unregisterForCallback(CADClientInterface client) throws RemoteException{ 
     136    } 
     137 
     138    public void unregisterForCallback(CADClientInterface client) throws RemoteException 
     139    { 
    129140        clientList.remove(client); 
    130141        CADSimulator.theViewer.disconnectClient(); 
    131142    } 
    132      
    133     public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException{ 
     143 
     144    public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException 
     145    { 
    134146        managerInt = simManInt; 
    135147        CADSimulator.theViewer.setSimManagerStatus(true); 
    136     }    
    137      
    138     public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException { 
     148    } 
     149 
     150    public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException 
     151    { 
    139152        managerInt = null; 
    140153        CADSimulator.theViewer.setSimManagerStatus(false); 
    141     }      
    142      
    143     public void startSimulation() throws RemoteException, ScriptException { 
    144  
    145         if(!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     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        { 
    146163            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    147         else if(CADSimulator.theParamicsSimMgr.isConnected()) { 
    148             Runnable startRun = new Runnable() { 
    149                 public void run() { 
    150                     try { 
     164        } else if (CADSimulator.theParamicsSimMgr.isConnected()) 
     165        { 
     166            Runnable startRun = new Runnable() 
     167            { 
     168                public void run() 
     169                { 
     170                    try 
     171                    { 
    151172                        setScriptStatus(SCRIPT_STATUS.ATMS_SYNCHRONIZATION); 
    152                          
     173 
    153174                        long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime(); 
    154                         long sleepTime       = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000);                
    155  
    156                         coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation",  
    157                                 "Sleeping for " + sleepTime/1000 + " seconds."); 
     175                        long sleepTime = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000); 
     176 
     177                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation", 
     178                                "Sleeping for " + sleepTime / 1000 + " seconds."); 
    158179                        Thread.sleep(sleepTime); 
    159      
    160                         //currentATMSTime += sleepTime;                  
    161                         //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime);                                        
    162                     } 
    163                     catch (Exception e) { 
     180 
     181                        //currentATMSTime += sleepTime; 
     182                        //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime); 
     183                    } catch (Exception e) 
     184                    { 
    164185                        setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING); 
    165                          
    166                         coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run",  
     186 
     187                        coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run", 
    167188                                "Unable to connect to ATMS server.", e); 
    168                     } 
    169                     finally { 
     189                    } finally 
     190                    { 
    170191                        CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    171192                        CADSimulator.theParamicsSimMgr.startSimulation(); 
    172                         CADSimulator.theSoundPlayer.setAudioEnabled(true);       
     193                        CADSimulator.theSoundPlayer.setAudioEnabled(true); 
     194                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 
     195                                "Simulation has started."); 
    173196                    } 
    174197                } 
    175198            }; 
    176          
     199 
    177200            Thread startThread = new Thread(startRun); 
    178201            startThread.start(); 
    179         } 
    180         else { 
     202        } else 
     203        { 
    181204            CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    182205            CADSimulator.theSoundPlayer.setAudioEnabled(true); 
    183206        } 
    184207    } 
    185      
    186      
    187     public void pauseSimulation() throws RemoteException {       
     208 
     209    public void pauseSimulation() throws RemoteException 
     210    { 
    188211        CADSimulator.theSimulationCntrlMgr.pauseSimulation(); 
    189212        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    190213    } 
    191      
    192  
    193     public void resetSimulation() throws RemoteException {       
    194          
     214 
     215    public void resetSimulation() throws RemoteException 
     216    { 
     217 
    195218        CADSimulator.theIncidentMgr.resetIncidents(); 
    196219        cadData.resetSimulation(); 
    197          
     220 
    198221        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    199222        CADSimulator.theSoundPlayer.deQueueAll(); 
    200          
     223 
    201224        CADSimulator.theViewer.setTime(0); 
    202          
     225 
    203226        setScriptStatus(SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED); 
    204          
     227 
    205228        CMSDiversionDB.getInstance().resetDiversions(); 
    206          
     229 
    207230        CADSimulator.theSimulationCntrlMgr.resetSimulation(); 
    208231        CADSimulator.theParamicsSimMgr.resetSimulation(); 
    209          
    210         notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null));       
    211  
    212     } 
    213  
    214          
    215     public void gotoSimulationTime(final long newSimTime) throws RemoteException { 
    216                  
     232 
     233        notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null)); 
     234 
     235    } 
     236 
     237    public void gotoSimulationTime(final long newSimTime) throws RemoteException 
     238    { 
     239 
    217240        boolean audioWasEnabled = CADSimulator.theSoundPlayer.getAudioEnabled(); 
    218          
     241 
    219242        CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    220          
    221         long tempTime = 0;       
    222         while(tempTime < newSimTime) { 
     243 
     244        long tempTime = 0; 
     245        while (tempTime < newSimTime) 
     246        { 
    223247            tempTime++; 
    224248 
    225249            CADSimulator.theIncidentMgr.tick(tempTime); 
    226         }        
     250        } 
    227251        CADSimulator.theSoundPlayer.setAudioEnabled(audioWasEnabled); 
    228          
     252 
    229253 
    230254        CADSimulator.theSimulationCntrlMgr.gotoSimulationTime(newSimTime); 
    231          
    232         Runnable gotoRun = new Runnable() { 
    233          
    234             public void run() { 
     255 
     256        Runnable gotoRun = new Runnable() 
     257        { 
     258            public void run() 
     259            { 
    235260                CADSimulator.theViewer.setTime(newSimTime); 
    236                  
    237                 if(managerInt != null) { 
    238                     try { 
     261 
     262                if (managerInt != null) 
     263                { 
     264                    try 
     265                    { 
    239266                        managerInt.tick(newSimTime); 
    240                     } 
    241                     catch (RemoteException re) { 
     267                    } catch (RemoteException re) 
     268                    { 
    242269                        //Simulation Manager has disappeared 
    243270                        managerInt = null; 
    244271                        CADSimulator.theViewer.setSimManagerStatus(false); 
    245                          
    246                         coorLogger.logp(Level.SEVERE, "Coordinator", "gotoSimulationTime:run",  
     272 
     273                        coorLogger.logp(Level.SEVERE, "Coordinator", "gotoSimulationTime:run", 
    247274                                "Connection to Simulation Manager has been dropped.", re); 
    248275                    } 
    249276                } 
    250             }            
     277            } 
    251278        }; 
    252          
     279 
    253280        Thread gotoThread = new Thread(gotoRun); 
    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() { 
     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            { 
    268296 
    269297                CADSimulator.theViewer.setScriptStatus(status); 
    270          
    271                 if(managerInt != null) { 
    272                     try {                            
     298 
     299                if (managerInt != null) 
     300                { 
     301                    try 
     302                    { 
    273303                        managerInt.setScriptStatus(status); 
    274                     } 
    275                     catch (RemoteException re) { 
     304                    } catch (RemoteException re) 
     305                    { 
    276306                        //Simulation Manager has disappeared 
    277307                        managerInt = null; 
    278308                        CADSimulator.theViewer.setSimManagerStatus(false); 
    279309 
    280                         coorLogger.logp(Level.SEVERE, "Coordinator", "setScriptStatus:run",  
     310                        coorLogger.logp(Level.SEVERE, "Coordinator", "setScriptStatus:run", 
    281311                                "Connection to Simulation Manager has been dropped.", re); 
    282                     }                    
     312                    } 
    283313                } 
    284314            } 
    285315        }; 
    286          
     316 
    287317        Thread updateThread = new Thread(updateRun); 
    288318        updateThread.start(); 
    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() { 
     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            { 
    300332                CADSimulator.theViewer.setParamicsStatus(status); 
    301                  
    302                 if(managerInt != null) { 
    303                     try {                            
     333 
     334                if (managerInt != null) 
     335                { 
     336                    try 
     337                    { 
    304338                        managerInt.setParamicsStatus(status); 
    305                     } 
    306                     catch (RemoteException re) { 
     339                    } catch (RemoteException re) 
     340                    { 
    307341                        //Simulation Manager has disappeared 
    308342                        managerInt = null; 
    309343                        CADSimulator.theViewer.setSimManagerStatus(false); 
    310344 
    311                         coorLogger.logp(Level.SEVERE, "Coordinator", "setParamicsStatus:run",  
     345                        coorLogger.logp(Level.SEVERE, "Coordinator", "setParamicsStatus:run", 
    312346                                "Connection to Simulation Manager has been dropped.", re); 
    313                     }                    
    314                 }    
    315             }        
     347                    } 
     348                } 
     349            } 
    316350        }; 
    317          
     351 
    318352        Thread updateThread = new Thread(updateRun); 
    319         updateThread.start();        
    320      
    321     } 
    322      
    323     public void connectToParamics() throws RemoteException { 
     353        updateThread.start(); 
     354 
     355    } 
     356 
     357    public void connectToParamics() throws RemoteException 
     358    { 
    324359        CADSimulator.theParamicsSimMgr.connectToParamics(); 
    325360    } 
    326     public void disconnectFromParamics() throws RemoteException { 
     361 
     362    public void disconnectFromParamics() throws RemoteException 
     363    { 
    327364        CADSimulator.theParamicsSimMgr.disconnectFromParamics(); 
    328365    } 
    329      
    330     public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException { 
     366 
     367    public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException 
     368    { 
    331369        CADSimulator.theParamicsSimMgr.loadParamicsNetwork(networkID); 
    332     }    
    333      
    334     public PARAMICS_STATUS getParamicsStatus() throws RemoteException { 
     370    } 
     371 
     372    public PARAMICS_STATUS getParamicsStatus() throws RemoteException 
     373    { 
    335374        return CADSimulator.theParamicsSimMgr.getParamicsStatus(); 
    336375    } 
    337      
    338     public int getParamicsNetworkLoaded() throws RemoteException { 
     376 
     377    public int getParamicsNetworkLoaded() throws RemoteException 
     378    { 
    339379        return CADSimulator.theParamicsSimMgr.getParamicsNetworkLoaded(); 
    340380    } 
    341381 
    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()) 
     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        { 
    349392            throw new ScriptException(ScriptException.SIM_NOT_STARTED); 
    350         else if(!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     393        } else if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     394        { 
    351395            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    352  
    353         CADSimulator.theIncidentMgr.triggerIncident(incidentNumber,  
     396        } 
     397 
     398        CADSimulator.theIncidentMgr.triggerIncident(incidentNumber, 
    354399                CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()); 
    355400    } 
    356      
    357     public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException { 
     401 
     402    public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException 
     403    { 
    358404        CADSimulator.theIncidentMgr.deleteIncident(incidentNumber); 
    359          
    360         if(CADSimulator.theIncidentMgr.getIncidentList().size() == 0) { 
     405 
     406        if (CADSimulator.theIncidentMgr.getIncidentList().size() == 0) 
     407        { 
    361408            setScriptStatus(SCRIPT_STATUS.NO_SCRIPT); 
    362409        } 
    363          
    364         if(managerInt != null) { 
    365             try {                            
     410 
     411        if (managerInt != null) 
     412        { 
     413            try 
     414            { 
    366415                managerInt.incidentRemoved(incidentNumber); 
    367             } 
    368             catch (RemoteException re) { 
     416            } catch (RemoteException re) 
     417            { 
    369418                //Simulation Manager has disappeared 
    370419                managerInt = null; 
    371420                CADSimulator.theViewer.setSimManagerStatus(false); 
    372421 
    373                 coorLogger.logp(Level.SEVERE, "Coordinator", "deleteIncident",  
     422                coorLogger.logp(Level.SEVERE, "Coordinator", "deleteIncident", 
    374423                        "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()) { 
     424            } 
     425        } 
     426    } 
     427 
     428    public void rescheduleIncident(Integer incidentNumber, long newTime) 
     429            throws RemoteException, ScriptException 
     430    { 
     431 
     432        if (newTime < CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()) 
     433        { 
    383434            throw new ScriptException(ScriptException.TIME_PASSED); 
    384435        } 
    385          
     436 
    386437        CADSimulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 
    387438    } 
    388      
    389     public void addIncident(Incident newIncident) throws RemoteException { 
     439 
     440    public void addIncident(Incident newIncident) throws RemoteException 
     441    { 
    390442 
    391443        CADSimulator.theIncidentMgr.addIncident(newIncident); 
    392          
    393         if(managerInt != null) { 
    394             try {                            
     444 
     445        if (managerInt != null) 
     446        { 
     447            try 
     448            { 
    395449                managerInt.incidentAdded(newIncident); 
    396             } 
    397             catch (RemoteException re) { 
     450            } catch (RemoteException re) 
     451            { 
    398452                //Simulation Manager has disappeared 
    399453                managerInt = null; 
    400454                CADSimulator.theViewer.setSimManagerStatus(false); 
    401455 
    402                 coorLogger.logp(Level.SEVERE, "Coordinator", "addIncident",  
     456                coorLogger.logp(Level.SEVERE, "Coordinator", "addIncident", 
    403457                        "Connection to Simulation Manager has been dropped.", re); 
    404             }                    
    405         }        
    406     } 
    407      
    408  
    409     public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException {        
    410          
    411          
    412         try { 
     458            } 
     459        } 
     460    } 
     461 
     462    public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException 
     463    { 
     464 
     465 
     466        try 
     467        { 
    413468            CADSimulator.theIncidentMgr.clearIncidents(); 
    414469            cadData.clearData(); 
    415              
     470 
    416471            ScriptHandler sh = new ScriptHandler(); 
    417              
     472 
    418473            SAXParserFactory.newInstance().newSAXParser().parse(scriptFile, sh); 
    419              
     474 
    420475            cadData.setIncidentsFromXML(sh.getIncidents()); 
    421476            cadData.setUnitsFromXML(sh.getUnits()); 
    422477            refreshClients(); 
    423478            CADSimulator.theIncidentMgr.addIncidents(sh.getIncidents()); 
    424              
    425             resetSimulation();      
    426         } 
    427         catch (Exception e) {e.printStackTrace();} 
    428  
    429     }    
    430  
    431     public Vector<Incident> getIncidentList() throws RemoteException { 
     479 
     480            resetSimulation(); 
     481        } catch (Exception e) 
     482        { 
     483            e.printStackTrace(); 
     484        } 
     485 
     486    } 
     487 
     488    public Vector<Incident> getIncidentList() throws RemoteException 
     489    { 
    432490        return CADSimulator.theIncidentMgr.getIncidentList(); 
    433491    } 
    434      
    435     public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException { 
     492 
     493    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException 
     494    { 
    436495        return CADSimulator.theIncidentMgr.getTriggeredEvents(); 
    437496    } 
    438497 
    439     public SCRIPT_STATUS getScriptStatus() throws RemoteException { 
    440         if(CADSimulator.theIncidentMgr.areIncidentsLoaded()) { 
    441             if(CADSimulator.theSimulationCntrlMgr.simulationStarted())  
     498    public SCRIPT_STATUS getScriptStatus() throws RemoteException 
     499    { 
     500        if (CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     501        { 
     502            if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
     503            { 
    442504                return SCRIPT_STATUS.SCRIPT_RUNNING; 
    443             else { 
    444                 for(Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) { 
    445                     if(inc.hasOccured() == true)  
     505            } else 
     506            { 
     507                for (Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) 
     508                { 
     509                    if (inc.hasOccured() == true) 
     510                    { 
    446511                        return SCRIPT_STATUS.SCRIPT_PAUSED_STARTED; 
     512                    } 
    447513                } 
    448514                return SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED; 
     
    451517        return SCRIPT_STATUS.NO_SCRIPT; 
    452518    } 
    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. 
     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. 
    460525     * 
    461526     * @param newMessage Routed message received from CAD Client. 
    462527     */ 
    463     public void routeMessage(CADRoutedMessage newMessage) { 
    464          
     528    public void routeMessage(CADRoutedMessage newMessage) 
     529    { 
     530 
    465531        //if this is an incidentUpdate 
    466532        /* 
    467533         * TODO  Is this a priority?? 
    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              
     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 
    485551        notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, 
    486552                newMessage)); 
    487553 
    488     }    
    489     
    490   
    491     public TreeSet<String> getCMSIDs() throws RemoteException {      
     554    } 
     555 
     556    public TreeSet<String> getCMSIDs() throws RemoteException 
     557    { 
    492558        return new TreeSet<String>(CMSDiversionDB.getInstance().getAllDiversions().keySet()); 
    493559    } 
    494      
    495     public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException {         
     560 
     561    public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException 
     562    { 
    496563        return CMSDiversionDB.getInstance().getDiversion(theCMSID); 
    497     }     
    498      
    499     public void applyDiversions(CMSInfo theDiversion) throws RemoteException { 
     564    } 
     565 
     566    public void applyDiversions(CMSInfo theDiversion) throws RemoteException 
     567    { 
    500568        CMSDiversionDB.getInstance().updateDiversions(theDiversion); 
    501569        CADSimulator.theParamicsSimMgr.updateDiversion(theDiversion); 
    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      *  
     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     * 
    510578     * @param update IncidentInquiryModel_obj containing CAD line update 
    511579     * @see IncidentManager 
    512580     */ 
    513     public void commandLineUpdate(IncidentInquiryModel_obj modelInfo) { 
    514                  
     581    public void commandLineUpdate(IncidentInquiryModel_obj modelInfo) 
     582    { 
     583 
    515584        long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
    516          
     585 
    517586        IncidentEvent triggeredEvent = new IncidentEvent(currentSimTime); 
    518         triggeredEvent.eventInfo     = modelInfo; 
    519          
     587        triggeredEvent.eventInfo = modelInfo; 
     588 
    520589        triggeredEvent.finalizeEvent(currentSimTime, CADSimulator.getCADTime()); 
    521590 
    522         CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent);  
    523          
     591        CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 
     592 
    524593        updateIncidentInGUI(modelInfo.getLogNumber(), triggeredEvent); 
    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  
     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 
    533601     * ParamicsControlManager to send an IncidentUpdate. 
    534      *  
     602     * 
    535603     * @see SimulationControlManager 
    536604     * @see ParamicsControlManager 
    537605     * @see IncidentManager 
    538606     */ 
    539     public void tick() { 
    540         if(CADSimulator.theSimulationCntrlMgr.simulationStarted()) { 
    541              
     607    public void tick() 
     608    { 
     609        if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
     610        { 
     611 
    542612            final long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
    543              
    544             Runnable timeRun = new Runnable() { 
    545              
    546                 public void run() { 
     613 
     614            Runnable timeRun = new Runnable() 
     615            { 
     616                public void run() 
     617                { 
    547618                    CADSimulator.theViewer.setTime(currentSimTime); 
    548                      
     619 
    549620                    //send an update every 30 seconds 
    550                     if(currentSimTime % 30 == 0) 
     621                    if (currentSimTime % 30 == 0) 
     622                    { 
    551623                        CADSimulator.theParamicsSimMgr.sendIncidentUpdate(currentSimTime); 
    552                      
    553                     if(managerInt != null) { 
    554                         try { 
     624                    } 
     625 
     626                    if (managerInt != null) 
     627                    { 
     628                        try 
     629                        { 
    555630                            managerInt.tick(currentSimTime); 
    556                         } 
    557                         catch (RemoteException re) { 
     631                        } catch (RemoteException re) 
     632                        { 
    558633                            //Simulation Manager has disappeared 
    559634                            managerInt = null; 
    560635                            CADSimulator.theViewer.setSimManagerStatus(false); 
    561636 
    562                             coorLogger.logp(Level.SEVERE, "Coordinator", "tick:run",  
     637                            coorLogger.logp(Level.SEVERE, "Coordinator", "tick:run", 
    563638                                    "Connection to Simulation Manager has been dropped.", re); 
    564639                        } 
    565640                    } 
    566                      
     641 
    567642                    CADSimulator.theIncidentMgr.tick(currentSimTime); 
    568                 }            
     643                } 
    569644            }; 
    570              
     645 
    571646            Thread timeThread = new Thread(timeRun); 
    572             timeThread.start();                      
    573         } 
    574     }    
    575      
     647            timeThread.start(); 
     648        } 
     649    } 
    576650 
    577651    /** 
    578652     * Method notifies observers with an IncidentSummaryModel_obj to signify 
    579      * that a new Incident has started.  Then spawn a thread to notify the 
     653     * that a new Incident has started. Then spawn a thread to notify the 
    580654     * SimulationManager with the Incident's log number has started. 
    581      *  
     655     * 
    582656     * @param completedEvent Completed IncidentEvent. 
    583657     */ 
    584     public void incidentStarted(final IncidentEvent completedEvent) { 
     658    public void incidentStarted(final IncidentEvent completedEvent) 
     659    { 
    585660        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_SUMMARY, 
    586                 new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader())));     
    587          
     661                new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader()))); 
     662 
    588663        incidentStartedInGUI(completedEvent.eventInfo.getLogNumber()); 
    589          
    590         Runnable startRun = new Runnable() {                             
    591             public void run() { 
    592                 if(managerInt != null) { 
    593                     try {                            
     664 
     665        Runnable startRun = new Runnable() 
     666        { 
     667            public void run() 
     668            { 
     669                if (managerInt != null) 
     670                { 
     671                    try 
     672                    { 
    594673                        managerInt.incidentStarted(completedEvent.eventInfo.getLogNumber()); 
    595                     } 
    596                     catch (RemoteException re) { 
     674                    } catch (RemoteException re) 
     675                    { 
    597676                        //Simulation Manager has disappeared 
    598677                        managerInt = null; 
    599678                        CADSimulator.theViewer.setSimManagerStatus(false); 
    600679 
    601                         coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents",  
     680                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents", 
    602681                                "Connection to Simulation Manager has been dropped.", re); 
    603                     }                        
    604                 }                    
    605             }                    
    606         };       
    607          
     682                    } 
     683                } 
     684            } 
     685        }; 
     686 
    608687        Thread startThread = new Thread(startRun); 
    609688        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      *  
     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     * 
    620699     * @param completedEvent Completed IncidentEvent. 
    621700     * @see ParamicsControlManager 
    622701     * @see MediaManager 
    623702     */ 
    624     public void incidentUpdated(final IncidentEvent completedEvent) { 
     703    public void incidentUpdated(final IncidentEvent completedEvent) 
     704    { 
    625705        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_INQUIRY, 
    626                 completedEvent.eventInfo));      
    627          
    628         for(XMLIncident xmlInc : completedEvent.XMLIncidents) 
     706                completedEvent.eventInfo)); 
     707 
     708        for (XMLIncident xmlInc : completedEvent.XMLIncidents) 
     709        { 
    629710            CADSimulator.theParamicsSimMgr.updateIncident(xmlInc); 
    630  
    631          
     711        } 
     712 
     713 
    632714        /*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 { 
     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                    { 
    641727                        managerInt.eventOccured( 
    642                                 completedEvent.eventInfo.getLogNumber(),  
     728                                completedEvent.eventInfo.getLogNumber(), 
    643729                                completedEvent); 
    644                     } 
    645                     catch (RemoteException re) { 
     730                    } catch (RemoteException re) 
     731                    { 
    646732                        //Simulation Manager has disappeared 
    647733                        managerInt = null; 
    648734                        CADSimulator.theViewer.setSimManagerStatus(false); 
    649735 
    650                         coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents:run",  
     736                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents:run", 
    651737                                "Connection to Simulation Manager has been dropped.", re); 
    652                     }                    
     738                    } 
    653739                } 
    654740            } 
     
    656742 
    657743        Thread displayThread = new Thread(displayRun); 
    658         displayThread.start();         
    659     }       
    660      
     744        displayThread.start(); 
     745    } 
     746 
    661747    /** 
    662748     * @see IncidentManager 
    663749     */ 
    664     public boolean incidentExists(Integer logNumber) { 
     750    public boolean incidentExists(Integer logNumber) 
     751    { 
    665752        return CADSimulator.theIncidentMgr.incidentExists(logNumber); 
    666753    } 
     
    669756     * @see IncidentManager 
    670757     */ 
    671     public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() { 
     758    public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() 
     759    { 
    672760        return CADSimulator.theIncidentMgr.getIncidentBoardModelObjects(); 
    673     }        
     761    } 
    674762 
    675763    /** 
    676764     * @see IncidentManager 
    677765     */ 
    678     public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) { 
     766    public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) 
     767    { 
    679768        return CADSimulator.theIncidentMgr.getIncidentInquiryModelObjects(logNumber); 
    680     }     
     769    } 
    681770 
    682771    /** 
    683772     * @see IncidentManager 
    684773     */ 
    685     public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() { 
     774    public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() 
     775    { 
    686776        return CADSimulator.theIncidentMgr.getIncidentSummaryModelObjects(); 
    687     }      
    688      
    689    
     777    } 
     778 
    690779    /** 
    691780     * Adds an observer to the list of observers. 
     
    693782     * @param o New observer object. 
    694783     */ 
    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.  
     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. 
    703793     * 
    704794     * @param o Observer to be removed. 
    705795     * @returns True if remove was successful, false if not. 
    706      */      
    707     public boolean removeObserver(Observer o) { 
     796     */ 
     797    public boolean removeObserver(Observer o) 
     798    { 
    708799        return observerList.remove(o); 
    709800    } 
    710      
    711     /** 
    712      * Notify all registered observers with the parameter ObserverMessage object. 
     801 
     802    /** 
     803     * Notify all registered observers with the parameter ObserverMessage 
     804     * object. 
    713805     * 
    714806     * @param newMsg The ObserverMessage to be sent. 
    715807     */ 
    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++){ 
     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        { 
    723820            clientList.get(i).refresh(); 
    724821        } 
    725822    } 
    726      
     823 
    727824    /** 
    728825     * Checks the CADData for an existing incident with id 
     826     * 
    729827     * @param id the incident id 
    730828     * @return true if CADData contains such an incident, otherwise false. 
    731829     * @throws RemoteException 
    732830     */ 
    733      public boolean checkForValidIncidentID(int id) throws RemoteException{ 
     831    public boolean checkForValidIncidentID(int id) throws RemoteException 
     832    { 
    734833        return cadData.checkForValidId(id); 
    735      } 
    736      
    737       
    738      /** 
     834    } 
     835 
     836    /** 
    739837     * Uses an Incident's masterInc to lookup its ID. 
     838     * 
    740839     * @param masterInc the Incident to look up 
    741840     * @return the same Incident's ID, -1 if invalid masterInc 
    742841     * @throws RemoteException 
    743842     */ 
    744      public int getIncidentId(String masterInc) throws RemoteException{ 
    745          return cadData.getIncidentId(masterInc); 
    746      } 
    747      
     843    public int getIncidentId(String masterInc) throws RemoteException 
     844    { 
     845        return cadData.getIncidentId(masterInc); 
     846    } 
     847 
    748848    /** 
    749849     * Returns a table model out of CADData based on tag. 
    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)){ 
     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        { 
    755858            return cadData.tableForAssignedIncidents(); 
    756         } 
    757         else if(tag.equals(TABLE.UNIT_STATUS)){ 
     859        } else if (tag.equals(TABLE.UNIT_STATUS)) 
     860        { 
    758861            return cadData.tableForUnitStatus(); 
    759         } 
    760         else if(tag.equals(TABLE.PENDING_INCIDENTS)){ 
     862        } else if (tag.equals(TABLE.PENDING_INCIDENTS)) 
     863        { 
    761864            return cadData.tableForPendingIncidents(); 
    762         } 
    763         else if(tag.equals(TABLE.INCIDENT_EDITOR)){ 
     865        } else if (tag.equals(TABLE.INCIDENT_EDITOR)) 
     866        { 
    764867            return cadData.tableForIncidentEditor(); 
    765         } 
    766         else{ 
     868        } else 
     869        { 
    767870            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataTable"); 
    768871        } 
    769872    } 
    770      
     873 
    771874    /** 
    772875     * Returns the specified incident's table based on the tag. 
     876     * 
    773877     * @param tag a CADDataEnums tag 
    774878     * @param incidentId the incident's ID to look up 
     
    776880     * @throws RemoteException 
    777881     */ 
    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      
     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 
    785891    /** 
    786892     * Adds a row of data to a specified incident's table based on the tag. 
     893     * 
    787894     * @param tag a CADDataEnums tag 
    788895     * @param incidentId the incident's ID to look up 
     
    790897     * @throws RemoteException 
    791898     */ 
    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      
     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 
    798907    /** 
    799908     * Adds a row to the specified data table based on the incoming fields. 
    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       
     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 
    810918    /** 
    811919     * Returns an object out of Incident based on tag. 
    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)){ 
     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        { 
    818929            return cadData.getIncident(incidentId).getLogNum(); 
    819         } 
    820         else if(tag.equals(INC_VAL.MASTER_INC)){ 
     930        } else if (tag.equals(INC_VAL.MASTER_INC)) 
     931        { 
    821932            return cadData.getIncident(incidentId).getMasterInc(); 
    822         } 
    823         else if(tag.equals(INC_VAL.OAU)){ 
     933        } else if (tag.equals(INC_VAL.OAU)) 
     934        { 
    824935            return cadData.getIncident(incidentId).getOau(); 
    825         } 
    826         else if(tag.equals(INC_VAL.P)){ 
     936        } else if (tag.equals(INC_VAL.P)) 
     937        { 
    827938            return cadData.getIncident(incidentId).getP(); 
    828         } 
    829         else if(tag.equals(INC_VAL.DESCRIPTION)){ 
     939        } else if (tag.equals(INC_VAL.DESCRIPTION)) 
     940        { 
    830941            return cadData.getIncident(incidentId).getDescription(); 
    831         } 
    832         else if(tag.equals(INC_VAL.RP)){ 
     942        } else if (tag.equals(INC_VAL.RP)) 
     943        { 
    833944            return cadData.getIncident(incidentId).getRp(); 
    834         } 
    835         else if(tag.equals(INC_VAL.RP_TYPE)){ 
     945        } else if (tag.equals(INC_VAL.RP_TYPE)) 
     946        { 
    836947            return cadData.getIncident(incidentId).getRpType(); 
    837         } 
    838         else if(tag.equals(INC_VAL.ALI)){ 
     948        } else if (tag.equals(INC_VAL.ALI)) 
     949        { 
    839950            return cadData.getIncident(incidentId).getAli(); 
    840         } 
    841         else if(tag.equals(INC_VAL.MEDIA)){ 
     951        } else if (tag.equals(INC_VAL.MEDIA)) 
     952        { 
    842953            return cadData.getIncident(incidentId).getMedia(); 
    843         } 
    844         else{ 
     954        } else 
     955        { 
    845956            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncVal"); 
    846957        } 
    847958    } 
    848      
     959 
    849960    /** 
    850961     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    857971            cadData.getIncident(incidentId).setOau(value); 
    858         } 
    859         else if(tag.equals(INC_VAL.P)){ 
     972        } else if (tag.equals(INC_VAL.P)) 
     973        { 
    860974            cadData.getIncident(incidentId).setP(value); 
    861         } 
    862         else if(tag.equals(INC_VAL.DESCRIPTION)){ 
     975        } else if (tag.equals(INC_VAL.DESCRIPTION)) 
     976        { 
    863977            cadData.getIncident(incidentId).setDescription(value); 
    864         } 
    865         else if(tag.equals(INC_VAL.RP)){ 
     978        } else if (tag.equals(INC_VAL.RP)) 
     979        { 
    866980            cadData.getIncident(incidentId).setRp(value); 
    867         } 
    868         else if(tag.equals(INC_VAL.RP_TYPE)){ 
     981        } else if (tag.equals(INC_VAL.RP_TYPE)) 
     982        { 
    869983            cadData.getIncident(incidentId).setRpType(value); 
    870         } 
    871         else if(tag.equals(INC_VAL.ALI)){ 
     984        } else if (tag.equals(INC_VAL.ALI)) 
     985        { 
    872986            cadData.getIncident(incidentId).setAli(value); 
    873         } 
    874         else if(tag.equals(INC_VAL.MEDIA)){ 
     987        } else if (tag.equals(INC_VAL.MEDIA)) 
     988        { 
    875989            cadData.getIncident(incidentId).setMedia(value); 
    876         } 
    877         else{ 
     990        } else 
     991        { 
    878992            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncVal"); 
    879993        } 
    880994    } 
    881      
    882995 
    883996    /** 
    884997     * Returns a string out of IncidentLocation based on tag. 
    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)){ 
     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        { 
    8911007            return cadData.getIncident(incidentId).getIncidentLocation().getAddress(); 
    892         } 
    893         else if(tag.equals(INC_LOC.LOC)){ 
     1008        } else if (tag.equals(INC_LOC.LOC)) 
     1009        { 
    8941010            return cadData.getIncident(incidentId).getIncidentLocation().getLoc(); 
    895         } 
    896         else if(tag.equals(INC_LOC.CITY)){ 
     1011        } else if (tag.equals(INC_LOC.CITY)) 
     1012        { 
    8971013            return cadData.getIncident(incidentId).getIncidentLocation().getCity(); 
    898         } 
    899         else if(tag.equals(INC_LOC.COUNTY)){ 
     1014        } else if (tag.equals(INC_LOC.COUNTY)) 
     1015        { 
    9001016            return cadData.getIncident(incidentId).getIncidentLocation().getCounty(); 
    901         } 
    902         else if(tag.equals(INC_LOC.STATE)){ 
     1017        } else if (tag.equals(INC_LOC.STATE)) 
     1018        { 
    9031019            return cadData.getIncident(incidentId).getIncidentLocation().getState(); 
    904         } 
    905         else if(tag.equals(INC_LOC.ZIP)){ 
     1020        } else if (tag.equals(INC_LOC.ZIP)) 
     1021        { 
    9061022            return cadData.getIncident(incidentId).getIncidentLocation().getZip(); 
    907         } 
    908         else if(tag.equals(INC_LOC.BEAT)){ 
     1023        } else if (tag.equals(INC_LOC.BEAT)) 
     1024        { 
    9091025            return cadData.getIncident(incidentId).getIncidentLocation().getBeat(); 
    910         } 
    911         else if(tag.equals(INC_LOC.AREA)){ 
     1026        } else if (tag.equals(INC_LOC.AREA)) 
     1027        { 
    9121028            return cadData.getIncident(incidentId).getIncidentLocation().getArea(); 
    913         } 
    914         else if(tag.equals(INC_LOC.SECTOR)){ 
     1029        } else if (tag.equals(INC_LOC.SECTOR)) 
     1030        { 
    9151031            return cadData.getIncident(incidentId).getIncidentLocation().getSector(); 
    916         } 
    917         else if(tag.equals(INC_LOC.SECTOR_CODE)){ 
     1032        } else if (tag.equals(INC_LOC.SECTOR_CODE)) 
     1033        { 
    9181034            return cadData.getIncident(incidentId).getIncidentLocation().getSectorCode(); 
    919         } 
    920         else if(tag.equals(INC_LOC.DIVISION)){ 
     1035        } else if (tag.equals(INC_LOC.DIVISION)) 
     1036        { 
    9211037            return cadData.getIncident(incidentId).getIncidentLocation().getDivision(); 
    922         } 
    923         else if(tag.equals(INC_LOC.APT)){ 
     1038        } else if (tag.equals(INC_LOC.APT)) 
     1039        { 
    9241040            return cadData.getIncident(incidentId).getIncidentLocation().getApt(); 
    925         } 
    926         else if(tag.equals(INC_LOC.BUILDING)){ 
     1041        } else if (tag.equals(INC_LOC.BUILDING)) 
     1042        { 
    9271043            return cadData.getIncident(incidentId).getIncidentLocation().getBuilding(); 
    928         } 
    929         else if(tag.equals(INC_LOC.CROSS_ST)){ 
     1044        } else if (tag.equals(INC_LOC.CROSS_ST)) 
     1045        { 
    9301046            return cadData.getIncident(incidentId).getIncidentLocation().getCrossSt(); 
    931         } 
    932         else if(tag.equals(INC_LOC.LAW)){ 
     1047        } else if (tag.equals(INC_LOC.LAW)) 
     1048        { 
    9331049            return cadData.getIncident(incidentId).getIncidentLocation().getLaw(); 
    934         } 
    935         else if(tag.equals(INC_LOC.FIRE)){ 
     1050        } else if (tag.equals(INC_LOC.FIRE)) 
     1051        { 
    9361052            return cadData.getIncident(incidentId).getIncidentLocation().getFire(); 
    937         } 
    938         else if(tag.equals(INC_LOC.EMS)){ 
     1053        } else if (tag.equals(INC_LOC.EMS)) 
     1054        { 
    9391055            return cadData.getIncident(incidentId).getIncidentLocation().getEms(); 
    940         } 
    941         else{ 
     1056        } else 
     1057        { 
    9421058            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncLoc"); 
    9431059        } 
     
    9461062    /** 
    9471063     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    9541073            cadData.getIncident(incidentId).getIncidentLocation().setAddress(value); 
    955         } 
    956         else if(tag.equals(INC_LOC.LOC)){ 
     1074        } else if (tag.equals(INC_LOC.LOC)) 
     1075        { 
    9571076            cadData.getIncident(incidentId).getIncidentLocation().setLoc(value); 
    958         } 
    959         else if(tag.equals(INC_LOC.CITY)){ 
     1077        } else if (tag.equals(INC_LOC.CITY)) 
     1078        { 
    9601079            cadData.getIncident(incidentId).getIncidentLocation().setCity(value); 
    961         } 
    962         else if(tag.equals(INC_LOC.COUNTY)){ 
     1080        } else if (tag.equals(INC_LOC.COUNTY)) 
     1081        { 
    9631082            cadData.getIncident(incidentId).getIncidentLocation().setCounty(value); 
    964         } 
    965         else if(tag.equals(INC_LOC.STATE)){ 
     1083        } else if (tag.equals(INC_LOC.STATE)) 
     1084        { 
    9661085            cadData.getIncident(incidentId).getIncidentLocation().setState(value); 
    967         } 
    968         else if(tag.equals(INC_LOC.ZIP)){ 
     1086        } else if (tag.equals(INC_LOC.ZIP)) 
     1087        { 
    9691088            cadData.getIncident(incidentId).getIncidentLocation().setZip(value); 
    970         } 
    971         else if(tag.equals(INC_LOC.BEAT)){ 
     1089        } else if (tag.equals(INC_LOC.BEAT)) 
     1090        { 
    9721091            cadData.getIncident(incidentId).getIncidentLocation().setBeat(value); 
    973         } 
    974         else if(tag.equals(INC_LOC.AREA)){ 
     1092        } else if (tag.equals(INC_LOC.AREA)) 
     1093        { 
    9751094            cadData.getIncident(incidentId).getIncidentLocation().setArea(value); 
    976         } 
    977         else if(tag.equals(INC_LOC.SECTOR)){ 
     1095        } else if (tag.equals(INC_LOC.SECTOR)) 
     1096        { 
    9781097            cadData.getIncident(incidentId).getIncidentLocation().setSector(value); 
    979         } 
    980         else if(tag.equals(INC_LOC.SECTOR_CODE)){ 
     1098        } else if (tag.equals(INC_LOC.SECTOR_CODE)) 
     1099        { 
    9811100            cadData.getIncident(incidentId).getIncidentLocation().setSectorCode(value); 
    982         } 
    983         else if(tag.equals(INC_LOC.DIVISION)){ 
     1101        } else if (tag.equals(INC_LOC.DIVISION)) 
     1102        { 
    9841103            cadData.getIncident(incidentId).getIncidentLocation().setDivision(value); 
    985         } 
    986         else if(tag.equals(INC_LOC.APT)){ 
     1104        } else if (tag.equals(INC_LOC.APT)) 
     1105        { 
    9871106            cadData.getIncident(incidentId).getIncidentLocation().setApt(value); 
    988         } 
    989         else if(tag.equals(INC_LOC.BUILDING)){ 
     1107        } else if (tag.equals(INC_LOC.BUILDING)) 
     1108        { 
    9901109            cadData.getIncident(incidentId).getIncidentLocation().setBuilding(value); 
    991         } 
    992         else if(tag.equals(INC_LOC.CROSS_ST)){ 
     1110        } else if (tag.equals(INC_LOC.CROSS_ST)) 
     1111        { 
    9931112            cadData.getIncident(incidentId).getIncidentLocation().setCrossSt(value); 
    994         } 
    995         else if(tag.equals(INC_LOC.LAW)){ 
     1113        } else if (tag.equals(INC_LOC.LAW)) 
     1114        { 
    9961115            cadData.getIncident(incidentId).getIncidentLocation().setLaw(value); 
    997         } 
    998         else if(tag.equals(INC_LOC.FIRE)){ 
     1116        } else if (tag.equals(INC_LOC.FIRE)) 
     1117        { 
    9991118            cadData.getIncident(incidentId).getIncidentLocation().setFire(value); 
    1000         } 
    1001         else if(tag.equals(INC_LOC.EMS)){ 
     1119        } else if (tag.equals(INC_LOC.EMS)) 
     1120        { 
    10021121            cadData.getIncident(incidentId).getIncidentLocation().setEms(value); 
    1003         } 
    1004         else{ 
     1122        } else 
     1123        { 
    10051124            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncLoc"); 
    10061125        } 
    10071126    } 
    1008      
     1127 
    10091128    /** 
    10101129     * Returns a string out of IncidentCaller based on tag. 
    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)){ 
     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        { 
    10171139            return cadData.getIncident(incidentId).getIncidentCaller().getCallerType(); 
    1018         } 
    1019         else if(tag.equals(INC_CALLER.NAME)){ 
     1140        } else if (tag.equals(INC_CALLER.NAME)) 
     1141        { 
    10201142            return cadData.getIncident(incidentId).getIncidentCaller().getCallerName(); 
    1021         } 
    1022         else if(tag.equals(INC_CALLER.PHONE)){ 
     1143        } else if (tag.equals(INC_CALLER.PHONE)) 
     1144        { 
    10231145            return cadData.getIncident(incidentId).getIncidentCaller().getPhone(); 
    1024         } 
    1025         else if(tag.equals(INC_CALLER.EXT)){ 
     1146        } else if (tag.equals(INC_CALLER.EXT)) 
     1147        { 
    10261148            return cadData.getIncident(incidentId).getIncidentCaller().getExt(); 
    1027         } 
    1028         else{ 
     1149        } else 
     1150        { 
    10291151            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCaller"); 
    10301152        } 
     
    10331155    /** 
    10341156     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    10411166            cadData.getIncident(incidentId).getIncidentCaller().setCallerType(value); 
    1042         } 
    1043         else if(tag.equals(INC_CALLER.NAME)){ 
     1167        } else if (tag.equals(INC_CALLER.NAME)) 
     1168        { 
    10441169            cadData.getIncident(incidentId).getIncidentCaller().setCallerName(value); 
    1045         } 
    1046         else if(tag.equals(INC_CALLER.PHONE)){ 
     1170        } else if (tag.equals(INC_CALLER.PHONE)) 
     1171        { 
    10471172            cadData.getIncident(incidentId).getIncidentCaller().setPhone(value); 
    1048         } 
    1049         else if(tag.equals(INC_CALLER.EXT)){ 
     1173        } else if (tag.equals(INC_CALLER.EXT)) 
     1174        { 
    10501175            cadData.getIncident(incidentId).getIncidentCaller().setExt(value); 
    1051         } 
    1052         else{ 
     1176        } else 
     1177        { 
    10531178            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncCaller"); 
    10541179        } 
    10551180    } 
    1056      
     1181 
    10571182    /** 
    10581183     * Returns a string out of IncidentProblem based on tag. 
    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)){ 
     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        { 
    10651193            return cadData.getIncident(incidentId).getProblem().getProblem(); 
    1066         } 
    1067         else if(tag.equals(INC_PROBLEM.CODE)){ 
     1194        } else if (tag.equals(INC_PROBLEM.CODE)) 
     1195        { 
    10681196            return cadData.getIncident(incidentId).getProblem().getProblemCode(); 
    1069         } 
    1070         else if(tag.equals(INC_PROBLEM.PRIORITY)){ 
     1197        } else if (tag.equals(INC_PROBLEM.PRIORITY)) 
     1198        { 
    10711199            return cadData.getIncident(incidentId).getProblem().getPriority(); 
    1072         } 
    1073         else{ 
     1200        } else 
     1201        { 
    10741202            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncProblem"); 
    10751203        } 
    10761204    } 
    1077      
     1205 
    10781206    /** 
    10791207     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    10861217            cadData.getIncident(incidentId).getProblem().setProblem(value); 
    1087         } 
    1088         else if(tag.equals(INC_PROBLEM.CODE)){ 
     1218        } else if (tag.equals(INC_PROBLEM.CODE)) 
     1219        { 
    10891220            cadData.getIncident(incidentId).getProblem().setProblemCode(value); 
    1090         } 
    1091         else if(tag.equals(INC_PROBLEM.PRIORITY)){ 
     1221        } else if (tag.equals(INC_PROBLEM.PRIORITY)) 
     1222        { 
    10921223            cadData.getIncident(incidentId).getProblem().setPriority(value); 
    1093         } 
    1094         else{ 
     1224        } else 
     1225        { 
    10951226            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncProblem"); 
    10961227        } 
     
    10991230    /** 
    11001231     * Returns a string out of IncidentGeneralInfo based on tag. 
    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)){ 
     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        { 
    11071241            return cadData.getIncident(incidentId).getGenInfo().getJurisdiction(); 
    1108         } 
    1109         else if(tag.equals(INC_GEN_INFO.ALARM)){ 
     1242        } else if (tag.equals(INC_GEN_INFO.ALARM)) 
     1243        { 
    11101244            return cadData.getIncident(incidentId).getGenInfo().getAlarm(); 
    1111         } 
    1112         else if(tag.equals(INC_GEN_INFO.AGY)){ 
     1245        } else if (tag.equals(INC_GEN_INFO.AGY)) 
     1246        { 
    11131247            return cadData.getIncident(incidentId).getGenInfo().getAgy(); 
    1114         } 
    1115         else{ 
     1248        } else 
     1249        { 
    11161250            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncGenInfo"); 
    11171251        } 
     
    11201254    /** 
    11211255     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    11281265            cadData.getIncident(incidentId).getGenInfo().setJurisdiction(value); 
    1129         } 
    1130         else if(tag.equals(INC_GEN_INFO.ALARM)){ 
     1266        } else if (tag.equals(INC_GEN_INFO.ALARM)) 
     1267        { 
    11311268            cadData.getIncident(incidentId).getGenInfo().setAlarm(value); 
    1132         } 
    1133         else if(tag.equals(INC_GEN_INFO.AGY)){ 
     1269        } else if (tag.equals(INC_GEN_INFO.AGY)) 
     1270        { 
    11341271            cadData.getIncident(incidentId).getGenInfo().setAgy(value); 
    1135         } 
    1136         else{ 
     1272        } else 
     1273        { 
    11371274            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncGenInfo"); 
    11381275        } 
    11391276    } 
    1140      
     1277 
    11411278    /** 
    11421279     * Returns a string out of IncidentResponse based on tag. 
    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)){ 
     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        { 
    11491289            return cadData.getIncident(incidentId).getResponse().getPlan(); 
    1150         } 
    1151         else if(tag.equals(INC_RESP.AREA)){ 
     1290        } else if (tag.equals(INC_RESP.AREA)) 
     1291        { 
    11521292            return cadData.getIncident(incidentId).getResponse().getArea(); 
    1153         } 
    1154         else{ 
     1293        } else 
     1294        { 
    11551295            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncResp"); 
    11561296        } 
    11571297    } 
    1158      
     1298 
    11591299    /** 
    11601300     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    11671310            cadData.getIncident(incidentId).getResponse().setPlan(value); 
    1168         } 
    1169         else if(tag.equals(INC_RESP.AREA)){ 
     1311        } else if (tag.equals(INC_RESP.AREA)) 
     1312        { 
    11701313            cadData.getIncident(incidentId).getResponse().setArea(value); 
    1171         } 
    1172         else{ 
     1314        } else 
     1315        { 
    11731316            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncResp"); 
    11741317        } 
     
    11771320    /** 
    11781321     * Returns a string out of IncidentAdditionalInfo based on tag. 
    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)){ 
     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        { 
    11851331            return cadData.getIncident(incidentId).getAdditionalInfo().getType(); 
    1186         } 
    1187         else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){ 
     1332        } else if (tag.equals(INC_ADD_INFO.TYPE_CODE)) 
     1333        { 
    11881334            return cadData.getIncident(incidentId).getAdditionalInfo().getTypeCode(); 
    1189         } 
    1190         else if(tag.equals(INC_ADD_INFO.MACHINE)){ 
     1335        } else if (tag.equals(INC_ADD_INFO.MACHINE)) 
     1336        { 
    11911337            return cadData.getIncident(incidentId).getAdditionalInfo().getMachine(); 
    1192         } 
    1193         else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){ 
     1338        } else if (tag.equals(INC_ADD_INFO.CALL_STATUS)) 
     1339        { 
    11941340            return cadData.getIncident(incidentId).getAdditionalInfo().getCallStatus(); 
    1195         } 
    1196         else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){ 
     1341        } else if (tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)) 
     1342        { 
    11971343            return cadData.getIncident(incidentId).getAdditionalInfo().getCallTakerExt(); 
    1198         } 
    1199         else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){ 
     1344        } else if (tag.equals(INC_ADD_INFO.ALARM_LEVEL)) 
     1345        { 
    12001346            return cadData.getIncident(incidentId).getAdditionalInfo().getAlarmLevel(); 
    1201         } 
    1202         else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){ 
     1347        } else if (tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)) 
     1348        { 
    12031349            return cadData.getIncident(incidentId).getAdditionalInfo().getRotationProviderArea(); 
    1204         } 
    1205         else if(tag.equals(INC_ADD_INFO.COMMENT)){ 
     1350        } else if (tag.equals(INC_ADD_INFO.COMMENT)) 
     1351        { 
    12061352            return cadData.getIncident(incidentId).getAdditionalInfo().getComment(); 
    1207         } 
    1208         else{ 
     1353        } else 
     1354        { 
    12091355            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncAddInfo"); 
    12101356        } 
     
    12131359    /** 
    12141360     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    12211370            cadData.getIncident(incidentId).getAdditionalInfo().setType(value); 
    1222         } 
    1223         else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){ 
     1371        } else if (tag.equals(INC_ADD_INFO.TYPE_CODE)) 
     1372        { 
    12241373            cadData.getIncident(incidentId).getAdditionalInfo().setTypeCode(value); 
    1225         } 
    1226         else if(tag.equals(INC_ADD_INFO.MACHINE)){ 
     1374        } else if (tag.equals(INC_ADD_INFO.MACHINE)) 
     1375        { 
    12271376            cadData.getIncident(incidentId).getAdditionalInfo().setMachine(value); 
    1228         } 
    1229         else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){ 
     1377        } else if (tag.equals(INC_ADD_INFO.CALL_STATUS)) 
     1378        { 
    12301379            cadData.getIncident(incidentId).getAdditionalInfo().setCallStatus(value); 
    1231         } 
    1232         else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){ 
     1380        } else if (tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)) 
     1381        { 
    12331382            cadData.getIncident(incidentId).getAdditionalInfo().setCallTakerExt(value); 
    1234         } 
    1235         else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){ 
     1383        } else if (tag.equals(INC_ADD_INFO.ALARM_LEVEL)) 
     1384        { 
    12361385            cadData.getIncident(incidentId).getAdditionalInfo().setAlarmLevel(value); 
    1237         } 
    1238         else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){ 
     1386        } else if (tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)) 
     1387        { 
    12391388            cadData.getIncident(incidentId).getAdditionalInfo().setRotationProviderArea(value); 
    1240         } 
    1241         else if(tag.equals(INC_ADD_INFO.COMMENT)){ 
     1389        } else if (tag.equals(INC_ADD_INFO.COMMENT)) 
     1390        { 
    12421391            cadData.getIncident(incidentId).getAdditionalInfo().setComment(value); 
    1243         } 
    1244         else{ 
     1392        } else 
     1393        { 
    12451394            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncAddInfo"); 
    12461395        } 
    12471396    } 
    1248      
     1397 
    12491398    /** 
    12501399     * Returns a string out of IncidentActivities based on tag. 
    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)){ 
     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        { 
    12571409            return cadData.getIncident(incidentId).getActivities().getVehicle(); 
    1258         } 
    1259         else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){ 
     1410        } else if (tag.equals(INC_ACTIVITIES.ACTIVITY)) 
     1411        { 
    12601412            return cadData.getIncident(incidentId).getActivities().getActivity(); 
    1261         } 
    1262         else if(tag.equals(INC_ACTIVITIES.LOCATION)){ 
     1413        } else if (tag.equals(INC_ACTIVITIES.LOCATION)) 
     1414        { 
    12631415            return cadData.getIncident(incidentId).getActivities().getLocation(); 
    1264         } 
    1265         else if(tag.equals(INC_ACTIVITIES.COMMENT)){ 
     1416        } else if (tag.equals(INC_ACTIVITIES.COMMENT)) 
     1417        { 
    12661418            return cadData.getIncident(incidentId).getActivities().getComment(); 
    1267         } 
    1268         else if(tag.equals(INC_ACTIVITIES.DISP)){ 
     1419        } else if (tag.equals(INC_ACTIVITIES.DISP)) 
     1420        { 
    12691421            return cadData.getIncident(incidentId).getActivities().getDisp(); 
    1270         } 
    1271         else{ 
     1422        } else 
     1423        { 
    12721424            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncActivities"); 
    12731425        } 
     
    12761428    /** 
    12771429     * Set incidentId's field based on tag to value. 
    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)){ 
     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        { 
    12841439            cadData.getIncident(incidentId).getActivities().setVehicle(value); 
    1285         } 
    1286         else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){ 
     1440        } else if (tag.equals(INC_ACTIVITIES.ACTIVITY)) 
     1441        { 
    12871442            cadData.getIncident(incidentId).getActivities().setActivity(value); 
    1288         } 
    1289         else if(tag.equals(INC_ACTIVITIES.LOCATION)){ 
     1443        } else if (tag.equals(INC_ACTIVITIES.LOCATION)) 
     1444        { 
    12901445            cadData.getIncident(incidentId).getActivities().setLocation(value); 
    1291         } 
    1292         else if(tag.equals(INC_ACTIVITIES.COMMENT)){ 
     1446        } else if (tag.equals(INC_ACTIVITIES.COMMENT)) 
     1447        { 
    12931448            cadData.getIncident(incidentId).getActivities().setComment(value); 
    1294         } 
    1295         else if(tag.equals(INC_ACTIVITIES.DISP)){ 
     1449        } else if (tag.equals(INC_ACTIVITIES.DISP)) 
     1450        { 
    12961451            cadData.getIncident(incidentId).getActivities().setDisp(value); 
    1297         } 
    1298         else{ 
     1452        } else 
     1453        { 
    12991454            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncActivities"); 
    13001455        } 
    13011456    } 
    1302      
     1457 
    13031458    /** 
    13041459     * Returns a string out of IncidentCallback based on tag. 
    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)){ 
     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        { 
    13111469            return cadData.getIncident(incidentId).getCallBacks().getInitial(); 
    1312         } 
    1313         else if(tag.equals(INC_CALLBACK.COMMENT)){ 
     1470        } else if (tag.equals(INC_CALLBACK.COMMENT)) 
     1471        { 
    13141472            return cadData.getIncident(incidentId).getCallBacks().getComment(); 
    1315         } 
    1316         else{ 
     1473        } else 
     1474        { 
    13171475            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCallBack"); 
    13181476        } 
     
    13211479    /** 
    13221480     * Returns a string out of IncidentEditLog based on tag. 
    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)){ 
     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        { 
    13291490            return cadData.getIncident(incidentId).getEditLog().getEdit(); 
    1330         } 
    1331         else if(tag.equals(INC_EDIT_LOG.REASON)){ 
     1491        } else if (tag.equals(INC_EDIT_LOG.REASON)) 
     1492        { 
    13321493            return cadData.getIncident(incidentId).getEditLog().getReason(); 
    1333         } 
    1334         else if(tag.equals(INC_EDIT_LOG.CHANGE_BY)){ 
     1494        } else if (tag.equals(INC_EDIT_LOG.CHANGE_BY)) 
     1495        { 
    13351496            return cadData.getIncident(incidentId).getEditLog().getChangeBy(); 
    1336         } 
    1337         else if(tag.equals(INC_EDIT_LOG.TERMINAL)){ 
     1497        } else if (tag.equals(INC_EDIT_LOG.TERMINAL)) 
     1498        { 
    13381499            return cadData.getIncident(incidentId).getEditLog().getTerminal(); 
    1339         } 
    1340         else{ 
     1500        } else 
     1501        { 
    13411502            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncEditLog"); 
    13421503        } 
     
    13451506    /** 
    13461507     * Returns a string out of IncidentInfo based on tag. 
    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)){ 
     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        { 
    13531517            return cadData.getIncident(incidentId).getInfo().getCallInit(); 
    1354         } 
    1355         else if(tag.equals(INC_INFO.CALL_TAKEN)){ 
     1518        } else if (tag.equals(INC_INFO.CALL_TAKEN)) 
     1519        { 
    13561520            return cadData.getIncident(incidentId).getInfo().getCallTaken(); 
    1357         } 
    1358         else if(tag.equals(INC_INFO.TIME_IN_Q)){ 
     1521        } else if (tag.equals(INC_INFO.TIME_IN_Q)) 
     1522        { 
    13591523            return cadData.getIncident(incidentId).getInfo().getTimeInQ(); 
    1360         } 
    1361         else if(tag.equals(INC_INFO.LAST_UPDATED)){ 
     1524        } else if (tag.equals(INC_INFO.LAST_UPDATED)) 
     1525        { 
    13621526            return cadData.getIncident(incidentId).getInfo().getLastUpdated(); 
    1363         } 
    1364         else{ 
     1527        } else 
     1528        { 
    13651529            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncInfo"); 
    13661530        } 
     
    13691533    /** 
    13701534     * Returns a string out of IncidentTimes based on tag. 
    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 { 
     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    { 
    13761542        // TODO Auto-generated method stub 
    13771543        return null; 
    13781544    } 
    1379      
     1545 
    13801546    /** 
    13811547     * Returns a CardfileList matching the tag. 
    13821548     */ 
    1383     public CardfileList getCardfileList(CARDFILE tag) throws RemoteException{ 
    1384         if(tag.equals(CARDFILE.COASTAL_DIVISION_UNITS)){ 
     1549    public CardfileList getCardfileList(CARDFILE tag) throws RemoteException 
     1550    { 
     1551        if (tag.equals(CARDFILE.COASTAL_DIVISION_UNITS)) 
     1552        { 
    13851553            return cardfileData.getCoastalDivisionUnitList(); 
    1386         } 
    1387         else if(tag.equals(CARDFILE.POLICE_SHERIFF_CORONER)){ 
     1554        } else if (tag.equals(CARDFILE.POLICE_SHERIFF_CORONER)) 
     1555        { 
    13881556            return cardfileData.getPoliceSheriffCoronerList(); 
    1389         } 
    1390         else if(tag.equals(CARDFILE.COURTS)){ 
     1557        } else if (tag.equals(CARDFILE.COURTS)) 
     1558        { 
    13911559            return cardfileData.getCourtsList(); 
    1392         } 
    1393         else if(tag.equals(CARDFILE.PUBLIC_TRANSPORTATION)){ 
     1560        } else if (tag.equals(CARDFILE.PUBLIC_TRANSPORTATION)) 
     1561        { 
    13941562            return cardfileData.getPublicTransportationList(); 
    1395         } 
    1396         else if(tag.equals(CARDFILE.GG_OTHER)){ 
     1563        } else if (tag.equals(CARDFILE.GG_OTHER)) 
     1564        { 
    13971565            return cardfileData.getGgOtherList(); 
    1398         } 
    1399         else if(tag.equals(CARDFILE.MY_MISC)){ 
     1566        } else if (tag.equals(CARDFILE.MY_MISC)) 
     1567        { 
    14001568            return cardfileData.getMyMiscList(); 
    1401         } 
    1402         else if(tag.equals(CARDFILE.SL_MISC)){ 
     1569        } else if (tag.equals(CARDFILE.SL_MISC)) 
     1570        { 
    14031571            return cardfileData.getSlMiscList(); 
    1404         } 
    1405         else if(tag.equals(CARDFILE.VT_MISC)){ 
     1572        } else if (tag.equals(CARDFILE.VT_MISC)) 
     1573        { 
    14061574            return cardfileData.getVlMiscList(); 
    1407         } 
    1408         else if(tag.equals(CARDFILE.CHP_OFFICES)){ 
     1575        } else if (tag.equals(CARDFILE.CHP_OFFICES)) 
     1576        { 
    14091577            return cardfileData.getChpOfficesList(); 
    1410         } 
    1411         else if(tag.equals(CARDFILE.STATE_AGENCIES_FACILITIES)){ 
     1578        } else if (tag.equals(CARDFILE.STATE_AGENCIES_FACILITIES)) 
     1579        { 
    14121580            return cardfileData.getStateAgenciesFacilitiesList(); 
    1413         } 
    1414         else if(tag.equals(CARDFILE.GOVERNMENT_OFFICIALS)){ 
     1581        } else if (tag.equals(CARDFILE.GOVERNMENT_OFFICIALS)) 
     1582        { 
    14151583            return cardfileData.getGovernmentOfficialsList(); 
    1416         } 
    1417         else if(tag.equals(CARDFILE.FEDERAL_AGENCIES)){ 
     1584        } else if (tag.equals(CARDFILE.FEDERAL_AGENCIES)) 
     1585        { 
    14181586            return cardfileData.getFederalAgenciesList(); 
    1419         } 
    1420         else if(tag.equals(CARDFILE.RANCHES_LIVESTOCK)){ 
     1587        } else if (tag.equals(CARDFILE.RANCHES_LIVESTOCK)) 
     1588        { 
    14211589            return cardfileData.getRanchesLivestockList(); 
    1422         } 
    1423         else if(tag.equals(CARDFILE.FIRE_EMS)){ 
     1590        } else if (tag.equals(CARDFILE.FIRE_EMS)) 
     1591        { 
    14241592            return cardfileData.getFireEmsList(); 
    1425         } 
    1426         else if(tag.equals(CARDFILE.JAILS)){ 
     1593        } else if (tag.equals(CARDFILE.JAILS)) 
     1594        { 
    14271595            return cardfileData.getJailsList(); 
    1428         } 
    1429         else if(tag.equals(CARDFILE.HOSPITALS_MED_CENTERS)){ 
     1596        } else if (tag.equals(CARDFILE.HOSPITALS_MED_CENTERS)) 
     1597        { 
    14301598            return cardfileData.getHospitalsMedCentersList(); 
    1431         } 
    1432         else if(tag.equals(CARDFILE.TOW_COMPANIES)){ 
     1599        } else if (tag.equals(CARDFILE.TOW_COMPANIES)) 
     1600        { 
    14331601            return cardfileData.getTowCompaniesList(); 
    1434         } 
    1435         else if(tag.equals(CARDFILE.CALTRANS)){ 
     1602        } else if (tag.equals(CARDFILE.CALTRANS)) 
     1603        { 
    14361604            return cardfileData.getCalTransList(); 
    1437         } 
    1438         else if(tag.equals(CARDFILE.COUNTY_ROADS)){ 
     1605        } else if (tag.equals(CARDFILE.COUNTY_ROADS)) 
     1606        { 
    14391607            return cardfileData.getCountyRoadsList(); 
    1440         } 
    1441         else if(tag.equals(CARDFILE.UTILITIES)){ 
     1608        } else if (tag.equals(CARDFILE.UTILITIES)) 
     1609        { 
    14421610            return cardfileData.getUtilitiesList(); 
    1443         } 
    1444         else if(tag.equals(CARDFILE.ANIMAL_CONTROL)){ 
     1611        } else if (tag.equals(CARDFILE.ANIMAL_CONTROL)) 
     1612        { 
    14451613            return cardfileData.getAnimalControlList(); 
    1446         } 
    1447         else if(tag.equals(CARDFILE.AIRPORTS)){ 
     1614        } else if (tag.equals(CARDFILE.AIRPORTS)) 
     1615        { 
    14481616            return cardfileData.getAirportsList(); 
    1449         } 
    1450         else if(tag.equals(CARDFILE.CREDIT_CARDS)){ 
     1617        } else if (tag.equals(CARDFILE.CREDIT_CARDS)) 
     1618        { 
    14511619            return cardfileData.getCreditCardsList(); 
    1452         } 
    1453         else if(tag.equals(CARDFILE.GG_CRISIS_SHELTERS)){ 
     1620        } else if (tag.equals(CARDFILE.GG_CRISIS_SHELTERS)) 
     1621        { 
    14541622            return cardfileData.getGgCrisisSheltersList(); 
    1455         } 
    1456         else if(tag.equals(CARDFILE.RANGES)){ 
     1623        } else if (tag.equals(CARDFILE.RANGES)) 
     1624        { 
    14571625            return cardfileData.getRangesList(); 
    1458         } 
    1459         else if(tag.equals(CARDFILE.HOTLINES)){ 
     1626        } else if (tag.equals(CARDFILE.HOTLINES)) 
     1627        { 
    14601628            return cardfileData.getHotlinesList(); 
    1461         } 
    1462         else if(tag.equals(CARDFILE.HWY_PATROLS_OOS)){ 
     1629        } else if (tag.equals(CARDFILE.HWY_PATROLS_OOS)) 
     1630        { 
    14631631            return cardfileData.getHwyPatrolsOosList(); 
    1464         } 
    1465         else if(tag.equals(CARDFILE.PARKS_RECREATION)){ 
     1632        } else if (tag.equals(CARDFILE.PARKS_RECREATION)) 
     1633        { 
    14661634            return cardfileData.getParksRecreationList(); 
    1467         } 
    1468         else if(tag.equals(CARDFILE.SHELTERS)){ 
     1635        } else if (tag.equals(CARDFILE.SHELTERS)) 
     1636        { 
    14691637            return cardfileData.getSheltersList(); 
    1470         } 
    1471         else if(tag.equals(CARDFILE.SL_COUNTY_SERVICES)){ 
     1638        } else if (tag.equals(CARDFILE.SL_COUNTY_SERVICES)) 
     1639        { 
    14721640            return cardfileData.getSlCountyServicesList(); 
    1473         } 
    1474         else if(tag.equals(CARDFILE.SL_RESOURCES)){ 
     1641        } else if (tag.equals(CARDFILE.SL_RESOURCES)) 
     1642        { 
    14751643            return cardfileData.getSlResourcesList(); 
    1476         } 
    1477         else if(tag.equals(CARDFILE.TRUCK_TIRE_REPAIR)){ 
     1644        } else if (tag.equals(CARDFILE.TRUCK_TIRE_REPAIR)) 
     1645        { 
    14781646            return cardfileData.getTruckTireRepairList(); 
    1479         } 
    1480         else if(tag.equals(CARDFILE.MCC_EMPLOYEES)){ 
     1647        } else if (tag.equals(CARDFILE.MCC_EMPLOYEES)) 
     1648        { 
    14811649            return cardfileData.getMccEmployeesList(); 
    1482         } 
    1483         else if(tag.equals(CARDFILE.GATE_ACCESS_CODES)){ 
     1650        } else if (tag.equals(CARDFILE.GATE_ACCESS_CODES)) 
     1651        { 
    14841652            return cardfileData.getGateAccessCodesList(); 
    1485         } 
    1486         else if(tag.equals(CARDFILE.VT_CALL_SIGNS)){ 
     1653        } else if (tag.equals(CARDFILE.VT_CALL_SIGNS)) 
     1654        { 
    14871655            return cardfileData.getVtCallSignsList(); 
    1488         } 
    1489         else if(tag.equals(CARDFILE.SLCC_EMPLOYEES)){ 
     1656        } else if (tag.equals(CARDFILE.SLCC_EMPLOYEES)) 
     1657        { 
    14901658            return cardfileData.getSlccEmployeesList(); 
    1491         } 
    1492         else{ 
     1659        } else 
     1660        { 
    14931661            throw new RemoteException("Wrong Enum sent into Coordinator.getCardfileList"); 
    14941662        } 
    14951663    } 
    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          
     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 
    15031672        CardfileList selectedList; 
    1504          
    1505         if(log.listTitle.equals(CARDFILE.COASTAL_DIVISION_UNITS.tag)){ 
     1673 
     1674        if (log.listTitle.equals(CARDFILE.COASTAL_DIVISION_UNITS.tag)) 
     1675        { 
    15061676            selectedList = cardfileData.getCoastalDivisionUnitList(); 
    1507         } 
    1508         else if(log.listTitle.equals(CARDFILE.POLICE_SHERIFF_CORONER.tag)){ 
     1677        } else if (log.listTitle.equals(CARDFILE.POLICE_SHERIFF_CORONER.tag)) 
     1678        { 
    15091679            selectedList = cardfileData.getPoliceSheriffCoronerList(); 
    1510         } 
    1511         else if(log.listTitle.equals(CARDFILE.COURTS.tag)){ 
     1680        } else if (log.listTitle.equals(CARDFILE.COURTS.tag)) 
     1681        { 
    15121682            selectedList = cardfileData.getCourtsList(); 
    1513         } 
    1514         else if(log.listTitle.equals(CARDFILE.PUBLIC_TRANSPORTATION.tag)){ 
     1683        } else if (log.listTitle.equals(CARDFILE.PUBLIC_TRANSPORTATION.tag)) 
     1684        { 
    15151685            selectedList = cardfileData.getPublicTransportationList(); 
    1516         } 
    1517         else if(log.listTitle.equals(CARDFILE.GG_OTHER.tag)){ 
     1686        } else if (log.listTitle.equals(CARDFILE.GG_OTHER.tag)) 
     1687        { 
    15181688            selectedList = cardfileData.getGgOtherList(); 
    1519         } 
    1520         else if(log.listTitle.equals(CARDFILE.MY_MISC.tag)){ 
     1689        } else if (log.listTitle.equals(CARDFILE.MY_MISC.tag)) 
     1690        { 
    15211691            selectedList = cardfileData.getMyMiscList(); 
    1522         } 
    1523         else if(log.listTitle.equals(CARDFILE.SL_MISC.tag)){ 
     1692        } else if (log.listTitle.equals(CARDFILE.SL_MISC.tag)) 
     1693        { 
    15241694            selectedList = cardfileData.getSlMiscList(); 
    1525         } 
    1526         else if(log.listTitle.equals(CARDFILE.VT_MISC.tag)){ 
     1695        } else if (log.listTitle.equals(CARDFILE.VT_MISC.tag)) 
     1696        { 
    15271697            selectedList = cardfileData.getVlMiscList(); 
    1528         } 
    1529         else if(log.listTitle.equals(CARDFILE.CHP_OFFICES.tag)){ 
     1698        } else if (log.listTitle.equals(CARDFILE.CHP_OFFICES.tag)) 
     1699        { 
    15301700            selectedList = cardfileData.getChpOfficesList(); 
    1531         } 
    1532         else if(log.listTitle.equals(CARDFILE.STATE_AGENCIES_FACILITIES.tag)){ 
     1701        } else if (log.listTitle.equals(CARDFILE.STATE_AGENCIES_FACILITIES.tag)) 
     1702        { 
    15331703            selectedList = cardfileData.getStateAgenciesFacilitiesList(); 
    1534         } 
    1535         else if(log.listTitle.equals(CARDFILE.GOVERNMENT_OFFICIALS.tag)){ 
     1704        } else if (log.listTitle.equals(CARDFILE.GOVERNMENT_OFFICIALS.tag)) 
     1705        { 
    15361706            selectedList = cardfileData.getGovernmentOfficialsList(); 
    1537         } 
    1538         else if(log.listTitle.equals(CARDFILE.FEDERAL_AGENCIES.tag)){ 
     1707        } else if (log.listTitle.equals(CARDFILE.FEDERAL_AGENCIES.tag)) 
     1708        { 
    15391709            selectedList = cardfileData.getFederalAgenciesList(); 
    1540         } 
    1541         else if(log.listTitle.equals(CARDFILE.RANCHES_LIVESTOCK.tag)){ 
     1710        } else if (log.listTitle.equals(CARDFILE.RANCHES_LIVESTOCK.tag)) 
     1711        { 
    15421712            selectedList = cardfileData.getRanchesLivestockList(); 
    1543         } 
    1544         else if(log.listTitle.equals(CARDFILE.FIRE_EMS.tag)){ 
     1713        } else if (log.listTitle.equals(CARDFILE.FIRE_EMS.tag)) 
     1714        { 
    15451715            selectedList = cardfileData.getFireEmsList(); 
    1546         } 
    1547         else if(log.listTitle.equals(CARDFILE.JAILS.tag)){ 
     1716        } else if (log.listTitle.equals(CARDFILE.JAILS.tag)) 
     1717        { 
    15481718            selectedList = cardfileData.getJailsList(); 
    1549         } 
    1550         else if(log.listTitle.equals(CARDFILE.HOSPITALS_MED_CENTERS.tag)){ 
     1719        } else if (log.listTitle.equals(CARDFILE.HOSPITALS_MED_CENTERS.tag)) 
     1720        { 
    15511721            selectedList = cardfileData.getHospitalsMedCentersList(); 
    1552         } 
    1553         else if(log.listTitle.equals(CARDFILE.TOW_COMPANIES.tag)){ 
     1722        } else if (log.listTitle.equals(CARDFILE.TOW_COMPANIES.tag)) 
     1723        { 
    15541724            selectedList = cardfileData.getTowCompaniesList(); 
    1555         } 
    1556         else if(log.listTitle.equals(CARDFILE.CALTRANS.tag)){ 
     1725        } else if (log.listTitle.equals(CARDFILE.CALTRANS.tag)) 
     1726        { 
    15571727            selectedList = cardfileData.getCalTransList(); 
    1558         } 
    1559         else if(log.listTitle.equals(CARDFILE.COUNTY_ROADS.tag)){ 
     1728        } else if (log.listTitle.equals(CARDFILE.COUNTY_ROADS.tag)) 
     1729        { 
    15601730            selectedList = cardfileData.getCountyRoadsList(); 
    1561         } 
    1562         else if(log.listTitle.equals(CARDFILE.UTILITIES.tag)){ 
     1731        } else if (log.listTitle.equals(CARDFILE.UTILITIES.tag)) 
     1732        { 
    15631733            selectedList = cardfileData.getUtilitiesList(); 
    1564         } 
    1565         else if(log.listTitle.equals(CARDFILE.ANIMAL_CONTROL.tag)){ 
     1734        } else if (log.listTitle.equals(CARDFILE.ANIMAL_CONTROL.tag)) 
     1735        { 
    15661736            selectedList = cardfileData.getAnimalControlList(); 
    1567         } 
    1568         else if(log.listTitle.equals(CARDFILE.AIRPORTS.tag)){ 
     1737        } else if (log.listTitle.equals(CARDFILE.AIRPORTS.tag)) 
     1738        { 
    15691739            selectedList = cardfileData.getAirportsList(); 
    1570         } 
    1571         else if(log.listTitle.equals(CARDFILE.CREDIT_CARDS.tag)){ 
     1740        } else if (log.listTitle.equals(CARDFILE.CREDIT_CARDS.tag)) 
     1741        { 
    15721742            selectedList = cardfileData.getCreditCardsList(); 
    1573         } 
    1574         else if(log.listTitle.equals(CARDFILE.GG_CRISIS_SHELTERS.tag)){ 
     1743        } else if (log.listTitle.equals(CARDFILE.GG_CRISIS_SHELTERS.tag)) 
     1744        { 
    15751745            selectedList = cardfileData.getGgCrisisSheltersList(); 
    1576         } 
    1577         else if(log.listTitle.equals(CARDFILE.RANGES.tag)){ 
     1746        } else if (log.listTitle.equals(CARDFILE.RANGES.tag)) 
     1747        { 
    15781748            selectedList = cardfileData.getRangesList(); 
    1579         } 
    1580         else if(log.listTitle.equals(CARDFILE.HOTLINES.tag)){ 
     1749        } else if (log.listTitle.equals(CARDFILE.HOTLINES.tag)) 
     1750        { 
    15811751            selectedList = cardfileData.getHotlinesList(); 
    1582         } 
    1583         else if(log.listTitle.equals(CARDFILE.HWY_PATROLS_OOS.tag)){ 
     1752        } else if (log.listTitle.equals(CARDFILE.HWY_PATROLS_OOS.tag)) 
     1753        { 
    15841754            selectedList = cardfileData.getHwyPatrolsOosList(); 
    1585         } 
    1586         else if(log.listTitle.equals(CARDFILE.PARKS_RECREATION.tag)){ 
     1755        } else if (log.listTitle.equals(CARDFILE.PARKS_RECREATION.tag)) 
     1756        { 
    15871757            selectedList = cardfileData.getParksRecreationList(); 
    1588         } 
    1589         else if(log.listTitle.equals(CARDFILE.SHELTERS.tag)){ 
     1758        } else if (log.listTitle.equals(CARDFILE.SHELTERS.tag)) 
     1759        { 
    15901760            selectedList = cardfileData.getSheltersList(); 
    1591         } 
    1592         else if(log.listTitle.equals(CARDFILE.SL_COUNTY_SERVICES.tag)){ 
     1761        } else if (log.listTitle.equals(CARDFILE.SL_COUNTY_SERVICES.tag)) 
     1762        { 
    15931763            selectedList = cardfileData.getSlCountyServicesList(); 
    1594         } 
    1595         else if(log.listTitle.equals(CARDFILE.SL_RESOURCES.tag)){ 
     1764        } else if (log.listTitle.equals(CARDFILE.SL_RESOURCES.tag)) 
     1765        { 
    15961766            selectedList = cardfileData.getSlResourcesList(); 
    1597         } 
    1598         else if(log.listTitle.equals(CARDFILE.TRUCK_TIRE_REPAIR.tag)){ 
     1767        } else if (log.listTitle.equals(CARDFILE.TRUCK_TIRE_REPAIR.tag)) 
     1768        { 
    15991769            selectedList = cardfileData.getTruckTireRepairList(); 
    1600         } 
    1601         else if(log.listTitle.equals(CARDFILE.MCC_EMPLOYEES.tag)){ 
     1770        } else if (log.listTitle.equals(CARDFILE.MCC_EMPLOYEES.tag)) 
     1771        { 
    16021772            selectedList = cardfileData.getMccEmployeesList(); 
    1603         } 
    1604         else if(log.listTitle.equals(CARDFILE.GATE_ACCESS_CODES.tag)){ 
     1773        } else if (log.listTitle.equals(CARDFILE.GATE_ACCESS_CODES.tag)) 
     1774        { 
    16051775            selectedList = cardfileData.getGateAccessCodesList(); 
    1606         } 
    1607         else if(log.listTitle.equals(CARDFILE.VT_CALL_SIGNS.tag)){ 
     1776        } else if (log.listTitle.equals(CARDFILE.VT_CALL_SIGNS.tag)) 
     1777        { 
    16081778            selectedList = cardfileData.getVtCallSignsList(); 
    1609         } 
    1610         else if(log.listTitle.equals(CARDFILE.SLCC_EMPLOYEES.tag)){ 
     1779        } else if (log.listTitle.equals(CARDFILE.SLCC_EMPLOYEES.tag)) 
     1780        { 
    16111781            selectedList = cardfileData.getSlccEmployeesList(); 
    1612         } 
    1613         else{ 
     1782        } else 
     1783        { 
    16141784            throw new RemoteException("Wrong Enum sent into Coordinator.editCardfileDataObject"); 
    16151785        } 
    1616          
     1786 
    16171787        CardfileDataObject cfdo = cardfileData.getCardfileDataObject(selectedList, log.id); 
    1618         if(cfdo != null && log.command.equals(EditCommand.NAME)){ 
     1788        if (cfdo != null && log.command.equals(EditCommand.NAME)) 
     1789        { 
    16191790            cfdo.setName(log.newValue); 
    1620             selectedList.resort(cardfileData.getCardfileDataIndex(selectedList,log.id)); 
    1621         } 
    1622         else if(cfdo != null && log.command.equals(EditCommand.ADDRESS)){ 
     1791            selectedList.resort(cardfileData.getCardfileDataIndex(selectedList, log.id)); 
     1792        } else if (cfdo != null && log.command.equals(EditCommand.ADDRESS)) 
     1793        { 
    16231794            cfdo.setAddress(log.newValue); 
    1624         } 
    1625         else if(cfdo != null && log.command.equals(EditCommand.CITY)){ 
     1795        } else if (cfdo != null && log.command.equals(EditCommand.CITY)) 
     1796        { 
    16261797            cfdo.setCity(log.newValue); 
    1627         } 
    1628         else if(cfdo != null && log.command.equals(EditCommand.STATE)){ 
     1798        } else if (cfdo != null && log.command.equals(EditCommand.STATE)) 
     1799        { 
    16291800            cfdo.setState(log.newValue); 
    1630         } 
    1631         else if(cfdo != null && log.command.equals(EditCommand.ZIP)){ 
     1801        } else if (cfdo != null && log.command.equals(EditCommand.ZIP)) 
     1802        { 
    16321803            cfdo.setZip(log.newValue); 
    1633         } 
    1634         else if(cfdo != null && log.command.equals(EditCommand.PHONE1)){ 
     1804        } else if (cfdo != null && log.command.equals(EditCommand.PHONE1)) 
     1805        { 
    16351806            cfdo.setPhone1(log.newValue); 
    1636         } 
    1637         else if(cfdo != null && log.command.equals(EditCommand.PHONE2)){ 
     1807        } else if (cfdo != null && log.command.equals(EditCommand.PHONE2)) 
     1808        { 
    16381809            cfdo.setPhone2(log.newValue); 
    1639         } 
    1640         else if(cfdo != null && log.command.equals(EditCommand.FAX)){ 
     1810        } else if (cfdo != null && log.command.equals(EditCommand.FAX)) 
     1811        { 
    16411812            cfdo.setFax(log.newValue); 
    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)){ 
     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        { 
    16471818            selectedList.addDataObject(log.newCardfileObject); 
    1648         } 
    1649         else if(log.command.equals(EditCommand.TABLE_ADD)){ 
    1650             if(cfdo != null){ 
    1651                cfdo.addComment(log.tableFields); 
     1819        } else if (log.command.equals(EditCommand.TABLE_ADD)) 
     1820        { 
     1821            if (cfdo != null) 
     1822            { 
     1823                cfdo.addComment(log.tableFields); 
    16521824            } 
    1653         } 
    1654         else if(log.command.equals(EditCommand.TABLE_DELETE)){ 
    1655             if(cfdo != null){ 
     1825        } else if (log.command.equals(EditCommand.TABLE_DELETE)) 
     1826        { 
     1827            if (cfdo != null) 
     1828            { 
    16561829                cfdo.removeComment(log.timeStamp); 
    16571830            } 
    1658         } 
    1659         else{ 
    1660              
    1661         } 
    1662          
    1663          
    1664     } 
    1665      
     1831        } else 
     1832        { 
     1833        } 
     1834 
     1835 
     1836    } 
     1837 
    16661838    /** 
    16671839     * Obtain a new unique ID for a cardfileDataObject. 
    16681840     */ 
    1669     public int obtainNewUniqueId() throws RemoteException{ 
     1841    public int obtainNewUniqueId() throws RemoteException 
     1842    { 
    16701843        return cardfileData.obtainNewUniqueId(); 
    16711844    } 
    1672      
     1845 
    16731846    /** 
    16741847     * Returns a value from Unit based on tag. 
     1848     * 
    16751849     * @param unitNum the unitNum to look up 
    1676      * @throws RemoteException  
    1677      */ 
    1678     public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException{ 
     1850     * @throws RemoteException 
     1851     */ 
     1852    public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException 
     1853    { 
    16791854        return cadData.getUnit(unitNum).getUnitStatus(); 
    16801855    } 
    1681      
     1856 
    16821857    /** 
    16831858     * Returns a string field from Unit based on tag. 
     1859     * 
    16841860     * @param tag a CADScriptTags tag 
    16851861     * @param unitNum the unitNum to look up 
     
    16871863     * @throws RemoteException 
    16881864     */ 
    1689     public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException{ 
    1690         if(tag.equals(UNIT_TAGS.MASTER_INC_NUM)){ 
     1865    public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException 
     1866    { 
     1867        if (tag.equals(UNIT_TAGS.MASTER_INC_NUM)) 
     1868        { 
    16911869            return cadData.getUnit(unitNum).getMasterInc(); 
    1692         } 
    1693         else if(tag.equals(UNIT_TAGS.STATUS)){ 
     1870        } else if (tag.equals(UNIT_TAGS.STATUS)) 
     1871        { 
    16941872            return cadData.getUnit(unitNum).getStatus(); 
    1695         } 
    1696         else if(tag.equals(UNIT_TAGS.OOS)){ 
     1873        } else if (tag.equals(UNIT_TAGS.OOS)) 
     1874        { 
    16971875            return cadData.getUnit(unitNum).getOos(); 
    1698         } 
    1699         else if(tag.equals(UNIT_TAGS.TYPE)){ 
     1876        } else if (tag.equals(UNIT_TAGS.TYPE)) 
     1877        { 
    17001878            return cadData.getUnit(unitNum).getType(); 
    1701         } 
    1702         else if(tag.equals(UNIT_TAGS.CURR_LOC)){ 
     1879        } else if (tag.equals(UNIT_TAGS.CURR_LOC)) 
     1880        { 
    17031881            return cadData.getUnit(unitNum).getCurrentLocation(); 
    1704         } 
    1705         else if(tag.equals(UNIT_TAGS.DESTINATION)){ 
     1882        } else if (tag.equals(UNIT_TAGS.DESTINATION)) 
     1883        { 
    17061884            return cadData.getUnit(unitNum).getDestination(); 
    1707         } 
    1708         else if(tag.equals(UNIT_TAGS.MISC_INFO)){ 
     1885        } else if (tag.equals(UNIT_TAGS.MISC_INFO)) 
     1886        { 
    17091887            return cadData.getUnit(unitNum).getMisc(); 
    1710         } 
    1711         else if(tag.equals(UNIT_TAGS.STACK)){ 
     1888        } else if (tag.equals(UNIT_TAGS.STACK)) 
     1889        { 
    17121890            return cadData.getUnit(unitNum).getStack(); 
    1713         } 
    1714         else if(tag.equals(UNIT_TAGS.AREA)){ 
     1891        } else if (tag.equals(UNIT_TAGS.AREA)) 
     1892        { 
    17151893            return cadData.getUnit(unitNum).getArea(); 
    1716         } 
    1717         else if(tag.equals(UNIT_TAGS.OFFICER)){ 
     1894        } else if (tag.equals(UNIT_TAGS.OFFICER)) 
     1895        { 
    17181896            return cadData.getUnit(unitNum).getOfficer(); 
    1719         } 
    1720         else if(tag.equals(UNIT_TAGS.BADGE_NUM)){ 
     1897        } else if (tag.equals(UNIT_TAGS.BADGE_NUM)) 
     1898        { 
    17211899            return cadData.getUnit(unitNum).getBadge(); 
    1722         } 
    1723         else if(tag.equals(UNIT_TAGS.TIMER)){ 
     1900        } else if (tag.equals(UNIT_TAGS.TIMER)) 
     1901        { 
    17241902            return cadData.getUnit(unitNum).getTimerInString(); 
    1725         } 
    1726         else if(tag.equals(UNIT_TAGS.OFFICE)){ 
     1903        } else if (tag.equals(UNIT_TAGS.OFFICE)) 
     1904        { 
    17271905            return cadData.getUnit(unitNum).getOffice(); 
    1728         } 
    1729         else if(tag.equals(UNIT_TAGS.P)){ 
     1906        } else if (tag.equals(UNIT_TAGS.P)) 
     1907        { 
    17301908            return cadData.getUnit(unitNum).getP(); 
    1731         } 
    1732         else if(tag.equals(UNIT_TAGS.AGY)){ 
     1909        } else if (tag.equals(UNIT_TAGS.AGY)) 
     1910        { 
    17331911            return cadData.getUnit(unitNum).getAgy(); 
    1734         } 
    1735         else if(tag.equals(UNIT_TAGS.ALIAS)){ 
     1912        } else if (tag.equals(UNIT_TAGS.ALIAS)) 
     1913        { 
    17361914            return cadData.getUnit(unitNum).getAlias(); 
    1737         } 
    1738         else{ 
     1915        } else 
     1916        { 
    17391917            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataUnitValue"); 
    17401918        } 
     
    17431921    /** 
    17441922     * Sets a field from Unit based on tag. 
     1923     * 
    17451924     * @param tag a CADScriptTags tag 
    17461925     * @param unitNum the unitNum to look up 
     
    17481927     * @throws RemoteException 
    17491928     */ 
    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{ 
     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        { 
    18001981            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataUnitValue"); 
    18011982        } 
    18021983    } 
    1803      
     1984 
    18041985    /** 
    18051986     * Assigns a unit to the specified incident. 
     1987     * 
    18061988     * @param unitNum the unitNum to look up 
    18071989     * @param id the incident id that this unit is assigned to. 
    18081990     * @throws RemoteException 
    18091991     */ 
    1810     public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException{ 
     1992    public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException 
     1993    { 
    18111994        cadData.getUnit(unitNum).setAssignedIncidentId(id); 
    18121995    } 
    1813      
     1996 
    18141997    /** 
    18151998     * Adds a unit to the incident's list of assigned units. 
     1999     * 
    18162000     * @param incidentId the incident 
    18172001     * @param assignedUnitNum the unit that's been assigned to the incident 
    18182002     * @throws RemoteException 
    18192003     */ 
    1820     public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException{ 
     2004    public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException 
     2005    { 
    18212006        cadData.getIncident(incidentId).addAssignedUnitNum(assignedUnitNum); 
    18222007    } 
    1823      
     2008 
    18242009    /** 
    18252010     * Sets the specified incident to the specified status. 
     2011     * 
    18262012     * @param incidentId the incident 
    18272013     * @param status the status of the incident 
    18282014     * @throws RemoteException 
    18292015     */ 
    1830     public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException{ 
     2016    public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException 
     2017    { 
    18312018        cadData.getIncident(incidentId).setIncidentStatus(status); 
    18322019    } 
    1833      
    1834     /**  
     2020 
     2021    /** 
    18352022     * Returns a LinkedList containing entries that match the search string. 
     2023     * 
    18362024     * @param search the string entry to be searched 
    18372025     * @return linked list of CardfileDataObjects matching search 
    18382026     */ 
    1839     public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException{ 
     2027    public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException 
     2028    { 
    18402029        return cardfileData.getSearchList(search); 
    18412030    } 
    1842      
    1843     /**  
    1844      * Updates the server database so clients can view additional informations as events complete 
     2031 
     2032    /** 
     2033     * Updates the server database so clients can view additional informations 
     2034     * as events complete 
     2035     * 
    18452036     * @param incidentNumber the incident in which the event occurred 
    1846      * @return completedEvent IncidentEvent with information to be added to server database 
    1847      */ 
    1848     public void updateIncidentInGUI(Integer incidentNumber, IncidentEvent completedEvent) { 
     2037     * @return completedEvent IncidentEvent with information to be added to 
     2038     * server database 
     2039     */ 
     2040    public void updateIncidentInGUI(Integer incidentNumber, IncidentEvent completedEvent) 
     2041    { 
    18492042        updateDetailsInGUI(incidentNumber, completedEvent); 
    18502043        updateUnitsInGUI(incidentNumber, completedEvent); 
    18512044    } 
    1852      
    1853     /**  
    1854      * Updates the server database so clients can view details as events complete 
     2045 
     2046    /** 
     2047     * Updates the server database so clients can view details as events 
     2048     * complete 
     2049     * 
    18552050     * @param incidentNumber the incident in which the event occurred 
    1856      * @return completedEvent IncidentEvent with details to be added to server database 
    1857      */ 
    1858     public void updateDetailsInGUI(Integer incidentNumber, IncidentEvent completedEvent) { 
     2051     * @return completedEvent IncidentEvent with details to be added to server 
     2052     * database 
     2053     */ 
     2054    public void updateDetailsInGUI(Integer incidentNumber, IncidentEvent completedEvent) 
     2055    { 
    18592056        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
    18602057        DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
    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{ 
     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            { 
    18672069                addCadDataIncidentTable(INC_TABLE.COMMENTS_NOTES, incidentNumber, fields); 
    1868             }catch(RemoteException e){ 
     2070            } catch (RemoteException e) 
     2071            { 
    18692072                e.printStackTrace(); 
    1870             }    
    1871         } 
    1872     } 
    1873      
    1874     /**  
    1875      * Updates the server database so clients can view unit updates as events complete 
     2073            } 
     2074        } 
     2075    } 
     2076 
     2077    /** 
     2078     * Updates the server database so clients can view unit updates as events 
     2079     * complete 
     2080     * 
    18762081     * @param incidentNumber the incident in which the event occurred 
    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++){ 
     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        { 
    18812089            IncidentInquiryUnitsAssigned unit = completedEvent.eventInfo.getUnits().get(i); 
    1882             if(unit.statusType.equals("ENRT")){ 
     2090            if (unit.statusType.equals("ENRT")) 
     2091            { 
    18832092                cadData.unitAssignedToIncident(unit.beat, incidentNumber, unit.isPrimary); 
    1884             }else if(unit.statusType.equals("1097")){ 
     2093            } else if (unit.statusType.equals("1097")) 
     2094            { 
    18852095                cadData.unitArrivedAtIncidentScene(unit.beat, incidentNumber, unit.isPrimary); 
    1886             }else if(unit.statusType.equals("1098")){ 
     2096            } else if (unit.statusType.equals("1098")) 
     2097            { 
    18872098                cadData.unitAvailable(unit.beat); 
    18882099            } 
    18892100        } 
    18902101    } 
    1891      
     2102 
    18922103    /** 
    18932104     * Sets the specified incidentNumber to viewable in the GUI. 
     2105     * 
    18942106     * @param incidentNumber the number of the Incident started 
    18952107     */ 
    1896     public void incidentStartedInGUI(Integer incidentNumber){ 
     2108    public void incidentStartedInGUI(Integer incidentNumber) 
     2109    { 
    18972110        Date date = new Date(); 
    18982111        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); 
Note: See TracChangeset for help on using the changeset viewer.