Ignore:
Timestamp:
03/17/11 20:48:54 (9 years ago)
Author:
aivar
Message:

Fixed various bugs. Made export to text better.

Location:
trunk/projects/slim-plugin/src/main/java/loci/slim/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/loci/slim/ui/IUserInterfacePanel.java

    r7653 r7658  
    9595 
    9696    /** 
    97      * Gets analysis plugin name. 
    98      * 
    99      * @return analysis plugin name 
    100      */ 
    101     public String getAnalysis(); 
     97     * Gets analysis plugin names. 
     98     * 
     99     * @return analysis plugin names 
     100     */ 
     101    public String[] getAnalysisList(); 
    102102 
    103103    /** 
  • trunk/projects/slim-plugin/src/main/java/loci/slim/ui/UserInterfacePanel.java

    r7654 r7658  
    4444import java.awt.event.ItemEvent; 
    4545import java.awt.event.ItemListener; 
     46import java.util.ArrayList; 
     47import java.util.List; 
    4648 
    4749import javax.swing.border.Border; 
     
    109111 
    110112    private static final String EXCITATION_NONE = "None"; 
    111     private static final String EXCITATION_FILE = "File"; 
     113    private static final String EXCITATION_FILE = "Load from File"; 
    112114    private static final String EXCITATION_CREATE = "Use current X Y"; 
    113115     
     
    138140    JComboBox m_algorithmComboBox; 
    139141    JComboBox m_functionComboBox; 
    140     JComboBox m_analysisComboBox; 
     142    JCheckBox[] m_analysisCheckBoxList; 
    141143    JCheckBox m_fitAllChannels; 
    142144 
     
    349351        fitPanel.add(m_functionComboBox); 
    350352 
    351         JLabel analysisLabel = new JLabel("Analysis"); 
    352         analysisLabel.setHorizontalAlignment(SwingConstants.RIGHT); 
    353         fitPanel.add(analysisLabel); 
    354         m_analysisComboBox = new JComboBox(analysisChoices); 
    355         fitPanel.add(m_analysisComboBox); 
    356  
     353        int choices = analysisChoices.length; 
     354        if (choices > 0) { 
     355            List<JCheckBox> checkBoxList = new ArrayList<JCheckBox>(); 
     356            boolean firstChoice = true; 
     357            for (String analysisChoice : analysisChoices) { 
     358                String labelString = firstChoice ? "Analysis" : ""; 
     359                firstChoice = false; 
     360                JLabel choiceLabel = new JLabel(labelString); 
     361                choiceLabel.setHorizontalAlignment(SwingConstants.RIGHT); 
     362                fitPanel.add(choiceLabel); 
     363                JCheckBox checkBox = new JCheckBox(analysisChoice); 
     364                fitPanel.add(checkBox); 
     365                checkBoxList.add(checkBox); 
     366            } 
     367            m_analysisCheckBoxList = checkBoxList.toArray(new JCheckBox[0]); 
     368        } 
     369         
    357370        // rows, cols, initX, initY, xPad, yPad 
    358         SpringUtilities.makeCompactGrid(fitPanel, 4, 2, 4, 4, 4, 4); 
     371        SpringUtilities.makeCompactGrid(fitPanel, 3 + choices, 2, 4, 4, 4, 4); 
    359372 
    360373        JPanel panel = new JPanel(new BorderLayout()); 
     
    845858        m_algorithmComboBox.setEnabled(enable); 
    846859        m_functionComboBox.setEnabled(enable); 
    847         m_analysisComboBox.setEnabled(enable); 
     860        for (JCheckBox checkBox : m_analysisCheckBoxList) { 
     861            checkBox.setEnabled(enable); 
     862        } 
     863        //m_analysisComboBox.setEnabled(enable); 
    848864        m_fitAllChannels.setEnabled(enable); 
    849865 
     
    967983    } 
    968984 
    969     public String getAnalysis() { 
    970         String selected = (String) m_analysisComboBox.getSelectedItem(); 
    971         return selected; 
     985    public String[] getAnalysisList() { 
     986        List<String> analysisList = new ArrayList<String>(); 
     987        for (JCheckBox checkBox : m_analysisCheckBoxList) { 
     988            if (checkBox.isSelected()) { 
     989                analysisList.add(checkBox.getText()); 
     990            } 
     991        } 
     992        return analysisList.toArray(new String[0]); 
    972993    } 
    973994 
Note: See TracChangeset for help on using the changeset viewer.