hide exceptions if table input parsing fails
This commit is contained in:
parent
50f09d7f85
commit
8e11e600ec
1 changed files with 17 additions and 11 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: DGRMConfigurator.java,v 1.3 2009/10/27 10:10:03 fros4943 Exp $
|
* $Id: DGRMConfigurator.java,v 1.4 2010/02/03 09:30:38 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.plugins;
|
package se.sics.cooja.plugins;
|
||||||
|
@ -143,7 +143,7 @@ public class DGRMConfigurator extends VisPlugin {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
combo.setEditable(true);
|
combo.setEditable(true);
|
||||||
graphTable.getColumnModel().getColumn(2).setCellRenderer(new DefaultTableCellRenderer() {
|
graphTable.getColumnModel().getColumn(IDX_RATIO).setCellRenderer(new DefaultTableCellRenderer() {
|
||||||
public void setValue(Object value) {
|
public void setValue(Object value) {
|
||||||
if (!(value instanceof Double)) {
|
if (!(value instanceof Double)) {
|
||||||
setText(value.toString());
|
setText(value.toString());
|
||||||
|
@ -153,7 +153,7 @@ public class DGRMConfigurator extends VisPlugin {
|
||||||
setText((Math.round(v*1000.0) / 10.0) + "%");
|
setText((Math.round(v*1000.0) / 10.0) + "%");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
graphTable.getColumnModel().getColumn(3).setCellRenderer(new DefaultTableCellRenderer() {
|
graphTable.getColumnModel().getColumn(IDX_DELAY).setCellRenderer(new DefaultTableCellRenderer() {
|
||||||
public void setValue(Object value) {
|
public void setValue(Object value) {
|
||||||
if (!(value instanceof Long)) {
|
if (!(value instanceof Long)) {
|
||||||
setText(value.toString());
|
setText(value.toString());
|
||||||
|
@ -163,8 +163,8 @@ public class DGRMConfigurator extends VisPlugin {
|
||||||
setText(v + " ms");
|
setText(v + " ms");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
graphTable.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(combo));
|
graphTable.getColumnModel().getColumn(IDX_RATIO).setCellEditor(new DefaultCellEditor(combo));
|
||||||
graphTable.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(combo));
|
graphTable.getColumnModel().getColumn(IDX_DELAY).setCellEditor(new DefaultCellEditor(combo));
|
||||||
|
|
||||||
graphTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
graphTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
|
||||||
graphTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
graphTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
@ -320,16 +320,22 @@ public class DGRMConfigurator extends VisPlugin {
|
||||||
DirectedGraphMedium.Edge edge = radioMedium.getEdges()[row];
|
DirectedGraphMedium.Edge edge = radioMedium.getEdges()[row];
|
||||||
if (column == IDX_RATIO) {
|
if (column == IDX_RATIO) {
|
||||||
/* Success ratio */
|
/* Success ratio */
|
||||||
((DGRMDestinationRadio)edge.superDest).ratio =
|
try {
|
||||||
((Number)value).doubleValue();
|
((DGRMDestinationRadio)edge.superDest).ratio =
|
||||||
radioMedium.requestEdgeAnalysis();
|
((Number)value).doubleValue();
|
||||||
|
radioMedium.requestEdgeAnalysis();
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (column == IDX_DELAY) {
|
if (column == IDX_DELAY) {
|
||||||
/* Propagation delay (ms) */
|
/* Propagation delay (ms) */
|
||||||
((DGRMDestinationRadio)edge.superDest).delay =
|
try {
|
||||||
((Number)value).longValue() * Simulation.MILLISECOND;
|
((DGRMDestinationRadio)edge.superDest).delay =
|
||||||
radioMedium.requestEdgeAnalysis();
|
((Number)value).longValue() * Simulation.MILLISECOND;
|
||||||
|
radioMedium.requestEdgeAnalysis();
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (column == IDX_DEL) {
|
if (column == IDX_DEL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue