Пример #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
Пример #2
0
 private void jButton5ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton5ActionPerformed
   int newNumChHish;
   try {
     newNumChHish = Integer.parseInt(jTFChNumHist.getText());
     jPHist.removeAll();
     ChartPanel chpanHist = updateHistPanel(dataValues, minValue, maxValue, newNumChHish);
     chpanHist.setSize(jPHist.getSize());
     jPHist.add(chpanHist);
     jPHist.repaint();
   } catch (NumberFormatException ex) {
     CoreErrorMessages.selCorrChNum();
   }
 } // GEN-LAST:event_jButton5ActionPerformed