/**
  * Add stats in the column for area figures.
  *
  * @param fig the figure where the stats come from.
  * @param data the data being populated.
  * @param count the column in the table being populated.
  */
 private void addValuesForAreaFigure(ROIFigure fig, Double data[][], int channel, int count) {
   data[count][6] = AnnotationKeys.AREA.get(fig.getROIShape());
   data[count][7] = fig.getBounds().getX();
   data[count][8] = fig.getBounds().getY();
   data[count][9] = AnnotationKeys.WIDTH.get(fig.getROIShape());
   data[count][10] = AnnotationKeys.HEIGHT.get(fig.getROIShape());
   data[count][11] = AnnotationKeys.CENTREX.get(fig.getROIShape());
   data[count][12] = AnnotationKeys.CENTREY.get(fig.getROIShape());
 }
Exemplo n.º 2
0
  /**
   * Selects the collection of figures.
   *
   * @param l The collection of objects to select.
   * @param clear Pass <code>true</code> to clear the selection <code>false</code> otherwise.
   */
  void setSelectedFigures(List<ROIShape> l, boolean clear) {
    Iterator<ROIShape> i = l.iterator();
    TreeSelectionModel tsm = objectsTable.getTreeSelectionModel();
    ROIFigure figure = null;
    ROIShape shape;
    if (clear) tsm.clearSelection();
    objectsTable.removeTreeSelectionListener(treeSelectionListener);

    try {
      while (i.hasNext()) {
        shape = i.next();
        figure = shape.getFigure();
        objectsTable.selectROIShape(figure.getROIShape());
      }
      objectsTable.repaint();
      if (figure != null) objectsTable.scrollToROIShape(figure.getROIShape());
    } catch (Exception e) {
      MeasurementAgent.getRegistry().getLogger().info(this, "Figure selection " + e);
    }

    objectsTable.addTreeSelectionListener(treeSelectionListener);
  }
Exemplo n.º 3
0
 /**
  * Removes the passed figure from the table.
  *
  * @param figure The figure to remove.
  */
 void removeFigure(ROIFigure figure) {
   if (figure == null) return;
   objectsTable.removeROIShape(figure.getROIShape());
   objectsTable.repaint();
 }