Search in sources :

Example 1 with NumberKeyListener

use of uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener in project SeqMonk by s-andrews.

the class CoverageQuantitation method getOptionsPanel.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
	 */
public JPanel getOptionsPanel() {
    if (optionPanel != null) {
        // We've done this already
        return optionPanel;
    }
    optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    optionPanel.add(new JLabel("Count reads on strand"), gbc);
    gbc.gridx = 2;
    strandLimit = new JComboBox(QuantitationStrandType.getTypeOptions());
    optionPanel.add(strandLimit, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Min Read Depth"), gbc);
    gbc.gridx = 2;
    depthLimitField = new JTextField("" + depthLimit, 5);
    depthLimitField.addKeyListener(new NumberKeyListener(false, false));
    optionPanel.add(depthLimitField, gbc);
    return optionPanel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)

Example 2 with NumberKeyListener

use of uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener in project SeqMonk by s-andrews.

the class EnrichmentNormalisationQuantitation method getOptionsPanel.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
	 */
public JPanel getOptionsPanel() {
    if (optionPanel != null) {
        // We've done this already
        return optionPanel;
    }
    optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    optionPanel.add(new JLabel("Lower Percentile"), gbc);
    lowerPercentileField = new JTextField("" + lowerPercentile);
    lowerPercentileField.addKeyListener(new NumberKeyListener(true, false));
    gbc.gridx++;
    optionPanel.add(lowerPercentileField, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Upper Percentile"), gbc);
    gbc.gridx = 2;
    upperPercentileField = new JTextField("" + upperPercentile);
    upperPercentileField.addKeyListener(new NumberKeyListener(true, false));
    optionPanel.add(upperPercentileField, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Ignore unquantitated probes"), gbc);
    ignoreUnquantitatedBox = new JCheckBox("", true);
    gbc.gridx++;
    optionPanel.add(ignoreUnquantitatedBox, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Calculate from probe list"), gbc);
    ProbeList[] currentLists = application.dataCollection().probeSet().getAllProbeLists();
    calculateFromProbeList = new JComboBox(currentLists);
    calculateFromProbeList.setPrototypeDisplayValue("No longer than this please");
    for (int i = 0; i < currentLists.length; i++) {
        if (currentLists[i] == application.dataCollection().probeSet().getActiveList()) {
            calculateFromProbeList.setSelectedIndex(i);
        }
    }
    gbc.gridx++;
    optionPanel.add(calculateFromProbeList, gbc);
    return optionPanel;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)

Example 3 with NumberKeyListener

use of uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener in project SeqMonk by s-andrews.

the class SmoothingSubtractionQuantitation method getOptionsPanel.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
	 */
public JPanel getOptionsPanel() {
    if (optionPanel != null) {
        // We've done this already
        return optionPanel;
    }
    optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    optionPanel.add(new JLabel("Smoothing method"), gbc);
    gbc.gridx = 2;
    correctionActions = new JComboBox(new String[] { "Adjacent Probes", "Window Size" });
    optionPanel.add(correctionActions, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Size"), gbc);
    distanceField = new JTextField("" + distance);
    distanceField.addKeyListener(new NumberKeyListener(false, false));
    distanceField.addKeyListener(new KeyListener() {

        public void keyTyped(KeyEvent arg0) {
        }

        public void keyReleased(KeyEvent arg0) {
            optionsChanged();
        }

        public void keyPressed(KeyEvent arg0) {
        }
    });
    gbc.gridx++;
    optionPanel.add(distanceField, gbc);
    return optionPanel;
}
Also used : KeyEvent(java.awt.event.KeyEvent) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) KeyListener(java.awt.event.KeyListener) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener) JTextField(javax.swing.JTextField) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)

Example 4 with NumberKeyListener

use of uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener in project SeqMonk by s-andrews.

the class PercentileNormalisationQuantitation method getOptionsPanel.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
	 */
public JPanel getOptionsPanel() {
    if (optionPanel != null) {
        // We've done this already
        return optionPanel;
    }
    optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    optionPanel.add(new JLabel("Method of correction"), gbc);
    gbc.gridx = 2;
    correctionActions = new JComboBox(new String[] { "Add", "Multiply" });
    optionPanel.add(correctionActions, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Percentile"), gbc);
    JPanel percentilePanel = new JPanel();
    percentilePanel.setLayout(new BorderLayout());
    autoPercentileBox = new JCheckBox("Auto", false);
    percentilePanel.add(autoPercentileBox, BorderLayout.WEST);
    percentileField = new JTextField("" + percentile);
    percentileField.addKeyListener(new NumberKeyListener(true, false));
    percentilePanel.add(percentileField, BorderLayout.CENTER);
    autoPercentileBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            percentileField.setEnabled(!autoPercentileBox.isSelected());
        }
    });
    gbc.gridx++;
    optionPanel.add(percentilePanel, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Ignore unquantitated probes"), gbc);
    ignoreUnquantitatedBox = new JCheckBox("", true);
    gbc.gridx++;
    optionPanel.add(ignoreUnquantitatedBox, gbc);
    gbc.gridx = 1;
    gbc.gridy++;
    optionPanel.add(new JLabel("Calculate from probe list"), gbc);
    ProbeList[] currentLists = application.dataCollection().probeSet().getAllProbeLists();
    calculateFromProbeList = new JComboBox(currentLists);
    calculateFromProbeList.setPrototypeDisplayValue("No longer than this please");
    for (int i = 0; i < currentLists.length; i++) {
        if (currentLists[i] == application.dataCollection().probeSet().getActiveList()) {
            calculateFromProbeList.setSelectedIndex(i);
        }
    }
    gbc.gridx++;
    optionPanel.add(calculateFromProbeList, gbc);
    return optionPanel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) JCheckBox(javax.swing.JCheckBox) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)

Example 5 with NumberKeyListener

use of uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener in project SeqMonk by s-andrews.

the class DeduplicationProbeGenerator method getOptionsPanel.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.ProbeGenerators.ProbeGenerator#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
	 */
public JPanel getOptionsPanel() {
    if (optionPanel != null) {
        // We've done this already
        return optionPanel;
    }
    optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    optionPanel.add(new JLabel("Starting Probe List"), gbc);
    gbc.gridx = 2;
    if (collection.probeSet() == null) {
        probeListBox = new JComboBox(new ProbeList[0]);
    } else {
        probeListBox = new JComboBox(collection.probeSet().getAllProbeLists());
    }
    probeListBox.setPrototypeDisplayValue("No longer than this please");
    probeListBox.addItemListener(this);
    optionPanel.add(probeListBox, gbc);
    gbc.gridy++;
    gbc.gridx = 1;
    optionPanel.add(new JLabel("Merge probes separated by less than (bp)"), gbc);
    gbc.gridx = 2;
    maxDistanceField = new JTextField("0");
    maxDistanceField.addKeyListener(new NumberKeyListener(false, false));
    optionPanel.add(maxDistanceField, gbc);
    gbc.gridy++;
    gbc.gridx = 1;
    optionPanel.add(new JLabel("Merge strands separately"), gbc);
    gbc.gridx = 2;
    separateStrandsBox = new JCheckBox("", true);
    optionPanel.add(separateStrandsBox, gbc);
    return optionPanel;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)

Aggregations

JLabel (javax.swing.JLabel)15 JPanel (javax.swing.JPanel)15 JTextField (javax.swing.JTextField)15 NumberKeyListener (uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)15 GridBagConstraints (java.awt.GridBagConstraints)14 GridBagLayout (java.awt.GridBagLayout)14 JComboBox (javax.swing.JComboBox)8 JCheckBox (javax.swing.JCheckBox)7 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4 BorderLayout (java.awt.BorderLayout)3 KeyEvent (java.awt.event.KeyEvent)3 KeyListener (java.awt.event.KeyListener)3 JScrollPane (javax.swing.JScrollPane)3 DataStore (uk.ac.babraham.SeqMonk.DataTypes.DataStore)3 ProbeList (uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList)3 JList (javax.swing.JList)2 TypeColourRenderer (uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)2 Insets (java.awt.Insets)1 BufferedReader (java.io.BufferedReader)1