import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashSet;
import java.util.List;
import javax.swing.table.DefaultTableModel;
@Override
public void txt_search_ActionPerformed()
{
+ btn_ok.setEnabled(false);
boolean allowEmptySequence = false;
mainFrame.setTitle(MessageManager
.getString("label.pdb_sequence_getcher"));
{
mainFrame.dispose();
StringBuilder selectedIds = new StringBuilder();
+ HashSet<String> selectedIdsSet = new HashSet<String>();
int pdbIdCol = PDBRestClient.getPDBIdColumIndex(wantedFields, false);
int[] selectedRows = tbl_summary.getSelectedRows();
for (int summaryRow : selectedRows)
{
String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
.toString();
-
String searchTerm = txt_search.getText();
- selectedIds.append(getPDBIdwithSpecifiedChain(pdbIdStr, searchTerm))
- .append(";");
+ selectedIdsSet.add(getPDBIdwithSpecifiedChain(pdbIdStr, searchTerm));
+ }
+
+ for (String selectedId : selectedIdsSet)
+ {
+ selectedIds.append(selectedId).append(";");
}
String ids = selectedIds.toString();
- // System.out.println(">>>>>>>>>>>>>>>> selected Ids: " + ids);
+ System.out.println(">>>>>>>>>>>>>>>> selected Ids: " + ids);
seqFetcher.textArea.setText(ids);
Thread worker = new Thread(seqFetcher);
worker.start();
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JComboBox;
private void jbInit() throws Exception
{
tbl_summary.setAutoCreateRowSorter(true);
+ tbl_summary.addMouseListener(new MouseAdapter()
+ {
+ public void mouseClicked(MouseEvent e)
+ {
+ if (tbl_summary.getSelectedRows().length > 0)
+ {
+ btn_ok.setEnabled(true);
+ }
+ else
+ {
+ btn_ok.setEnabled(false);
+ }
+ }
+ });
+
btn_back.setFont(new java.awt.Font("Verdana", 0, 12));
btn_back.setText(MessageManager.getString("action.back"));
btn_back.addActionListener(new java.awt.event.ActionListener()
btn_back_ActionPerformed();
}
});
+
+ btn_ok.setEnabled(false);
btn_ok.setFont(new java.awt.Font("Verdana", 0, 12));
btn_ok.setText(MessageManager.getString("action.ok"));
btn_ok.addActionListener(new java.awt.event.ActionListener()
}
});
+
scrl_searchResult.setPreferredSize(new Dimension(500, 300));
scrl_searchResult
.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);