import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.AbstractButton;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
protected JCheckBox rightAlign = new JCheckBox();
- protected JComboBox<String> fontSizeCB = new JComboBox<String>();
+ protected JComboBox<String> fontSizeCB = new JComboBox<>();
- protected JComboBox<String> fontStyleCB = new JComboBox<String>();
+ protected JComboBox<String> fontStyleCB = new JComboBox<>();
- protected JComboBox<String> fontNameCB = new JComboBox<String>();
+ protected JComboBox<String> fontNameCB = new JComboBox<>();
protected JCheckBox showOccupancy = new JCheckBox();
protected JCheckBox scaleProteinToCdna = new JCheckBox();
- protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
+ protected JComboBox<String> gapSymbolCB = new JComboBox<>();
protected JCheckBox wrap = new JCheckBox();
- protected JComboBox<String> sortby = new JComboBox<String>();
+ protected JComboBox<String> sortby = new JComboBox<>();
- protected JComboBox<String> sortAnnBy = new JComboBox<String>();
+ protected JComboBox<String> sortAnnBy = new JComboBox<>();
- protected JComboBox<String> sortAutocalc = new JComboBox<String>();
+ protected JComboBox<String> sortAutocalc = new JComboBox<>();
protected JCheckBox startupCheckbox = new JCheckBox();
protected JCheckBox showConsensLogo = new JCheckBox();
+ protected JCheckBox showInformationHistogram = new JCheckBox();
+
+ protected JCheckBox showHMMLogo = new JCheckBox();
+
protected JCheckBox showDbRefTooltip = new JCheckBox();
protected JCheckBox showNpTooltip = new JCheckBox();
+
/*
* Structure tab and components
*/
protected JCheckBox addTempFactor = new JCheckBox();
- protected JComboBox<String> structViewer = new JComboBox<String>();
+ protected JComboBox<String> structViewer = new JComboBox<>();
protected JTextField chimeraPath = new JTextField();
protected JPanel maxColour = new JPanel();
- protected JComboBox<String> protColour = new JComboBox<String>();
+ protected JComboBox<String> protColour = new JComboBox<>();
- protected JComboBox<String> nucColour = new JComboBox<String>();
+ protected JComboBox<String> nucColour = new JComboBox<>();
/*
* Connections tab components
/*
* Output tab components
*/
- protected JComboBox<Object> epsRendering = new JComboBox<Object>();
+ protected JComboBox<Object> epsRendering = new JComboBox<>();
protected JLabel userIdWidthlabel = new JLabel();
protected JCheckBox sortByTree = new JCheckBox();
/*
+ * hmmer tab and components
+ */
+ protected JPanel hmmerTab = new JPanel();
+
+ protected JCheckBox trimTermini = new JCheckBox();
+
+ protected ButtonGroup backgroundFreqSource = new ButtonGroup();
+
+ protected AbstractButton uniprot = new JCheckBox();
+
+ protected AbstractButton alignment = new JCheckBox();
+
+ protected JLabel sequencesToKeep = new JLabel();
+
+ protected JTextField numberOfSequencesToKeepField = new JTextField();
+
+ protected JLabel installationLocation = new JLabel();
+
+ protected JCheckBox isHMMERInstalled = new JCheckBox();
+
+ protected JTextField hmmerPath = new JTextField();
+
+ protected JLabel hmmsearch = new JLabel();
+
+ protected JLabel hmmalign = new JLabel();
+
+ /*
* DAS Settings tab
*/
protected JPanel dasTab = new JPanel();
*/
protected JPanel wsTab = new JPanel();
+
+
/**
* Creates a new GPreferences object.
*/
tabbedPane.add(initEditingTab(),
MessageManager.getString("label.editing"));
+ tabbedPane.add(initHMMERTab(), MessageManager.getString("label.hmmer"));
+
/*
* See DasSourceBrowser for the real work of configuring this tab.
*/
return;
}
}
+ else if (lastTab == hmmerTab
+ && tabbedPane.getSelectedComponent() != hmmerTab
+ && isHMMERInstalled.isSelected())
+ {
+ if (!validateHMMER())
+ {
+ tabbedPane.setSelectedComponent(hmmerTab);
+ }
+ return;
+ }
lastTab = tabbedPane.getSelectedComponent();
}
}
/**
+ * Initialises the hmmer tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initHMMERTab()
+ {
+ hmmerTab.setLayout(null);
+
+ hmmalign.setFont(LABEL_FONT);
+ hmmalign.setText(MessageManager.getString("label.hmmalign_label"));
+ hmmalign.setBounds(new Rectangle(22, 10, 200, 23));
+
+ trimTermini.setFont(LABEL_FONT);
+ trimTermini.setText(MessageManager.getString("label.trim_termini"));
+ trimTermini.setBounds(new Rectangle(22, 30, 200, 23));
+
+ hmmsearch.setFont(LABEL_FONT);
+ hmmsearch.setText(MessageManager.getString("label.hmmsearch_label"));
+ hmmsearch.setBounds(new Rectangle(250, 10, 200, 23));
+
+ sequencesToKeep.setFont(LABEL_FONT);
+ sequencesToKeep
+ .setText(MessageManager.getString("label.no_of_sequences"));
+ sequencesToKeep.setBounds(new Rectangle(250, 30, 125, 23));
+ numberOfSequencesToKeepField.setBounds(new Rectangle(375, 30, 40, 23));
+
+ isHMMERInstalled.setFont(LABEL_FONT);
+ isHMMERInstalled.setText(
+ MessageManager.getString("label.hmmer_installed"));
+ isHMMERInstalled.setBounds(new Rectangle(22, 180, 200, 23));
+ isHMMERInstalled.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean status = isHMMERInstalled.isSelected();
+ installationLocation.setEnabled(status);
+ hmmerPath.setEnabled(status);
+ }
+ });
+ installationLocation.setFont(LABEL_FONT);
+ installationLocation.setText(
+ MessageManager.getString("label.change_hmmer_location"));
+ installationLocation.setBounds(new Rectangle(22, 200, 200, 23));
+ hmmerPath.setBounds(new Rectangle(22, 220, 200, 23));
+ hmmerPath.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount() == 2)
+ {
+ String chosen = openFileChooser(true);
+ if (chosen != null)
+ {
+ hmmerPath.setText(chosen);
+ }
+ }
+ }
+ });
+
+ backgroundFreqSource.add(uniprot);
+ backgroundFreqSource.add(alignment);
+ backgroundFreqSource.setSelected(uniprot.getModel(), true);
+
+ uniprot.setText(MessageManager.getString("label.freq_uniprot"));
+ uniprot.setFont(LABEL_FONT);
+ uniprot.setBounds(new Rectangle(22, 260, 255, 23));
+
+ alignment.setText(MessageManager.getString("label.freq_alignment"));
+ alignment.setFont(LABEL_FONT);
+ alignment.setBounds(new Rectangle(22, 280, 255, 23));
+
+ hmmerTab.add(uniprot);
+ hmmerTab.add(alignment);
+ hmmerTab.add(hmmalign);
+ hmmerTab.add(hmmsearch);
+ hmmerTab.add(installationLocation);
+ hmmerTab.add(hmmerPath);
+ hmmerTab.add(trimTermini);
+ hmmerTab.add(sequencesToKeep);
+ hmmerTab.add(sequencesToKeep);
+ hmmerTab.add(numberOfSequencesToKeepField);
+ hmmerTab.add(isHMMERInstalled);
+
+ return hmmerTab;
+ }
+
+ /**
* Initialises the Output tabbed panel.
*
* @return
{
if (e.getClickCount() == 2)
{
- String chosen = openFileChooser();
+ String chosen = openFileChooser(false);
if (chosen != null)
{
chimeraPath.setText(chosen);
*
* @return
*/
- protected String openFileChooser()
+ protected String openFileChooser(boolean forFolder)
{
String choice = null;
JFileChooser chooser = new JFileChooser();
+ if (forFolder)
+ {
+ chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ }
// chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(
return true;
}
+ /**
+ * Validate the hmmer tab preferences; if invalid, set focus on this tab.
+ *
+ * @param e
+ */
+ protected boolean validateHMMER(FocusEvent e)
+ {
+ if (!validateHMMER())
+ {
+ e.getComponent().requestFocusInWindow();
+ return false;
+ }
+ return true;
+ }
+
protected boolean validateStructure()
{
return false;
}
+ protected boolean validateHMMER()
+ {
+ return false;
+ }
+
/**
* Initialises the Visual tabbed panel.
*
}
}
+
+ public void hmmerPath_actionPerformed(ActionEvent e)
+ {
+
+ }
}