Ignore:
Timestamp:
12/23/11 16:33:55 (8 years ago)
Author:
aivar
Message:

Changed the hardcoded LUT path from platform specific to IJ relative.

File:
1 edited

Legend:

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

    r7848 r7850  
    99import java.io.IOException; 
    1010 
     11import ij.IJ; 
    1112import ij.plugin.LutLoader; 
    1213import ij.process.ByteProcessor; 
     
    1920import java.awt.event.ItemEvent; 
    2021import java.awt.event.ItemListener; 
     22import java.io.File; 
    2123import java.util.Timer; 
    2224import java.util.TimerTask; 
     
    4446    private final static int COLORBAR_HEIGHT = 20; 
    4547    private final static int TASK_PERIOD = 100; 
    46     //TODO kludged in, user s/b able to select LUTS, somewhere else: 
    47     //TODO note that most IJ LUTs are unsuitable here, so having one standard lifetime LUT is not so bad 
    48     private final static String HARDCODED_LUT =  "/Applications/ImageJ/luts/aivar6.lut"; // aivar6 is my five color blue/cyan/green/yellow/red spectral palette 
     48    private final static String LUT = "lifetime.lut"; 
    4949    private static HistogramTool INSTANCE = null; 
    5050    private final Object _synchObject = new Object(); 
     
    6464        _colorBarPanel = new ColorBarPanel(WIDTH, INSET, COLORBAR_HEIGHT); 
    6565        _colorBarPanel.setLUT(getLUT()); 
    66         _uiPanel = new UIPanel(true); 
     66        _uiPanel = new UIPanel(false); // true); 
    6767        _uiPanel.setListener(new UIPanelListener()); 
    6868 
    6969        _frame = new JFrame("Histogram"); 
    7070        _frame.setResizable(false); 
    71         _frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //TODO kind of lame, for now 
     71        //_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //TODO kind of lame, for now 
    7272        _frame.getContentPane().add(_histogramPanel, BorderLayout.NORTH); 
    7373        _frame.getContentPane().add(_colorBarPanel, BorderLayout.CENTER); 
     
    9797    public static IndexColorModel getIndexColorModel() { 
    9898        IndexColorModel colorModel = null; 
     99        // 'getDirectory("luts")' works in IJ but not during NetBeans development 
     100        String startupPath = IJ.getDirectory("startup"); 
     101        String lutPath = startupPath + "luts" + File.separatorChar + LUT; 
    99102        try { 
    100             colorModel = LutLoader.open(HARDCODED_LUT); 
     103            colorModel = LutLoader.open(lutPath); 
    101104        } 
    102105        catch (IOException e) { 
    103             System.out.println("Error opening LUT " + e.getMessage()); 
     106            System.out.println("Problem loading LUT " + lutPath); 
    104107        } 
    105108 
Note: See TracChangeset for help on using the changeset viewer.