Changeset 7861 for trunk


Ignore:
Timestamp:
12/30/11 16:12:34 (8 years ago)
Author:
aivar
Message:

HistogramTool has problems finding the lifetime LUT on Linux when Fiji is run from a link. This version puts out more diagnostics. UIPanel had some NumberFormatExceptions, also in Linux.

Location:
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramTool.java

    r7850 r7861  
    9898        IndexColorModel colorModel = null; 
    9999        // 'getDirectory("luts")' works in IJ but not during NetBeans development 
     100        //TODO On Linux with a link to Fiji on the desktop this startup directory is the desktop! 
    100101        String startupPath = IJ.getDirectory("startup"); 
    101102        String lutPath = startupPath + "luts" + File.separatorChar + LUT; 
     
    104105        } 
    105106        catch (IOException e) { 
     107            IJ.log("Problem loading LUT " + lutPath); 
    106108            System.out.println("Problem loading LUT " + lutPath); 
    107109        } 
    108  
    109110        // IJ converts the FloatProcessor to 8-bits and then uses this palette 
    110111        // for display.  Unfortunately values less than or greater than the LUT 
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/UIPanel.java

    r7851 r7861  
    1414import javax.swing.JPanel; 
    1515import javax.swing.JTextField; 
     16 
     17import ij.IJ; 
    1618 
    1719/** 
     
    203205        DoubleFormatter minFormatter = new DoubleFormatter(true, DIGITS, min); 
    204206        _minTextField.setText(minFormatter.getText()); 
    205         _minLUT = Double.parseDouble(_minTextField.getText()); 
     207        try { 
     208            _minLUT = Double.parseDouble(_minTextField.getText()); 
     209        } 
     210        catch (NumberFormatException e) { 
     211            IJ.log("Error parsing min '" + minFormatter.getText() + "' " + e); 
     212        } 
    206213        DoubleFormatter maxFormatter = new DoubleFormatter(false, DIGITS, max); 
    207214        _maxTextField.setText(maxFormatter.getText()); 
    208         _maxLUT = Double.parseDouble(_maxTextField.getText()); 
     215        try { 
     216            _maxLUT = Double.parseDouble(_maxTextField.getText()); 
     217        } 
     218        catch (NumberFormatException e) { 
     219            IJ.log("Error parsing max '" + maxFormatter.getText() + "' " + e); 
     220        } 
    209221    }     
    210222} 
Note: See TracChangeset for help on using the changeset viewer.