Search in sources :

Example 6 with TypeColourRenderer

use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.

the class ReadPositionProbeGenerator 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.1;
    gbc.fill = GridBagConstraints.BOTH;
    optionPanel.add(new JLabel("Stores to use"), gbc);
    gbc.gridy++;
    gbc.weighty = 0.9;
    DataStore[] stores = collection.getAllDataStores();
    storesList = new JList(stores);
    storesList.getSelectionModel().addListSelectionListener(this);
    storesList.setCellRenderer(new TypeColourRenderer());
    optionPanel.add(new JScrollPane(storesList), gbc);
    gbc.gridy++;
    JPanel bottomPanel = new JPanel();
    bottomPanel.setLayout(new GridBagLayout());
    GridBagConstraints bgbc = new GridBagConstraints();
    bgbc.gridx = 0;
    bgbc.gridy = 0;
    bgbc.weightx = 0.5;
    bgbc.weighty = 0.5;
    bgbc.fill = GridBagConstraints.HORIZONTAL;
    bottomPanel.add(new JLabel("Use reads on strand "), bgbc);
    readStrandTypeBox = new JComboBox(ReadStrandType.getTypeOptions());
    bgbc.gridx = 1;
    bottomPanel.add(readStrandTypeBox, bgbc);
    bgbc.gridx = 0;
    bgbc.gridy++;
    bottomPanel.add(new JLabel("Minimum read count per position"), bgbc);
    bgbc.gridx = 1;
    minCountField = new JTextField("" + minCount, 4);
    minCountField.addKeyListener(this);
    bottomPanel.add(minCountField, bgbc);
    bgbc.gridx = 0;
    bgbc.gridy++;
    bottomPanel.add(new JLabel("Valid positions per window"), bgbc);
    bgbc.gridx = 1;
    readsPerWindowField = new JTextField("" + readsPerWindow, 4);
    readsPerWindowField.addKeyListener(new NumberKeyListener(false, false));
    readsPerWindowField.addKeyListener(this);
    bottomPanel.add(readsPerWindowField, bgbc);
    bgbc.gridx = 0;
    bgbc.gridy++;
    bottomPanel.add(new JLabel("Limit to region"), bgbc);
    bgbc.gridx = 1;
    JPanel limitPanel = new JPanel();
    limitPanel.setLayout(new BorderLayout());
    designWithinExistingBox = new JCheckBox();
    limitPanel.add(designWithinExistingBox, BorderLayout.WEST);
    if (collection.probeSet() == null) {
        limitRegionBox = new JComboBox(new String[] { "Currently Visible Region" });
    } else {
        limitRegionBox = new JComboBox(new String[] { "Active Probe List", "Currently Visible Region" });
    }
    limitRegionBox.setEnabled(false);
    designWithinExistingBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent arg0) {
            limitRegionBox.setEnabled(designWithinExistingBox.isSelected());
            isReady();
        }
    });
    limitPanel.add(limitRegionBox, BorderLayout.CENTER);
    bottomPanel.add(limitPanel, bgbc);
    optionPanel.add(bottomPanel, gbc);
    bgbc.gridx = 0;
    bgbc.gridy++;
    bottomPanel.add(new JLabel("Ignore Strand "), bgbc);
    bgbc.gridx = 1;
    ignoreStrandBox = new JCheckBox();
    ignoreStrandBox.setSelected(true);
    bottomPanel.add(ignoreStrandBox, bgbc);
    optionPanel.add(bottomPanel, gbc);
    return optionPanel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer) JCheckBox(javax.swing.JCheckBox) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener) JList(javax.swing.JList)

Aggregations

JLabel (javax.swing.JLabel)6 JList (javax.swing.JList)6 JPanel (javax.swing.JPanel)6 JScrollPane (javax.swing.JScrollPane)6 DataStore (uk.ac.babraham.SeqMonk.DataTypes.DataStore)6 TypeColourRenderer (uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)6 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 JCheckBox (javax.swing.JCheckBox)4 JComboBox (javax.swing.JComboBox)4 JTextField (javax.swing.JTextField)4 BorderLayout (java.awt.BorderLayout)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 Vector (java.util.Vector)2 ReplicateSet (uk.ac.babraham.SeqMonk.DataTypes.ReplicateSet)2 NumberKeyListener (uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)2 Insets (java.awt.Insets)1 DefaultListModel (javax.swing.DefaultListModel)1 JButton (javax.swing.JButton)1