Changeset 4224


Ignore:
Timestamp:
07/22/08 14:53:51 (12 years ago)
Author:
curtis
Message:

Initial GUI for toggling view modes, + miscellaneous cleanup.

Location:
trunk/loci/slim
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/loci/slim/SlimPlotter.java

    r4221 r4224  
    147147  private JCheckBox peaksBox, fwhmBox, cutBox; 
    148148 
    149   // GUI components for intensity pane 
    150   private IntensityPane intensityPane; 
     149  // GUI components for 2D pane 
     150  private TwoDPane twoDPane; 
    151151 
    152152  // GUI components for decay pane 
     
    276276      SDTReader reader = new SDTReader(); 
    277277      reader.setId(file.getPath()); 
     278      width = reader.getSizeX(); 
     279      height = reader.getSizeY(); 
     280      timeBins = reader.getTimeBinCount(); 
     281      channels = reader.getChannelCount(); 
    278282      SDTInfo info = reader.getInfo(); 
    279283      reader.close(); 
    280       int offset = info.dataBlockOffs + 22; 
    281       width = info.width; 
    282       height = info.height; 
    283       timeBins = info.timeBins; 
    284       channels = info.channels; 
    285284      timeRange = 12.5f; 
    286285      minWave = 400; 
     
    288287 
    289288      // show dialog confirming data parameters 
    290       paramDialog = new JDialog((Frame) null, "Slim Plotter", true); 
    291       JPanel paramPane = new JPanel(); 
    292       paramPane.setBorder(new EmptyBorder(10, 10, 10, 10)); 
    293       paramDialog.setContentPane(paramPane); 
    294       paramPane.setLayout(new GridLayout(12, 3)); 
    295       wField = addRow(paramPane, "Image width", width, "pixels"); 
    296       hField = addRow(paramPane, "Image height", height, "pixels"); 
    297       tField = addRow(paramPane, "Time bins", timeBins, ""); 
    298       cField = addRow(paramPane, "Channel count", channels, ""); 
    299       trField = addRow(paramPane, "Time range", timeRange, "nanoseconds"); 
    300       wlField = addRow(paramPane, "Starting wavelength", minWave, "nanometers"); 
    301       sField = addRow(paramPane, "Channel width", waveStep, "nanometers"); 
    302       fitField = addRow(paramPane, "Exponential fit", 1, "components"); 
    303       JButton ok = new JButton("OK"); 
    304       paramDialog.getRootPane().setDefaultButton(ok); 
    305       ok.addActionListener(this); 
    306       // row 8 
    307       paramPane.add(new JLabel("Fit algorithm")); 
    308       lmChoice = new JRadioButton("Levenberg-Marquardt"); 
    309       gaChoice = new JRadioButton("Genetic", true); 
    310       ButtonGroup group = new ButtonGroup(); 
    311       group.add(lmChoice); 
    312       group.add(gaChoice); 
    313       paramPane.add(lmChoice); 
    314       paramPane.add(gaChoice); 
    315       // row 9, column 1 
    316       peaksBox = new JCheckBox("Align peaks", true); 
    317       peaksBox.setToolTipText("<html>Computes the peak of each spectral " + 
    318         "channel, and aligns those peaks <br>to match by adjusting the " + 
    319         "lifetime histograms. This option corrects<br>for skew across " + 
    320         "channels caused by the multispectral detector's<br>variable system " + 
    321         "response time between channels. This option must<br>be enabled to " + 
    322         "perform exponential curve fitting.</html>"); 
    323       paramPane.add(peaksBox); 
    324       // row 9, column 2 
    325       fwhmBox = new JCheckBox("Compute FWHMs", false); 
    326       fwhmBox.setToolTipText( 
    327         "<html>Computes the full width half max at each channel.</html>"); 
    328       paramPane.add(fwhmBox); 
    329       // row 9, column 3 
    330       cutBox = new JCheckBox("Cut 1.5ns from fit", true); 
    331       cutBox.setToolTipText("<html>When performing exponential curve " + 
    332         "fitting, excludes the last 1.5 ns<br>from the computation. This " + 
    333         "option is useful because the end of the <br>the lifetime histogram " + 
    334         "sometimes drops off unexpectedly, skewing<br>the fit results.</html>"); 
    335       paramPane.add(cutBox); 
    336       // row 10 
    337       paramPane.add(new JLabel()); 
    338       paramPane.add(new JLabel()); 
    339       paramPane.add(new JLabel()); 
    340       // row 11 
    341       paramPane.add(new JLabel()); 
    342       paramPane.add(ok); 
    343       paramDialog.pack(); 
    344       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 
    345       Dimension ps = paramDialog.getSize(); 
    346       paramDialog.setLocation((screenSize.width - ps.width) / 2, 
    347         (screenSize.height - ps.height) / 2); 
    348       paramDialog.setVisible(true); 
     289      showParamDialog(); 
    349290      if (cVisible == null) System.exit(0); // dialog canceled (closed with X) 
    350291      maxWave = minWave + (channels - 1) * waveStep; 
     
    352293      // pop up progress monitor 
    353294      setProgress(progress, 1); // estimate: 0.1% 
    354       if (progress.isCanceled()) System.exit(0); 
    355295 
    356296      // read pixel data 
    357297      progress.setNote("Reading data"); 
    358298      DataInputStream fin = new DataInputStream(new FileInputStream(file)); 
    359       fin.skipBytes(offset); // skip to data 
     299      fin.skipBytes(info.dataBlockOffs); // skip to data 
    360300      byte[] data = new byte[2 * channels * height * width * timeBins]; 
    361301      int blockSize = 65536; 
     
    366306        setProgress(progress, (int) (700L * 
    367307          (off + blockSize) / data.length)); // estimate: 0% -> 70% 
    368         if (progress.isCanceled()) System.exit(0); 
    369308      } 
    370309      fin.close(); 
     
    397336      bcvFuncRes = new FunctionType(bc, vTypeRes); 
    398337      setProgress(progress, 710); // estimate: 71% 
    399       if (progress.isCanceled()) System.exit(0); 
    400338 
    401339      // plot intensity data in 2D display 
     
    403341 
    404342      setProgress(progress, 720); // estimate: 72% 
    405       if (progress.isCanceled()) System.exit(0); 
    406  
    407343      setProgress(progress, 730); // estimate: 73% 
    408       if (progress.isCanceled()) System.exit(0); 
    409  
    410344      setProgress(progress, 740); // estimate: 74% 
    411       if (progress.isCanceled()) System.exit(0); 
    412  
    413345      setProgress(progress, 750); // estimate: 75% 
    414       if (progress.isCanceled()) System.exit(0); 
    415346 
    416347      // plot decay curves in 3D display 
     
    435366      decayPlot.addMap(vMapRes); 
    436367      setProgress(progress, 760); // estimate: 76% 
    437       if (progress.isCanceled()) System.exit(0); 
    438368 
    439369      decayRend = new DefaultRendererJ3D(); 
     
    468398      } 
    469399      setProgress(progress, 770); // estimate: 77% 
    470       if (progress.isCanceled()) System.exit(0); 
    471400 
    472401      xMap.setRange(0, timeRange); 
     
    496425        new double[] {2, 1, 1}); 
    497426      setProgress(progress, 780); // estimate: 78% 
    498       if (progress.isCanceled()) System.exit(0); 
    499427 
    500428      // convert byte data to unsigned shorts 
     
    514442              int ndx = 2 * (oc + oh + ow + t); 
    515443              int val = DataTools.bytesToInt(data, ndx, 2, true); 
    516               if (val > maxIntensity[c]) maxIntensity[c] = val; 
    517444              values[c][h][w][t] = val; 
    518445              sum += val; 
    519446            } 
     447            if (sum > maxIntensity[c]) maxIntensity[c] = sum; 
    520448            pix[c][0][width * h + w] = sum; 
    521449          } 
    522450          setProgress(progress, 780 + 140 * 
    523451            (height * c + h + 1) / (channels * height)); // estimate: 78% -> 92% 
    524           if (progress.isCanceled()) System.exit(0); 
    525452        } 
    526453        FlatField ff = new FlatField(xyvFunc, xySet); 
     
    531458      // compute channel with brightest intensity 
    532459      maxChan = 0; 
    533       int max = 0; 
     460      int globalMax = 0; 
    534461      for (int c=0; c<channels; c++) { 
    535         if (maxIntensity[c] > max) { 
    536           max = maxIntensity[c]; 
     462        if (maxIntensity[c] > globalMax) { 
     463          globalMax = maxIntensity[c]; 
    537464          maxChan = c; 
    538465        } 
     
    561488          setProgress(progress, 920 + 20 * 
    562489            (c + 1) / channels); // estimate: 92% -> 94% 
    563           if (progress.isCanceled()) System.exit(0); 
    564490        } 
    565491        maxPeak = 0; 
     
    584510          setProgress(progress, 940 + 20 * 
    585511            (c + 1) / channels); // estimate: 94% -> 96% 
    586           if (progress.isCanceled()) System.exit(0); 
    587512        } 
    588513 
     
    608533      masterWindow.setContentPane(masterPane); 
    609534 
    610       intensityPane = new IntensityPane(this, field, 
    611         width, height, channels, max, maxChan, cVisible, 
     535      twoDPane = new TwoDPane(this, field, 
     536        width, height, channels, globalMax, maxChan, cVisible, 
    612537        xType, yType, vType, cType); 
    613538 
     
    631556 
    632557      setProgress(progress, 980); // estimate: 98% 
    633       if (progress.isCanceled()) System.exit(0); 
    634558 
    635559      // construct 3D pane 
     
    773697 
    774698      setProgress(progress, 990); // estimate: 99% 
    775       if (progress.isCanceled()) System.exit(0); 
    776699 
    777700      JPanel colorPanel = new JPanel(); 
     
    852775      }; 
    853776      rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS)); 
    854       rightPanel.add(intensityPane); 
     777      rightPanel.add(twoDPane); 
    855778      rightPanel.add(console.getWindow().getContentPane()); 
    856779      BreakawayPanel breakawayPanel = new BreakawayPanel(masterPane, 
     
    862785 
    863786      setProgress(progress, 999); // estimate: 99.9% 
    864       if (progress.isCanceled()) System.exit(0); 
    865787 
    866788      // show window on screen 
     
    883805    } 
    884806 
    885     setProgress(progress, 1000); 
     807    setProgress(progress, 1000); // 100% 
    886808    progress.close(); 
    887809 
     
    1057979        PrintWriter out = new PrintWriter(new FileWriter(file)); 
    1058980        out.println(timeBins + " x " + channels + 
    1059           " (count=" + intensityPane.getROICount() + 
    1060           ", percent=" + intensityPane.getROIPercent() + 
     981          " (count=" + twoDPane.getROICount() + 
     982          ", percent=" + twoDPane.getROIPercent() + 
    1061983          ", maxVal=" + maxVal + ")"); 
    1062984        for (int c=0; c<channels; c++) { 
     
    11691091          int ndx = timeBins * cc + t; 
    11701092          int sum = 0; 
    1171           if (intensityPane.getROICount() == 1) { 
    1172             int roiX = intensityPane.getROIX(); 
    1173             int roiY = intensityPane.getROIY(); 
     1093          if (twoDPane.getROICount() == 1) { 
     1094            int roiX = twoDPane.getROIX(); 
     1095            int roiY = twoDPane.getROIY(); 
    11741096            sum = values[c][roiY][roiX][t]; 
    11751097          } 
    11761098          else { 
    1177             boolean[][] roiMask = intensityPane.getROIMask(); 
     1099            boolean[][] roiMask = twoDPane.getROIMask(); 
    11781100            for (int h=0; h<height; h++) { 
    11791101              for (int w=0; w<width; w++) { 
     
    11851107          if (samps[ndx] > maxVal) maxVal = samps[ndx]; 
    11861108          if (samps[ndx] > maxVals[cc]) maxVals[cc] = samps[ndx]; 
    1187           setProgress(progress, ++p); 
     1109          setProgress(progress, ++p, false); 
    11881110          if (progress.isCanceled()) plotCanceled = true; 
    11891111          if (plotCanceled) break; 
     
    12051127          int sumTotal = 0; 
    12061128          for (int t=0; t<timeBins; t++) { 
    1207             if (intensityPane.getROICount() == 1) { 
    1208               int roiX = intensityPane.getROIX(); 
    1209               int roiY = intensityPane.getROIY(); 
     1129            if (twoDPane.getROICount() == 1) { 
     1130              int roiX = twoDPane.getROIX(); 
     1131              int roiY = twoDPane.getROIY(); 
    12101132              sums[t] = values[c][roiY][roiX][t]; 
    12111133            } 
    12121134            else { 
    1213               boolean[][] roiMask = intensityPane.getROIMask(); 
     1135              boolean[][] roiMask = twoDPane.getROIMask(); 
    12141136              for (int h=0; h<height; h++) { 
    12151137                for (int w=0; w<width; w++) { 
     
    13191241          fitResults[c][2 * numExp] = results[0][2]; 
    13201242 
    1321           setProgress(progress, ++p); 
     1243          setProgress(progress, ++p, false); 
    13221244          cc++; 
    13231245        } 
     
    13341256      StringBuffer sb = new StringBuffer(); 
    13351257      sb.append("Decay curve for "); 
    1336       if (intensityPane.getROICount() == 1) { 
    1337         int roiX = intensityPane.getROIX(); 
    1338         int roiY = intensityPane.getROIY(); 
     1258      if (twoDPane.getROICount() == 1) { 
     1259        int roiX = twoDPane.getROIX(); 
     1260        int roiY = twoDPane.getROIY(); 
    13391261        sb.append("("); 
    13401262        sb.append(roiX); 
     
    13441266      } 
    13451267      else { 
    1346         sb.append(intensityPane.getROICount()); 
     1268        sb.append(twoDPane.getROICount()); 
    13471269        sb.append(" pixels ("); 
    1348         sb.append(intensityPane.getROIPercent()); 
     1270        sb.append(twoDPane.getROIPercent()); 
    13491271        sb.append("%)"); 
    13501272      } 
     
    14861408      catch (VisADException exc) { exc.printStackTrace(); } 
    14871409      catch (RemoteException exc) { exc.printStackTrace(); } 
    1488       setProgress(progress, ++p); 
     1410      setProgress(progress, ++p, false); 
    14891411      progress.close(); 
    14901412 
     
    15381460 
    15391461  // -- Helper methods -- 
     1462 
     1463  private void showParamDialog() { 
     1464    paramDialog = new JDialog((Frame) null, "Slim Plotter", true); 
     1465    JPanel paramPane = new JPanel(); 
     1466    paramPane.setBorder(new EmptyBorder(10, 10, 10, 10)); 
     1467    paramDialog.setContentPane(paramPane); 
     1468    paramPane.setLayout(new GridLayout(13, 3)); 
     1469    wField = addRow(paramPane, "Image width", width, "pixels"); 
     1470    hField = addRow(paramPane, "Image height", height, "pixels"); 
     1471    tField = addRow(paramPane, "Time bins", timeBins, ""); 
     1472    cField = addRow(paramPane, "Channel count", channels, ""); 
     1473    trField = addRow(paramPane, "Time range", timeRange, "nanoseconds"); 
     1474    wlField = addRow(paramPane, "Starting wavelength", minWave, "nanometers"); 
     1475    sField = addRow(paramPane, "Channel width", waveStep, "nanometers"); 
     1476    fitField = addRow(paramPane, "Exponential fit", 1, "components"); 
     1477    JButton ok = new JButton("OK"); 
     1478    paramDialog.getRootPane().setDefaultButton(ok); 
     1479    ok.addActionListener(this); 
     1480    // row 8 
     1481    paramPane.add(new JLabel("Fit algorithm")); 
     1482    lmChoice = new JRadioButton("Levenberg-Marquardt"); 
     1483    gaChoice = new JRadioButton("Genetic", true); 
     1484    ButtonGroup group = new ButtonGroup(); 
     1485    group.add(lmChoice); 
     1486    group.add(gaChoice); 
     1487    paramPane.add(lmChoice); 
     1488    paramPane.add(gaChoice); 
     1489    // row 9 
     1490    paramPane.add(new JLabel()); 
     1491    paramPane.add(new JLabel()); 
     1492    paramPane.add(new JLabel()); 
     1493    // row 10, column 1 
     1494    peaksBox = new JCheckBox("Align peaks", true); 
     1495    peaksBox.setToolTipText("<html>Computes the peak of each spectral " + 
     1496      "channel, and aligns those peaks <br>to match by adjusting the " + 
     1497      "lifetime histograms. This option corrects<br>for skew across " + 
     1498      "channels caused by the multispectral detector's<br>variable system " + 
     1499      "response time between channels. This option must<br>be enabled to " + 
     1500      "perform exponential curve fitting.</html>"); 
     1501    paramPane.add(peaksBox); 
     1502    // row 10, column 2 
     1503    fwhmBox = new JCheckBox("Compute FWHMs", false); 
     1504    fwhmBox.setToolTipText( 
     1505      "<html>Computes the full width half max at each channel.</html>"); 
     1506    paramPane.add(fwhmBox); 
     1507    // row 10, column 3 
     1508    cutBox = new JCheckBox("Cut 1.5ns from fit", true); 
     1509    cutBox.setToolTipText("<html>When performing exponential curve " + 
     1510      "fitting, excludes the last 1.5 ns<br>from the computation. This " + 
     1511      "option is useful because the end of the <br>the lifetime histogram " + 
     1512      "sometimes drops off unexpectedly, skewing<br>the fit results.</html>"); 
     1513    paramPane.add(cutBox); 
     1514    // row 11 
     1515    paramPane.add(new JLabel()); 
     1516    paramPane.add(new JLabel()); 
     1517    paramPane.add(new JLabel()); 
     1518    // row 12 
     1519    paramPane.add(new JLabel()); 
     1520    paramPane.add(ok); 
     1521    paramDialog.pack(); 
     1522    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 
     1523    Dimension ps = paramDialog.getSize(); 
     1524    paramDialog.setLocation((screenSize.width - ps.width) / 2, 
     1525      (screenSize.height - ps.height) / 2); 
     1526    paramDialog.setVisible(true); 
     1527  } 
    15401528 
    15411529  /** Converts value in picoseconds to histogram bins. */ 
     
    16471635  { 
    16481636    p.add(new JLabel(label)); 
    1649     JTextField field = new JTextField(value == (int) value ? 
     1637    JTextField textField = new JTextField(value == (int) value ? 
    16501638      ("" + (int) value) : ("" + value), 8); 
    1651     JPanel fieldPane = new JPanel(); 
    1652     fieldPane.setLayout(new BorderLayout()); 
    1653     fieldPane.add(field, BorderLayout.CENTER); 
    1654     fieldPane.setBorder(new EmptyBorder(2, 3, 2, 3)); 
    1655     p.add(fieldPane); 
     1639    JPanel textFieldPane = new JPanel(); 
     1640    textFieldPane.setLayout(new BorderLayout()); 
     1641    textFieldPane.add(textField, BorderLayout.CENTER); 
     1642    textFieldPane.setBorder(new EmptyBorder(2, 3, 2, 3)); 
     1643    p.add(textFieldPane); 
    16561644    p.add(new JLabel(unit)); 
    1657     return field; 
     1645    return textField; 
    16581646  } 
    16591647 
     
    16681656  } 
    16691657 
    1670   /** Updates progress monitor status; mainly for debugging. */ 
    16711658  private static void setProgress(ProgressMonitor progress, int p) { 
     1659    setProgress(progress, p, false); 
     1660  } 
     1661 
     1662  private static void setProgress(ProgressMonitor progress, 
     1663    int p, boolean quitOnCancel) 
     1664  { 
    16721665    progress.setProgress(p); 
     1666    if (quitOnCancel && progress.isCanceled()) System.exit(0); 
    16731667  } 
    16741668 
  • trunk/loci/slim/TwoDPane.java

    r4215 r4224  
    11// 
    2 // IntensityPane.java 
     2// TwoDPane.java 
    33// 
    44 
     
    4646 * 
    4747 * <dl><dt><b>Source code:</b></dt> 
    48  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/loci/slim/IntensityPane.java">Trac</a>, 
    49  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/loci/slim/IntensityPane.java">SVN</a></dd></dl> 
     48 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/loci/slim/TwoDPane.java">Trac</a>, 
     49 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/loci/slim/TwoDPane.java">SVN</a></dd></dl> 
    5050 * 
    5151 * @author Curtis Rueden ctrueden at wisc.edu 
    5252 */ 
    53 public class IntensityPane extends JPanel 
     53public class TwoDPane extends JPanel 
    5454  implements ActionListener, ChangeListener, DisplayListener, DocumentListener 
    5555{ 
     
    7878 
    7979  // GUI components for intensity pane 
     80  private JRadioButton intensityMode, lifetimeMode, spectraMode; 
    8081  private JSlider cSlider; 
    8182  private JTextField minField, maxField; 
     
    8485  // -- Constructor -- 
    8586 
    86   public IntensityPane(SlimPlotter slim, FieldImpl field, 
     87  public TwoDPane(SlimPlotter slim, FieldImpl field, 
    8788    int width, int height, int channels, 
    88     int max, int maxChan, boolean[] cVisible, 
     89    int globalMax, int maxChan, boolean[] cVisible, 
    8990    RealType xType, RealType yType, RealType vType, RealType cType) 
    9091    throws VisADException, RemoteException 
     
    182183    add(iPlotPane); 
    183184 
     185    JPanel viewModePane = new JPanel(); 
     186    viewModePane.setLayout(new BoxLayout(viewModePane, BoxLayout.X_AXIS)); 
     187    add(viewModePane); 
     188 
    184189    JPanel sliderPane = new JPanel(); 
    185190    sliderPane.setLayout(new BoxLayout(sliderPane, BoxLayout.X_AXIS)); 
     
    212217    minLabel.setPreferredSize(maxLabel.getPreferredSize()); 
    213218    maxPane.add(maxLabel); 
    214     maxField = new JTextField("" + max, 4); 
     219    maxField = new JTextField("" + globalMax, 4); 
    215220    maxField.setMaximumSize(maxField.getPreferredSize()); 
    216221    maxField.setToolTipText("<html>" + 
     
    238243    sliderPane.add(cToggle); 
    239244 
     245    rescaleMinMax(); 
     246 
     247    viewModePane.add(new JLabel("View mode:")); 
     248    intensityMode = new JRadioButton("Intensity", true); 
     249    lifetimeMode = new JRadioButton("Lifetime"); 
     250    spectraMode = new JRadioButton("Spectra"); 
     251    spectraMode.setEnabled(false); 
     252    ButtonGroup group = new ButtonGroup(); 
     253    group.add(intensityMode); 
     254    group.add(lifetimeMode); 
     255    group.add(spectraMode); 
     256    intensityMode.addActionListener(this); 
     257    lifetimeMode.addActionListener(this); 
     258    spectraMode.addActionListener(this); 
     259    viewModePane.add(Box.createHorizontalStrut(5)); 
     260    viewModePane.add(intensityMode); 
     261    viewModePane.add(lifetimeMode); 
     262    viewModePane.add(spectraMode); 
     263 
    240264    cSlider.setValue(maxChan + 1); 
    241     rescaleMinMax(); 
    242     /* 
    243     JPanel minMaxPane = new JPanel(); 
    244     minMaxPane.setLayout(new BoxLayout(minMaxPane, BoxLayout.X_AXIS)); 
    245     add(minMaxPane); 
    246  
    247     JPanel minPane = new JPanel(); 
    248     minPane.setLayout(new BoxLayout(minPane, BoxLayout.Y_AXIS)); 
    249     minMaxPane.add(minPane); 
    250     minLabel = new JLabel("min=0"); 
    251     minLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); 
    252     minPane.add(minLabel); 
    253     minSlider = new JSlider(0, max, 0); 
    254     minSlider.setToolTipText("<html>" + 
    255       "Adjusts intensity plot's minimum color value.<br>" + 
    256       "Anything less than this value appears black.</html>"); 
    257     minSlider.setMajorTickSpacing(max); 
    258     int minor = max / 16; 
    259     if (minor < 1) minor = 1; 
    260     minSlider.setMinorTickSpacing(minor); 
    261     minSlider.setPaintTicks(true); 
    262     minSlider.addChangeListener(this); 
    263     minSlider.setBorder(new EmptyBorder(0, 5, 8, 5)); 
    264     minPane.add(minSlider); 
    265  
    266     JPanel maxPane = new JPanel(); 
    267     maxPane.setLayout(new BoxLayout(maxPane, BoxLayout.Y_AXIS)); 
    268     minMaxPane.add(maxPane); 
    269     maxLabel = new JLabel("max=" + max); 
    270     maxLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); 
    271     maxPane.add(maxLabel); 
    272     maxSlider = new JSlider(0, max, max); 
    273     maxSlider.setMajorTickSpacing(max); 
    274     maxSlider.setMinorTickSpacing(minor); 
    275     maxSlider.setPaintTicks(true); 
    276     maxSlider.addChangeListener(this); 
    277     maxSlider.setBorder(new EmptyBorder(0, 5, 8, 5)); 
    278     maxPane.add(maxSlider); 
    279     */ 
    280   } 
    281  
    282   // -- IntensityPane methods -- 
     265  } 
     266 
     267  // -- TwoDPane methods -- 
    283268 
    284269  public int getROICount() { return roiCount; } 
     
    292277  /** Handles checkbox presses. */ 
    293278  public void actionPerformed(ActionEvent e) { 
    294     // toggle visibility of this channel 
    295     int c = cSlider.getValue() - 1; 
    296     cVisible[c] = !cVisible[c]; 
    297     slim.plotData(true, true, false); 
     279    Object src = e.getSource(); 
     280    if (src == cToggle) { 
     281      // toggle visibility of this channel 
     282      int c = cSlider.getValue() - 1; 
     283      cVisible[c] = !cVisible[c]; 
     284      slim.plotData(true, true, false); 
     285    } 
     286    else if (src == intensityMode) { 
     287      // TODO 
     288    } 
     289    else if (src == lifetimeMode) { 
     290      // TODO 
     291    } 
     292    else if (src == spectraMode) { 
     293      // TODO - spectral projection 
     294      // https://skyking.microscopy.wisc.edu/trac/java/ticket/86 
     295    } 
    298296  } 
    299297 
Note: See TracChangeset for help on using the changeset viewer.