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;
}
Aggregations