public void refresh() {
int selected = this.list.getSelectedIndex();
if( selected==-1 )
return;
MLDataPair pair = BasicMLDataPair.createPair(this.data.getInputSize(), this.data.getIdealSize());
this.data.getRecord(selected, pair);
int gridHeight;
int gridWidth;
try {
gridHeight = Integer.parseInt(this.fieldHeight.getText());
if( gridHeight<=0 )
throw new NumberFormatException();
} catch(NumberFormatException ex) {
EncogWorkBench.displayError("Error", "Invalid height.");
return;
}
try {
gridWidth = Integer.parseInt(this.fieldWidth.getText());
if( gridHeight<=0 )
throw new NumberFormatException();
} catch(NumberFormatException ex) {
EncogWorkBench.displayError("Error", "Invalid width.");
return;
}
this.grid.updateData(gridHeight,gridWidth,pair.getInput().getData());
}