/** * Sets the new figure retrieved from the passed collection. * * @param l The collection to handle. */ void setSelectedFigures(List<ROIShape> l) { FigureTableModel tableModel = (FigureTableModel) fieldTable.getModel(); Iterator<ROIShape> i = l.iterator(); // Register error and notify user. ROIShape shape; try { TableCellEditor editor = fieldTable.getCellEditor(); if (editor != null) editor.stopCellEditing(); while (i.hasNext()) { shape = i.next(); tableModel.setData(shape.getFigure()); fieldTable.repaint(); } } catch (Exception e) { MeasurementAgent.getRegistry().getLogger().info(this, "Figures selection" + e); } }
/** * Sets the data. * * @param figure The data to set. */ void setModelData(ROIFigure figure) { FigureTableModel tableModel = (FigureTableModel) fieldTable.getModel(); tableModel.setData(figure); fieldTable.repaint(); }