@@ -127,7 +127,7 @@ public void revert(){
127127 if (!delete_history .isEmpty ()){
128128 ArrayList arr = delete_history .pop ();
129129 int [] indices = (int []) arr .get (0 );
130- String [] objects = (String []) arr .get (1 );
130+ HistoryDataObject [] objects = (HistoryDataObject []) arr .get (1 );
131131 for (int i = 0 ; i <indices .length ; i ++){
132132 defaultTableModel .insertRow (indices [i ], new Object [] {objects [i ]} );
133133 }
@@ -141,7 +141,7 @@ public void revert(){
141141 * receive a HistoryDataObject
142142 */
143143 public void insert (HistoryDataObject e ){
144- defaultTableModel .addRow (new Object [] {e . toString () });
144+ defaultTableModel .addRow (new Object [] {e });
145145 }
146146
147147
@@ -153,11 +153,11 @@ public void insert(HistoryDataObject e){
153153 public void removeSeveralRows (int [] indices ){
154154 //create a arr to hold the deleted data and rows
155155 ArrayList arr = new ArrayList <>();
156- String [] objects = new String [indices .length ];
156+ HistoryDataObject [] objects = new HistoryDataObject [indices .length ];
157157 Arrays .sort (indices );
158158
159159 for (int i =indices .length -1 ;i >=0 ;i --){
160- objects [i ] = (String ) resultsTable .getModel ().getValueAt (indices [i ], 0 );
160+ objects [i ] = (HistoryDataObject ) resultsTable .getModel ().getValueAt (indices [i ], 0 );
161161 defaultTableModel .removeRow (indices [i ]);
162162 }
163163
0 commit comments