import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
@SuppressWarnings("serial")
public abstract class GFTSPanel extends JPanel implements GFTSPanelI
{
+ private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
+
protected JInternalFrame mainFrame = new JInternalFrame(
getFTSFrameTitle());
Integer height = getTempUserPrefs().get("FTSPanel.height") == null ? 400
: getTempUserPrefs().get("FTSPanel.height");
lbl_warning.setVisible(false);
- lbl_warning.setFont(new java.awt.Font("Verdana", 0, 12));
+ lbl_warning.setFont(VERDANA_12);
lbl_loading.setVisible(false);
- lbl_loading.setFont(new java.awt.Font("Verdana", 0, 12));
+ lbl_loading.setFont(VERDANA_12);
lbl_blank.setVisible(true);
- lbl_blank.setFont(new java.awt.Font("Verdana", 0, 12));
+ lbl_blank.setFont(VERDANA_12);
tbl_summary.setAutoCreateRowSorter(true);
tbl_summary.getTableHeader().setReorderingAllowed(false);
}
});
+ JButton txt_help = new JButton("?");
+ txt_help.setFont(VERDANA_12);
+ txt_help.setPreferredSize(new Dimension(15, 15));
+ txt_help.setToolTipText(MessageManager.getString("action.help"));
+ txt_help.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showHelp();
+ }
+ });
+
btn_autosearch.setText(MessageManager.getString("option.autosearch"));
btn_autosearch.setToolTipText(
MessageManager.getString("option.enable_disable_autosearch"));
Boolean.toString(btn_autosearch.isSelected()));
}
});
- btn_back.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_back.setFont(VERDANA_12);
btn_back.setText(MessageManager.getString("action.back"));
btn_back.addActionListener(new java.awt.event.ActionListener()
{
});
btn_ok.setEnabled(false);
- btn_ok.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_ok.setFont(VERDANA_12);
btn_ok.setText(MessageManager.getString("action.ok"));
btn_ok.addActionListener(new java.awt.event.ActionListener()
{
btn_next_page.setEnabled(false);
btn_next_page.setToolTipText(
MessageManager.getString("label.next_page_tooltip"));
- btn_next_page.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_next_page.setFont(VERDANA_12);
btn_next_page.setText(MessageManager.getString("action.next_page"));
btn_next_page.addActionListener(new java.awt.event.ActionListener()
{
btn_prev_page.setEnabled(false);
btn_prev_page.setToolTipText(
MessageManager.getString("label.prev_page_tooltip"));
- btn_prev_page.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_prev_page.setFont(VERDANA_12);
btn_prev_page.setText(MessageManager.getString("action.prev_page"));
btn_prev_page.addActionListener(new java.awt.event.ActionListener()
{
btn_next_page.setVisible(false);
}
- btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_cancel.setFont(VERDANA_12);
btn_cancel.setText(MessageManager.getString("action.cancel"));
btn_cancel.addActionListener(new java.awt.event.ActionListener()
{
});
scrl_searchResult.setPreferredSize(new Dimension(width, height));
- cmb_searchTarget.setFont(new java.awt.Font("Verdana", 0, 12));
+ cmb_searchTarget.setFont(VERDANA_12);
cmb_searchTarget.addItemListener(new ItemListener()
{
@Override
}
});
- txt_search.setFont(new java.awt.Font("Verdana", 0, 12));
+ txt_search.setFont(VERDANA_12);
txt_search.getEditor().getEditorComponent()
.addKeyListener(new KeyAdapter()
pnl_results.add(tabbedPane);
pnl_inputs.add(cmb_searchTarget);
pnl_inputs.add(txt_search);
+ pnl_inputs.add(txt_help);
pnl_inputs.add(btn_autosearch);
pnl_inputs.add(lbl_loading);
pnl_inputs.add(lbl_warning);
Desktop.addInternalFrame(mainFrame, getFTSFrameTitle(), width, height);
}
+ abstract protected void showHelp();
+
protected void closeAction()
{
getTempUserPrefs().put("FTSPanel.width", this.getWidth());
import jalview.fts.core.FTSRestRequest;
import jalview.fts.core.FTSRestResponse;
import jalview.fts.core.GFTSPanel;
+import jalview.gui.Help;
+import jalview.gui.Help.HelpId;
import jalview.gui.SequenceFetcher;
import jalview.util.MessageManager;
import java.util.HashSet;
import java.util.Map;
+import javax.help.HelpSetException;
+
@SuppressWarnings("serial")
public class PDBFTSPanel extends GFTSPanel
{
private static String defaultFTSFrameTitle = MessageManager
.getString("label.pdb_sequence_fetcher");
- private static Map<String, Integer> tempUserPrefs = new HashMap<String, Integer>();
+ private static Map<String, Integer> tempUserPrefs = new HashMap<>();
private static final String PDB_FTS_CACHE_KEY = "CACHE.PDB_FTS";
// mainFrame.dispose();
disableActionButtons();
StringBuilder selectedIds = new StringBuilder();
- HashSet<String> selectedIdsSet = new HashSet<String>();
+ HashSet<String> selectedIdsSet = new HashSet<>();
int primaryKeyColIndex = 0;
try
{
{
return PDB_AUTOSEARCH;
}
+
+ @Override
+ protected void showHelp()
+ {
+ try
+ {
+ Help.showHelpWindow(HelpId.PdbFts);
+ } catch (HelpSetException e1)
+ {
+ e1.printStackTrace();
+ }
+ }
}
\ No newline at end of file