Changeset 475 in tmcsimulator for trunk/src/tmcsim/client/cadclientgui/data


Ignore:
Timestamp:
08/23/2019 01:49:50 PM (7 years ago)
Author:
jdalbey
Message:

Coordinator.java, AssignedIncidents?.java, UnitStatus?.java, CADMenu.java: Add comments and error messages. Add revision number to CAD Menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/cadclientgui/data/CADData.java

    r310 r475  
    231231 
    232232    /** 
    233      * Sends all the objects for UnitStatus 
     233     * Accessor to the Unit Status table model  
    234234     * 
    235235     * @return DefaultTableModel for UnitStatus 
    236236     */ 
     237    synchronized 
    237238    public DefaultTableModel tableForUnitStatus() 
    238239    { 
    239         toUnitTableVector.clear(); 
    240         for (int i = 0; i < units.size(); i++) 
    241         { 
    242             toUnitTableVector.add(units.get(i).toVector()); 
     240        Vector<Object> toUnitTableVector = new Vector<Object>(); 
     241 
     242        // build a new unit table  
     243        for (Unit unit: units) 
     244        { 
     245            toUnitTableVector.add(unit.toVector()); 
    243246        } 
    244247        // Exception occurred here: http://pastebin.com/fvifM5i8 
     248        // Probably a distributed object concurrency problem. 
     249        // Assign the unit status table from the newly created vector 
    245250        unitStatusTableModel 
    246251                .setDataVector(toUnitTableVector, unitStatusHeaders); 
     252        // return a reference to the updated table 
    247253        return unitStatusTableModel; 
    248254    } 
    249  
    250255    /** 
    251256     * Sends all the objects for AssignedIncidents 
Note: See TracChangeset for help on using the changeset viewer.