JAL-2074 Improvement to StructureChooser and FTS interfaces to remember the user...
[jalview.git] / src / jalview / jbgui / GStructureChooser.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21
22 package jalview.jbgui;
23
24 import jalview.datamodel.SequenceI;
25 import jalview.fts.api.FTSDataColumnI;
26 import jalview.fts.core.FTSDataColumnPreferences;
27 import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
28 import jalview.fts.service.pdb.PDBFTSRestClient;
29 import jalview.gui.AlignmentPanel;
30 import jalview.gui.Desktop;
31 import jalview.gui.JvSwingUtils;
32 import jalview.util.MessageManager;
33
34 import java.awt.BorderLayout;
35 import java.awt.CardLayout;
36 import java.awt.Dimension;
37 import java.awt.FlowLayout;
38 import java.awt.GridLayout;
39 import java.awt.event.ActionEvent;
40 import java.awt.event.ItemEvent;
41 import java.awt.event.ItemListener;
42 import java.awt.event.KeyAdapter;
43 import java.awt.event.KeyEvent;
44 import java.awt.event.MouseAdapter;
45 import java.awt.event.MouseEvent;
46 import java.util.Arrays;
47 import java.util.HashMap;
48 import java.util.Map;
49
50 import javax.swing.ImageIcon;
51 import javax.swing.JButton;
52 import javax.swing.JCheckBox;
53 import javax.swing.JComboBox;
54 import javax.swing.JFrame;
55 import javax.swing.JInternalFrame;
56 import javax.swing.JLabel;
57 import javax.swing.JPanel;
58 import javax.swing.JScrollPane;
59 import javax.swing.JTabbedPane;
60 import javax.swing.JTable;
61 import javax.swing.JTextField;
62 import javax.swing.event.ChangeEvent;
63 import javax.swing.event.ChangeListener;
64 import javax.swing.event.DocumentEvent;
65 import javax.swing.event.DocumentListener;
66 import javax.swing.event.InternalFrameEvent;
67 import javax.swing.table.TableColumn;
68
69 @SuppressWarnings("serial")
70 /**
71  * GUI layout for structure chooser 
72  * @author tcnofoegbu
73  *
74  */
75 public abstract class GStructureChooser extends JPanel implements
76         ItemListener
77 {
78   protected JPanel statusPanel = new JPanel();
79
80   public JLabel statusBar = new JLabel();
81
82   private JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
83
84   protected String frameTitle = MessageManager
85           .getString("label.structure_chooser");
86
87   protected JInternalFrame mainFrame = new JInternalFrame(frameTitle);
88
89   protected JComboBox<FilterOption> cmb_filterOption = new JComboBox<FilterOption>();
90
91   protected AlignmentPanel ap;
92
93   protected StringBuilder errorWarning = new StringBuilder();
94
95   protected JLabel lbl_result = new JLabel(
96           MessageManager.getString("label.select"));
97
98   protected JButton btn_view = new JButton();
99
100   protected JButton btn_cancel = new JButton();
101
102   protected JButton btn_pdbFromFile = new JButton();
103
104   protected JTextField txt_search = new JTextField(14);
105
106   private JPanel pnl_actions = new JPanel();
107
108   private JPanel pnl_main = new JPanel();
109
110   private JPanel pnl_idInput = new JPanel(new FlowLayout());
111
112   private JPanel pnl_fileChooser = new JPanel(new FlowLayout());
113
114   private JPanel pnl_idInputBL = new JPanel(new BorderLayout());
115
116   private JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
117
118   private JPanel pnl_locPDB = new JPanel(new BorderLayout());
119
120   protected JPanel pnl_switchableViews = new JPanel(new CardLayout());
121
122   protected CardLayout layout_switchableViews = (CardLayout) (pnl_switchableViews
123           .getLayout());
124
125   private BorderLayout mainLayout = new BorderLayout();
126
127   protected JCheckBox chk_rememberSettings = new JCheckBox(
128           MessageManager.getString("label.dont_ask_me_again"));
129
130   protected JCheckBox chk_invertFilter = new JCheckBox(
131           MessageManager.getString("label.invert"));
132
133   protected ImageIcon loadingImage = new ImageIcon(getClass().getResource(
134           "/images/loading.gif"));
135
136   protected ImageIcon goodImage = new ImageIcon(getClass().getResource(
137           "/images/good.png"));
138
139   protected ImageIcon errorImage = new ImageIcon(getClass().getResource(
140           "/images/error.png"));
141
142   protected ImageIcon warningImage = new ImageIcon(getClass().getResource(
143           "/images/warning.gif"));
144
145   protected JLabel lbl_warning = new JLabel(warningImage);
146
147   protected JLabel lbl_loading = new JLabel(loadingImage);
148
149   protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage);
150
151   protected JLabel lbl_fromFileStatus = new JLabel(errorImage);
152
153   protected AssciateSeqPanel idInputAssSeqPanel = new AssciateSeqPanel();
154
155   protected AssciateSeqPanel fileChooserAssSeqPanel = new AssciateSeqPanel();
156
157   protected static final String VIEWS_FILTER = "VIEWS_FILTER";
158
159   protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
160
161   protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
162
163   protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
164
165   protected JTable tbl_local_pdb = new JTable();
166
167   protected JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
168
169   private JTabbedPane pnl_filter = new JTabbedPane();
170
171   protected FTSDataColumnPreferences pdbDocFieldPrefs = new FTSDataColumnPreferences(
172           PreferenceSource.STRUCTURE_CHOOSER,
173           PDBFTSRestClient.getInstance());
174
175   protected FTSDataColumnI[] previousWantedFields;
176
177   protected static Map<String, Integer> tempUserPrefs = new HashMap<String, Integer>();
178
179   private JTable tbl_summary = new JTable()
180   {
181     private boolean inLayout;
182
183     @Override
184     public boolean getScrollableTracksViewportWidth()
185     {
186       return hasExcessWidth();
187
188     }
189
190     @Override
191     public void doLayout()
192     {
193       if (hasExcessWidth())
194       {
195         autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS;
196       }
197       inLayout = true;
198       super.doLayout();
199       inLayout = false;
200       autoResizeMode = AUTO_RESIZE_OFF;
201     }
202
203     protected boolean hasExcessWidth()
204     {
205       return getPreferredSize().width < getParent().getWidth();
206     }
207
208     @Override
209     public void columnMarginChanged(ChangeEvent e)
210     {
211       if (isEditing())
212       {
213         removeEditor();
214       }
215       TableColumn resizingColumn = getTableHeader().getResizingColumn();
216       // Need to do this here, before the parent's
217       // layout manager calls getPreferredSize().
218       if (resizingColumn != null && autoResizeMode == AUTO_RESIZE_OFF
219               && !inLayout)
220       {
221         resizingColumn.setPreferredWidth(resizingColumn.getWidth());
222         String colHeader = resizingColumn.getHeaderValue().toString();
223         tempUserPrefs.put(colHeader, resizingColumn.getWidth());
224       }
225       resizeAndRepaint();
226     }
227
228     @Override
229     public String getToolTipText(MouseEvent evt)
230     {
231       String toolTipText = null;
232       java.awt.Point pnt = evt.getPoint();
233       int rowIndex = rowAtPoint(pnt);
234       int colIndex = columnAtPoint(pnt);
235
236       try
237       {
238         if (getValueAt(rowIndex, colIndex) == null)
239         {
240           return null;
241         }
242         toolTipText = getValueAt(rowIndex, colIndex).toString();
243       } catch (Exception e)
244       {
245         // e.printStackTrace();
246       }
247       toolTipText = (toolTipText == null ? null
248               : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip(
249                       true, "\"" + toolTipText.subSequence(0, 500)
250                               + "...\"") : JvSwingUtils.wrapTooltip(true,
251                       toolTipText)));
252       return toolTipText;
253     }
254   };
255
256   protected JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
257
258   public GStructureChooser()
259   {
260     try
261     {
262       jbInit();
263       mainFrame.setVisible(false);
264       mainFrame.invalidate();
265       mainFrame.pack();
266     } catch (Exception e)
267     {
268       e.printStackTrace();
269     }
270   }
271
272   /**
273    * Initializes the GUI default properties
274    * 
275    * @throws Exception
276    */
277   private void jbInit() throws Exception
278   {
279     Integer width = tempUserPrefs.get("structureChooser.width") == null ? 800
280             : tempUserPrefs.get("structureChooser.width");
281     Integer height = tempUserPrefs.get("structureChooser.height") == null ? 400
282             : tempUserPrefs.get("structureChooser.height");
283     tbl_summary.setAutoCreateRowSorter(true);
284     tbl_summary.getTableHeader().setReorderingAllowed(false);
285     tbl_summary.addMouseListener(new MouseAdapter()
286     {
287       @Override
288       public void mouseClicked(MouseEvent e)
289       {
290         validateSelections();
291       }
292
293       @Override
294       public void mouseReleased(MouseEvent e)
295       {
296         validateSelections();
297       }
298     });
299     tbl_summary.addKeyListener(new KeyAdapter()
300     {
301       @Override
302       public void keyPressed(KeyEvent evt)
303       {
304         validateSelections();
305         switch (evt.getKeyCode())
306         {
307         case KeyEvent.VK_ESCAPE: // escape key
308           mainFrame.dispose();
309           break;
310         case KeyEvent.VK_ENTER: // enter key
311           if (btn_view.isEnabled())
312           {
313             ok_ActionPerformed();
314           }
315           break;
316         case KeyEvent.VK_TAB: // tab key
317           if (evt.isShiftDown())
318           {
319             pnl_filter.requestFocus();
320           }
321           else
322           {
323             btn_view.requestFocus();
324           }
325           evt.consume();
326           break;
327         default:
328           return;
329         }
330       }
331     });
332     tbl_local_pdb.setAutoCreateRowSorter(true);
333     tbl_local_pdb.getTableHeader().setReorderingAllowed(false);
334     tbl_local_pdb.addMouseListener(new MouseAdapter()
335     {
336       @Override
337       public void mouseClicked(MouseEvent e)
338       {
339         validateSelections();
340       }
341
342       @Override
343       public void mouseReleased(MouseEvent e)
344       {
345         validateSelections();
346       }
347     });
348     tbl_local_pdb.addKeyListener(new KeyAdapter()
349     {
350       @Override
351       public void keyPressed(KeyEvent evt)
352       {
353         validateSelections();
354         switch (evt.getKeyCode())
355         {
356         case KeyEvent.VK_ESCAPE: // escape key
357           mainFrame.dispose();
358           break;
359         case KeyEvent.VK_ENTER: // enter key
360           if (btn_view.isEnabled())
361           {
362             ok_ActionPerformed();
363           }
364           break;
365         case KeyEvent.VK_TAB: // tab key
366           if (evt.isShiftDown())
367           {
368             cmb_filterOption.requestFocus();
369           }
370           else
371           {
372             if (btn_view.isEnabled())
373             {
374               btn_view.requestFocus();
375             }
376             else
377             {
378               btn_cancel.requestFocus();
379             }
380           }
381           evt.consume();
382         default:
383           return;
384         }
385       }
386     });
387     btn_view.setFont(new java.awt.Font("Verdana", 0, 12));
388     btn_view.setText(MessageManager.getString("action.view"));
389     btn_view.addActionListener(new java.awt.event.ActionListener()
390     {
391       @Override
392       public void actionPerformed(ActionEvent e)
393       {
394         ok_ActionPerformed();
395       }
396     });
397     btn_view.addKeyListener(new KeyAdapter()
398     {
399       @Override
400       public void keyPressed(KeyEvent evt)
401       {
402         if (evt.getKeyCode() == KeyEvent.VK_ENTER)
403         {
404           ok_ActionPerformed();
405         }
406       }
407     });
408
409     btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
410     btn_cancel.setText(MessageManager.getString("action.cancel"));
411     btn_cancel.addActionListener(new java.awt.event.ActionListener()
412     {
413       @Override
414       public void actionPerformed(ActionEvent e)
415       {
416         closeAction();
417       }
418     });
419     btn_cancel.addKeyListener(new KeyAdapter()
420     {
421       @Override
422       public void keyPressed(KeyEvent evt)
423       {
424         if (evt.getKeyCode() == KeyEvent.VK_ENTER)
425         {
426           closeAction();
427         }
428       }
429     });
430
431     btn_pdbFromFile.setFont(new java.awt.Font("Verdana", 0, 12));
432     String btn_title = MessageManager.getString("label.select_pdb_file");
433     btn_pdbFromFile.setText(btn_title + "              ");
434     btn_pdbFromFile.addActionListener(new java.awt.event.ActionListener()
435     {
436       @Override
437       public void actionPerformed(ActionEvent e)
438       {
439         pdbFromFile_actionPerformed();
440       }
441     });
442     btn_pdbFromFile.addKeyListener(new KeyAdapter()
443     {
444       @Override
445       public void keyPressed(KeyEvent evt)
446       {
447         if (evt.getKeyCode() == KeyEvent.VK_ENTER)
448         {
449           pdbFromFile_actionPerformed();
450         }
451       }
452     });
453
454     scrl_foundStructures.setPreferredSize(new Dimension(width, height));
455
456     scrl_localPDB.setPreferredSize(new Dimension(width, height));
457     scrl_localPDB
458             .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
459
460     cmb_filterOption.setFont(new java.awt.Font("Verdana", 0, 12));
461     chk_invertFilter.setFont(new java.awt.Font("Verdana", 0, 12));
462     chk_rememberSettings.setFont(new java.awt.Font("Verdana", 0, 12));
463     chk_rememberSettings.setVisible(false);
464     txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true,
465             MessageManager.getString("label.enter_pdb_id")));
466     cmb_filterOption.setToolTipText(MessageManager
467             .getString("info.select_filter_option"));
468     txt_search.getDocument().addDocumentListener(new DocumentListener()
469     {
470       @Override
471       public void insertUpdate(DocumentEvent e)
472       {
473         txt_search_ActionPerformed();
474       }
475
476       @Override
477       public void removeUpdate(DocumentEvent e)
478       {
479         txt_search_ActionPerformed();
480       }
481
482       @Override
483       public void changedUpdate(DocumentEvent e)
484       {
485         txt_search_ActionPerformed();
486       }
487     });
488
489     cmb_filterOption.addItemListener(this);
490     chk_invertFilter.addItemListener(this);
491
492     pnl_actions.add(chk_rememberSettings);
493     pnl_actions.add(btn_view);
494     pnl_actions.add(btn_cancel);
495
496     // pnl_filter.add(lbl_result);
497     pnl_main.add(cmb_filterOption);
498     pnl_main.add(lbl_loading);
499     pnl_main.add(chk_invertFilter);
500     lbl_loading.setVisible(false);
501
502     pnl_fileChooser.add(btn_pdbFromFile);
503     pnl_fileChooser.add(lbl_fromFileStatus);
504     pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH);
505     pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER);
506
507     pnl_idInput.add(txt_search);
508     pnl_idInput.add(lbl_pdbManualFetchStatus);
509     pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH);
510     pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER);
511
512     final String foundStructureSummary = MessageManager
513             .getString("label.found_structures_summary");
514     final String configureCols = MessageManager
515             .getString("label.configure_displayed_columns");
516     ChangeListener changeListener = new ChangeListener()
517     {
518       @Override
519       public void stateChanged(ChangeEvent changeEvent)
520       {
521         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
522                 .getSource();
523         int index = sourceTabbedPane.getSelectedIndex();
524         btn_view.setVisible(true);
525         btn_cancel.setVisible(true);
526         if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
527         {
528           btn_view.setEnabled(false);
529           btn_cancel.setEnabled(false);
530           btn_view.setVisible(false);
531           btn_cancel.setVisible(false);
532           previousWantedFields = pdbDocFieldPrefs
533                   .getStructureSummaryFields().toArray(
534                           new FTSDataColumnI[0]);
535         }
536         if (sourceTabbedPane.getTitleAt(index)
537                 .equals(foundStructureSummary))
538         {
539           btn_cancel.setEnabled(true);
540           if (wantedFieldsUpdated())
541           {
542             tabRefresh();
543           }
544           else
545           {
546             validateSelections();
547           }
548         }
549       }
550     };
551     pnl_filter.addChangeListener(changeListener);
552     pnl_filter.setPreferredSize(new Dimension(width, height));
553     pnl_filter.add(foundStructureSummary, scrl_foundStructures);
554     pnl_filter.add(configureCols, pdbDocFieldPrefs);
555
556     pnl_locPDB.add(scrl_localPDB);
557
558     pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE);
559     pnl_switchableViews.add(pnl_idInputBL, VIEWS_ENTER_ID);
560     pnl_switchableViews.add(pnl_filter, VIEWS_FILTER);
561     pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB);
562
563     this.setLayout(mainLayout);
564     this.add(pnl_main, java.awt.BorderLayout.NORTH);
565     this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER);
566     // this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
567     statusPanel.setLayout(new GridLayout());
568     pnl_actionsAndStatus.add(pnl_actions, BorderLayout.CENTER);
569     pnl_actionsAndStatus.add(statusPanel, BorderLayout.SOUTH);
570     statusPanel.add(statusBar, null);
571     this.add(pnl_actionsAndStatus, java.awt.BorderLayout.SOUTH);
572
573     mainFrame
574             .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
575             {
576               @Override
577               public void internalFrameClosing(InternalFrameEvent e)
578               {
579                 closeAction();
580               }
581             });
582     mainFrame.setVisible(true);
583     mainFrame.setContentPane(this);
584     mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
585     Integer x = tempUserPrefs.get("structureChooser.x");
586     Integer y = tempUserPrefs.get("structureChooser.y");
587     if (x != null && y != null)
588     {
589       mainFrame.setLocation(x, y);
590     }
591     Desktop.addInternalFrame(mainFrame, frameTitle, width, height);
592   }
593
594   protected void closeAction()
595   {
596     // System.out.println(">>>>>>>>>> closing internal frame!!!");
597     // System.out.println("width : " + mainFrame.getWidth());
598     // System.out.println("heigh : " + mainFrame.getHeight());
599     // System.out.println("x : " + mainFrame.getX());
600     // System.out.println("y : " + mainFrame.getY());
601     tempUserPrefs.put("structureChooser.width", pnl_filter.getWidth());
602     tempUserPrefs.put("structureChooser.height", pnl_filter.getHeight());
603     tempUserPrefs.put("structureChooser.x", mainFrame.getX());
604     tempUserPrefs.put("structureChooser.y", mainFrame.getY());
605     mainFrame.dispose();
606   }
607   public boolean wantedFieldsUpdated()
608   {
609     if (previousWantedFields == null)
610     {
611       return true;
612     }
613     
614     FTSDataColumnI[] currentWantedFields = pdbDocFieldPrefs
615             .getStructureSummaryFields()
616             .toArray(new FTSDataColumnI[0]);
617     return Arrays.equals(currentWantedFields, previousWantedFields) ? false
618             : true;
619
620   }
621
622   @Override
623   /**
624    * Event listener for the 'filter' combo-box and 'invert' check-box
625    */
626   public void itemStateChanged(ItemEvent e)
627   {
628     stateChanged(e);
629   }
630
631   /**
632    * This inner class provides the data model for the structure filter combo-box
633    * 
634    * @author tcnofoegbu
635    *
636    */
637   public class FilterOption
638   {
639     private String name;
640
641     private String value;
642
643     private String view;
644
645     public FilterOption(String name, String value, String view)
646     {
647       this.name = name;
648       this.value = value;
649       this.view = view;
650     }
651
652     public String getName()
653     {
654       return name;
655     }
656
657     public void setName(String name)
658     {
659       this.name = name;
660     }
661
662     public String getValue()
663     {
664       return value;
665     }
666
667     public void setValue(String value)
668     {
669       this.value = value;
670     }
671
672     public String getView()
673     {
674       return view;
675     }
676
677     public void setView(String view)
678     {
679       this.view = view;
680     }
681
682     @Override
683     public String toString()
684     {
685       return this.name;
686     }
687   }
688
689   /**
690    * This inner class provides the provides the data model for associate
691    * sequence combo-box - cmb_assSeq
692    * 
693    * @author tcnofoegbu
694    *
695    */
696   public class AssociateSeqOptions
697   {
698     private SequenceI sequence;
699
700     private String name;
701
702     public AssociateSeqOptions(SequenceI seq)
703     {
704       this.sequence = seq;
705       this.name = (seq.getName().length() >= 23) ? seq.getName().substring(
706               0, 23) : seq.getName();
707     }
708
709     public AssociateSeqOptions(String name, SequenceI seq)
710     {
711       this.name = name;
712       this.sequence = seq;
713     }
714
715     @Override
716     public String toString()
717     {
718       return name;
719     }
720
721     public String getName()
722     {
723       return name;
724     }
725
726     public void setName(String name)
727     {
728       this.name = name;
729     }
730
731     public SequenceI getSequence()
732     {
733       return sequence;
734     }
735
736     public void setSequence(SequenceI sequence)
737     {
738       this.sequence = sequence;
739     }
740
741   }
742
743   /**
744    * This inner class holds the Layout and configuration of the panel which
745    * handles association of manually fetched structures to a unique sequence
746    * when more than one sequence selection is made
747    * 
748    * @author tcnofoegbu
749    *
750    */
751   public class AssciateSeqPanel extends JPanel implements ItemListener
752   {
753     private JComboBox<AssociateSeqOptions> cmb_assSeq = new JComboBox<AssociateSeqOptions>();
754
755     private JLabel lbl_associateSeq = new JLabel();
756
757     public AssciateSeqPanel()
758     {
759       this.setLayout(new FlowLayout());
760       this.add(cmb_assSeq);
761       this.add(lbl_associateSeq);
762       cmb_assSeq.setToolTipText(MessageManager
763               .getString("info.associate_wit_sequence"));
764       cmb_assSeq.addItemListener(this);
765     }
766
767     public void loadCmbAssSeq()
768     {
769       populateCmbAssociateSeqOptions(cmb_assSeq, lbl_associateSeq);
770     }
771
772     public JComboBox<AssociateSeqOptions> getCmb_assSeq()
773     {
774       return cmb_assSeq;
775     }
776
777     public void setCmb_assSeq(JComboBox<AssociateSeqOptions> cmb_assSeq)
778     {
779       this.cmb_assSeq = cmb_assSeq;
780     }
781
782     @Override
783     public void itemStateChanged(ItemEvent e)
784     {
785       if (e.getStateChange() == ItemEvent.SELECTED)
786       {
787         cmbAssSeqStateChanged();
788       }
789     }
790   }
791
792   public JTable getResultTable()
793   {
794     return tbl_summary;
795   }
796   public JComboBox<FilterOption> getCmbFilterOption()
797   {
798     return cmb_filterOption;
799   }
800
801   protected abstract void stateChanged(ItemEvent e);
802
803   protected abstract void updateCurrentView();
804
805   protected abstract void populateFilterComboBox();
806
807   protected abstract void ok_ActionPerformed();
808
809   protected abstract void pdbFromFile_actionPerformed();
810
811   protected abstract void txt_search_ActionPerformed();
812
813   public abstract void populateCmbAssociateSeqOptions(
814           JComboBox<AssociateSeqOptions> cmb_assSeq, JLabel lbl_associateSeq);
815
816   public abstract void cmbAssSeqStateChanged();
817
818   public abstract void tabRefresh();
819
820   public abstract void validateSelections();
821 }