| Revision 650,
1.2 KB
checked in by jdalbey, 4 years ago
(diff) |
|
Multiple updates - catchup webapps files I've been hoarding (sorry).
|
| Rev | Line | |
|---|
| 1 | package tmcsim.client.cadclientgui.data; |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | import java.util.Vector; |
|---|
| 5 | import javax.swing.table.DefaultTableModel; |
|---|
| 6 | import tmcsim.client.cadclientgui.data.Unit; |
|---|
| 7 | /** Spike to try to fix the concurrency error that shows up intermittently |
|---|
| 8 | * as noted in ticket #87. |
|---|
| 9 | * @author jdalbey |
|---|
| 10 | */ |
|---|
| 11 | class CADDataSpike |
|---|
| 12 | { |
|---|
| 13 | DefaultTableModel unitStatusTableModel; |
|---|
| 14 | Vector<String> unitStatusHeaders; |
|---|
| 15 | Vector<Unit> units; |
|---|
| 16 | /** |
|---|
| 17 | * Accessor to the Unit Status table model |
|---|
| 18 | * |
|---|
| 19 | * @return DefaultTableModel for UnitStatus |
|---|
| 20 | */ |
|---|
| 21 | public DefaultTableModel tableForUnitStatus() |
|---|
| 22 | { |
|---|
| 23 | Vector<Object> toUnitTableVector = new Vector<Object>(); |
|---|
| 24 | |
|---|
| 25 | // build a new unit table |
|---|
| 26 | for (Unit unit: units) |
|---|
| 27 | { |
|---|
| 28 | toUnitTableVector.add(unit.toVector()); |
|---|
| 29 | } |
|---|
| 30 | // Exception occurred here: http://pastebin.com/fvifM5i8 |
|---|
| 31 | // Probably a distributed object concurrency problem. |
|---|
| 32 | // Assign the unit status table from the newly created vector |
|---|
| 33 | unitStatusTableModel |
|---|
| 34 | .setDataVector(toUnitTableVector, unitStatusHeaders); |
|---|
| 35 | // return a reference to the updated table |
|---|
| 36 | return unitStatusTableModel; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.