- setRows(data.pressures.length);
- setText(" Time, Press, Height, Speed, Accel\n");
- for (MicroDataPoint point : data.points()) {
- append(String.format(
- "%6.3f,%6.0f,%7.1f,%7.2f,%7.2f\n",
- point.time, point.pressure, point.height, point.speed, point.accel));
+ StringWriter sw = new StringWriter();
+ try {
+ data.export(sw);
+ setRows(data.length());
+ setText(sw.toString());
+ } catch (IOException ie) {
+ setText(String.format("Error writing data: %s", ie.getMessage()));