Exemple #1
0
  private void jButton2ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed
    double newMinLifetime, newMaxLifetime;
    try {
      newMinLifetime = Double.parseDouble(jTFMinValue.getText());
      newMaxLifetime = Double.parseDouble(jTFMaxValue.getText());

      IntensImageDataset dataValuesDataset =
          new IntensImageDataset(imHeight, imWidth, new double[imWidth * imHeight]);
      for (int i = 0; i < dataValues.length; i++) {
        dataValuesDataset.SetValue(selImInd[i], dataValues[i]);
      }
      PaintScale ps = new RainbowPaintScale(newMinLifetime, newMaxLifetime);
      JFreeChart aveLifetimeChart =
          createScatChart(
              ImageUtilities.createColorCodedImage(dataValuesDataset, ps), ps, imWidth, imHeight);
      aveLifetimeChart.getXYPlot().getRangeAxis().setInverted(true);
      ChartPanel aveLifetimePanel = new ChartPanel(aveLifetimeChart);
      aveLifetimePanel.setFillZoomRectangle(true);
      aveLifetimePanel.setMouseWheelEnabled(true);
      jPImage.removeAll();
      aveLifetimePanel.setSize(jPImage.getSize());
      aveLifetimePanel.addChartMouseListener(listener);
      jPImage.add(aveLifetimePanel);
      jPImage.repaint();
    } catch (NumberFormatException ex) {
      CoreErrorMessages.selCorrChNum();
    }
  } // GEN-LAST:event_jButton2ActionPerformed
Exemple #2
0
  public ImageHistPanel(
      String name,
      double[] data,
      int[] selInd,
      int height,
      int width,
      double minVal,
      double maxVal,
      ChartMouseListener listen) {
    initComponents();
    this.dataValues = data;
    this.selImInd = selInd;
    this.imHeight = height;
    this.imWidth = width;
    this.minValue = minVal;
    this.maxValue = maxVal;
    this.jLName.setText(name);
    this.numChHist = 20;
    this.listener = listen;

    jTFChNumHist.setText(String.valueOf(numChHist));
    jTFMaxValue.setText(String.valueOf(maxValue));
    jTFMinValue.setText(String.valueOf(minValue));

    jPHist.add(updateHistPanel(data, minValue, maxValue, numChHist));

    IntensImageDataset dataValuesDataset =
        new IntensImageDataset(imHeight, imWidth, new double[imWidth * imHeight]);
    for (int i = 0; i < dataValues.length; i++) {
      dataValuesDataset.SetValue(selImInd[i], dataValues[i]);
    }
    PaintScale ps = new RainbowPaintScale(0.001, maxValue);
    JFreeChart aveLifetimeChart =
        createScatChart(
            ImageUtilities.createColorCodedImage(dataValuesDataset, ps), ps, imWidth, imHeight);
    ChartPanel aveLifetimePanel = new ChartPanel(aveLifetimeChart);
    aveLifetimePanel.setFillZoomRectangle(true);
    aveLifetimePanel.setMouseWheelEnabled(true);
    aveLifetimePanel.addChartMouseListener(listener);
    jPImage.add(aveLifetimePanel);
  }