Changeset 7886 for trunk


Ignore:
Timestamp:
02/03/12 20:22:06 (8 years ago)
Author:
aivar
Message:

SLIMPlugin: Tidied up a bit. Fixed minor bugs in decay graph, histogram, and user interface panel.

Location:
trunk/projects/slim-plugin/src/main/java
Files:
2 deleted
4 edited

Legend:

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

    r7879 r7886  
    216216     */ 
    217217    public void setCursors(Integer minCursor, Integer maxCursor) { 
     218        System.out.println("setCursors(" + minCursor + "," + maxCursor); 
    218219        synchronized (_synchObject) { 
    219220            if (null == minCursor) { 
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramTool.java

    r7879 r7886  
    155155         
    156156        _histogramPanel.setBins(histogramData.binValues(WIDTH)); 
    157         //_histogramPanel.setCursors(0.0, 0.0); set cursors if not autoranging 
    158  
     157        System.out.println("minMaxLUT is " + minMaxLUT[0] + " " + minMaxLUT[1]); 
     158        System.out.println("so cursosr are " + cursorPixelFromValue(false, minMaxLUT[0]) + " " + cursorPixelFromValue(false, minMaxLUT[1])); 
     159        _histogramPanel.setCursors(cursorPixelFromValue(false, minMaxLUT[0]), cursorPixelFromValue(false, minMaxLUT[1])); //TODO ARG true, maxLUT)); in this case adding 1 to max is too much! 
     160  
    159161        _uiPanel.setAutoRange(histogramData.getAutoRange()); 
    160162        _uiPanel.setCombineChannels(histogramData.getCombineChannels()); 
     
    463465                    // note that if you stretch the bounds on one side you need 
    464466                    // to adjust the position of the other side. 
    465                     _histogramPanel.setCursors(cursorPixelFromValue(false, minLUT), cursorPixelFromValue(true, maxLUT)); 
     467                    _histogramPanel.setCursors(cursorPixelFromValue(false, minLUT), cursorPixelFromValue(false, maxLUT)); //TODO ARG true, maxLUT)); in this case adding 1 to max is too much! 
    466468                } 
    467469            } 
  • trunk/projects/slim-plugin/src/main/java/loci/slim/refactor/ui/charts/DecayGraph.java

    r7804 r7886  
    276276        decayRenderer.setSeriesLinesVisible(2, false); 
    277277        decayRenderer.setSeriesShape 
    278                 (2, new Ellipse2D.Float(2.0f, 2.0f, 2.0f, 2.0f)); 
     278                (2, new Ellipse2D.Float(-1.0f, -1.0f, 2.0f, 2.0f)); 
    279279 
    280280        decayRenderer.setSeriesPaint(0, IRF_COLOR); 
  • trunk/projects/slim-plugin/src/main/java/loci/slim/ui/UserInterfacePanel.java

    r7875 r7886  
    8686    private static final Character SUB_3  = '\u2083'; 
    8787     
    88     private static final String SUM_REGION = "Sum All"; 
     88    private static final String SUM_REGION = "Sum All Pixels"; 
    8989    private static final String ROIS_REGION = "Sum Each ROI"; 
    9090    private static final String PIXEL_REGION = "Single Pixel"; 
    91     private static final String ALL_REGION = "Each Pixel"; 
     91    private static final String ALL_REGION = "Image"; 
    9292     
    9393    private static final String JAOLHO_LMA_ALGORITHM = "Jaolho LMA"; 
     
    111111    private static final String EXCITATION_FILE = "Load from File"; 
    112112    private static final String EXCITATION_CREATE = "Use current X Y"; 
    113      
    114     private static final String MAKE_IMAGES = "Make Images"; 
     113 
     114    private static final String FIT_IMAGE = "Fit Image"; 
     115    private static final String FIT_PIXEL = "Fit Pixel"; 
     116    private static final String FIT_SUMMED_PIXELS = "Fit Summed Pixels"; 
     117    private static final String FIT_SUMMED_ROIS = "Fit Summed ROIs"; 
    115118    private static final String CANCEL_IMAGES = "Cancel Images"; 
    116119 
     
    230233    JButton m_quitButton; 
    231234    JButton m_fitButton; 
     235    String m_fitButtonText = FIT_IMAGE; 
    232236 
    233237    public UserInterfacePanel(boolean showTau, String[] analysisChoices, String[] binningChoices) { 
     
    280284        buttonPanel.add(m_quitButton); 
    281285        buttonPanel.add(Box.createRigidArea(new Dimension(10, 0))); 
    282         m_fitButton = new JButton(MAKE_IMAGES); 
     286        m_fitButton = new JButton(m_fitButtonText); 
    283287        m_fitButton.addActionListener( 
    284288            new ActionListener() { 
    285289                public void actionPerformed(ActionEvent e) { 
    286290                    String text = (String)e.getActionCommand(); 
    287                     if (text.equals(MAKE_IMAGES)) { 
     291                    if (text.equals(m_fitButtonText)) { 
    288292                        enableAll(false); 
    289293                        setFitButtonState(false); 
     
    347351        m_regionComboBox = new JComboBox(REGION_ITEMS); 
    348352        m_regionComboBox.setSelectedItem(ALL_REGION); 
     353        m_regionComboBox.addItemListener( 
     354            new ItemListener() { 
     355                public void itemStateChanged(ItemEvent e) { 
     356                    if (e.getStateChange() == ItemEvent.SELECTED) { 
     357                        String item = (String) e.getItem(); 
     358                        if (SUM_REGION == item) { 
     359                            m_fitButtonText = FIT_SUMMED_PIXELS; 
     360                        } 
     361                        else if (ROIS_REGION == item) { 
     362                            m_fitButtonText = FIT_SUMMED_ROIS; 
     363                        } 
     364                        else if (PIXEL_REGION == item) { 
     365                            m_fitButtonText = FIT_PIXEL; 
     366                        } 
     367                        else if (ALL_REGION == item) { 
     368                            m_fitButtonText = FIT_IMAGE; 
     369                        } 
     370                        m_fitButton.setText(m_fitButtonText); 
     371                    } 
     372                } 
     373            } 
     374        ); 
    349375        fitPanel.add(m_regionComboBox); 
    350376 
     
    913939     
    914940    private void setFitButtonState(boolean on) { 
    915         m_fitButton.setText(on ? MAKE_IMAGES : CANCEL_IMAGES); 
     941        m_fitButton.setText(on ? m_fitButtonText : CANCEL_IMAGES); 
    916942    } 
    917943     
    918944    private boolean getFitButtonState() { 
    919         return m_fitButton.getText().equals(MAKE_IMAGES); 
     945        return m_fitButton.getText().equals(m_fitButtonText); 
    920946    } 
    921947 
Note: See TracChangeset for help on using the changeset viewer.