2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
22 package jalview.jbgui;
24 import java.awt.BorderLayout;
25 import java.awt.CardLayout;
26 import java.awt.Component;
27 import java.awt.Dimension;
28 import java.awt.FlowLayout;
30 import java.awt.GridLayout;
31 import java.awt.Insets;
32 import java.awt.Point;
33 import java.awt.event.ActionEvent;
34 import java.awt.event.ActionListener;
35 import java.awt.event.ItemEvent;
36 import java.awt.event.ItemListener;
37 import java.awt.event.KeyAdapter;
38 import java.awt.event.KeyEvent;
39 import java.awt.event.MouseAdapter;
40 import java.awt.event.MouseEvent;
41 import java.util.Arrays;
42 import java.util.HashMap;
45 import javax.swing.ImageIcon;
46 import javax.swing.JButton;
47 import javax.swing.JCheckBox;
48 import javax.swing.JComboBox;
49 import javax.swing.JFrame;
50 import javax.swing.JInternalFrame;
51 import javax.swing.JLabel;
52 import javax.swing.JList;
53 import javax.swing.JPanel;
54 import javax.swing.JScrollPane;
55 import javax.swing.JSeparator;
56 import javax.swing.JTabbedPane;
57 import javax.swing.JTable;
58 import javax.swing.JTextField;
59 import javax.swing.ListCellRenderer;
60 import javax.swing.SwingConstants;
61 import javax.swing.Timer;
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;
69 import jalview.datamodel.SequenceI;
70 import jalview.fts.api.FTSDataColumnI;
71 import jalview.fts.core.FTSDataColumnPreferences;
72 import jalview.gui.AlignmentPanel;
73 import jalview.gui.Desktop;
74 import jalview.gui.JvSwingUtils;
75 import jalview.gui.StructureViewer;
76 import jalview.util.MessageManager;
77 import jalview.util.Platform;
78 import net.miginfocom.swing.MigLayout;
80 @SuppressWarnings("serial")
82 * GUI layout for structure chooser
87 public abstract class GStructureChooser extends JPanel
88 implements ItemListener
90 private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
92 public static final String VIEWS_FILTER = "VIEWS_FILTER";
94 protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
96 protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
99 * 'cached' structure view
101 protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
103 protected JPanel statusPanel = new JPanel();
105 public JLabel statusBar = new JLabel();
107 protected String frameTitle = MessageManager
108 .getString("label.structure_chooser");
110 protected JInternalFrame mainFrame = new JInternalFrame(frameTitle);
112 protected JComboBox<FilterOption> cmb_filterOption = new JComboBox<>();
114 protected AlignmentPanel ap;
116 protected StringBuilder errorWarning = new StringBuilder();
118 protected JButton btn_add;
120 protected JButton btn_newView;
122 protected JButton btn_pdbFromFile = new JButton();
124 // holder for icon and button
125 protected JPanel pnl_queryTDB;
127 protected JButton btn_queryTDB = new JButton();
129 protected JCheckBox chk_superpose = new JCheckBox(
130 MessageManager.getString("label.superpose_structures"));
132 protected JTextField txt_search = new JTextField(14);
134 protected JPanel pnl_switchableViews = new JPanel(new CardLayout());
136 protected CardLayout layout_switchableViews = (CardLayout) (pnl_switchableViews
139 protected JCheckBox chk_invertFilter = new JCheckBox(
140 MessageManager.getString("label.invert"));
142 protected ImageIcon loadingImage = new ImageIcon(
143 getClass().getResource("/images/loading.gif"));
145 protected ImageIcon goodImage = new ImageIcon(
146 getClass().getResource("/images/good.png"));
148 protected ImageIcon errorImage = new ImageIcon(
149 getClass().getResource("/images/error.png"));
151 protected ImageIcon warningImage = new ImageIcon(
152 getClass().getResource("/images/warning.gif"));
154 protected ImageIcon tdbImage = new ImageIcon(getClass()
155 .getResource("/images/3d-beacons-logo-transparent.png"));
157 protected JLabel lbl_loading = new JLabel(loadingImage);
159 protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage);
161 protected JLabel lbl_fromFileStatus = new JLabel(errorImage);
163 protected AssociateSeqPanel idInputAssSeqPanel = new AssociateSeqPanel();
165 protected AssociateSeqPanel fileChooserAssSeqPanel = new AssociateSeqPanel();
167 protected JComboBox<StructureViewer> targetView = new JComboBox<>();
169 protected JTable tbl_local_pdb = new JTable();
171 protected JTabbedPane pnl_filter = new JTabbedPane();
173 protected abstract FTSDataColumnPreferences getFTSDocFieldPrefs();
175 protected abstract void setFTSDocFieldPrefs(
176 FTSDataColumnPreferences newPrefs);
178 protected FTSDataColumnI[] previousWantedFields;
180 protected static Map<String, Integer> tempUserPrefs = new HashMap<>();
182 private JTable tbl_summary = new JTable()
184 private boolean inLayout;
187 public boolean getScrollableTracksViewportWidth()
189 return hasExcessWidth();
194 public void doLayout()
196 if (hasExcessWidth())
198 autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS;
203 autoResizeMode = AUTO_RESIZE_OFF;
206 protected boolean hasExcessWidth()
208 return getPreferredSize().width < getParent().getWidth();
212 public void columnMarginChanged(ChangeEvent e)
218 TableColumn resizingColumn = getTableHeader().getResizingColumn();
219 // Need to do this here, before the parent's
220 // layout manager calls getPreferredSize().
221 if (resizingColumn != null && autoResizeMode == AUTO_RESIZE_OFF
224 resizingColumn.setPreferredWidth(resizingColumn.getWidth());
225 String colHeader = resizingColumn.getHeaderValue().toString();
226 tempUserPrefs.put(colHeader, resizingColumn.getWidth());
232 public String getToolTipText(MouseEvent evt)
234 String toolTipText = null;
235 java.awt.Point pnt = evt.getPoint();
236 int rowIndex = rowAtPoint(pnt);
237 int colIndex = columnAtPoint(pnt);
241 if (getValueAt(rowIndex, colIndex) == null)
245 toolTipText = getValueAt(rowIndex, colIndex).toString();
246 } catch (Exception e)
248 // e.printStackTrace();
250 toolTipText = (toolTipText == null ? null
251 : (toolTipText.length() > 500
252 ? JvSwingUtils.wrapTooltip(true,
253 "\"" + toolTipText.subSequence(0, 500)
255 : JvSwingUtils.wrapTooltip(true, toolTipText)));
260 public GStructureChooser()
264 protected void initDialog()
270 mainFrame.setVisible(false);
271 mainFrame.invalidate();
273 } catch (Exception e)
275 System.out.println(e); // for JavaScript TypeError
280 // BH SwingJS optimization
281 // (a) 100-ms interruptable timer for text entry -- BH 1/10/2019
282 // (b) two-character minimum, at least for JavaScript.
286 protected void txt_search_ActionPerformedDelayed()
292 timer = new Timer(300, new ActionListener()
296 public void actionPerformed(ActionEvent e)
298 txt_search_ActionPerformed();
301 timer.setRepeats(false);
307 * Initializes the GUI default properties
311 private void jbInit() throws Exception
313 Integer width = tempUserPrefs.get("structureChooser.width") == null
315 : tempUserPrefs.get("structureChooser.width");
316 Integer height = tempUserPrefs.get("structureChooser.height") == null
318 : tempUserPrefs.get("structureChooser.height");
319 tbl_summary.setAutoCreateRowSorter(true);
320 tbl_summary.getTableHeader().setReorderingAllowed(false);
321 tbl_summary.addMouseListener(new MouseAdapter()
324 public void mousePressed(MouseEvent e)
328 super.mousePressed(e);
333 public void mouseClicked(MouseEvent e)
337 validateSelections();
342 public void mouseReleased(MouseEvent e)
346 validateSelections();
350 boolean popupAction(MouseEvent e)
352 if (e.isPopupTrigger())
354 Point pt = e.getPoint();
355 int selectedRow = tbl_summary.rowAtPoint(pt);
356 if (showPopupFor(selectedRow, pt.x, pt.y))
364 tbl_summary.addKeyListener(new KeyAdapter()
367 public void keyPressed(KeyEvent evt)
369 validateSelections();
370 switch (evt.getKeyCode())
372 case KeyEvent.VK_ESCAPE: // escape key
375 case KeyEvent.VK_ENTER: // enter key
376 if (btn_add.isEnabled())
378 add_ActionPerformed();
381 case KeyEvent.VK_TAB: // tab key
382 if (evt.isShiftDown())
384 pnl_filter.requestFocus();
388 btn_add.requestFocus();
398 JButton btn_cancel = new JButton(
399 MessageManager.getString("action.cancel"));
400 btn_cancel.setFont(VERDANA_12);
401 btn_cancel.addActionListener(new java.awt.event.ActionListener()
404 public void actionPerformed(ActionEvent e)
406 closeAction(pnl_filter.getHeight());
409 btn_cancel.addKeyListener(new KeyAdapter()
412 public void keyPressed(KeyEvent evt)
414 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
416 closeAction(pnl_filter.getHeight());
421 tbl_local_pdb.setAutoCreateRowSorter(true);
422 tbl_local_pdb.getTableHeader().setReorderingAllowed(false);
423 tbl_local_pdb.addMouseListener(new MouseAdapter()
426 public void mouseClicked(MouseEvent e)
428 validateSelections();
432 public void mouseReleased(MouseEvent e)
434 validateSelections();
437 tbl_local_pdb.addKeyListener(new KeyAdapter()
440 public void keyPressed(KeyEvent evt)
442 validateSelections();
443 switch (evt.getKeyCode())
445 case KeyEvent.VK_ESCAPE: // escape key
448 case KeyEvent.VK_ENTER: // enter key
449 if (btn_add.isEnabled())
451 add_ActionPerformed();
454 case KeyEvent.VK_TAB: // tab key
455 if (evt.isShiftDown())
457 cmb_filterOption.requestFocus();
461 if (btn_add.isEnabled())
463 btn_add.requestFocus();
467 btn_cancel.requestFocus();
478 btn_newView = new JButton(
479 MessageManager.formatMessage("action.new_structure_view_with",
480 StructureViewer.getViewerType().toString()));
481 btn_newView.setFont(VERDANA_12);
482 btn_newView.addActionListener(new java.awt.event.ActionListener()
485 public void actionPerformed(ActionEvent e)
487 newView_ActionPerformed();
490 btn_newView.addKeyListener(new KeyAdapter()
493 public void keyPressed(KeyEvent evt)
495 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
497 newView_ActionPerformed();
502 // TODO: JAL-3898 - get list of available external programs to view
505 btn_add = new JButton(MessageManager.getString("action.add"));
506 btn_add.setFont(VERDANA_12);
507 btn_add.addActionListener(new java.awt.event.ActionListener()
510 public void actionPerformed(ActionEvent e)
512 add_ActionPerformed();
515 btn_add.addKeyListener(new KeyAdapter()
518 public void keyPressed(KeyEvent evt)
520 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
522 add_ActionPerformed();
527 btn_pdbFromFile.setFont(VERDANA_12);
528 String btn_title = MessageManager.getString("label.select_pdb_file");
529 btn_pdbFromFile.setText(btn_title + " ");
530 btn_pdbFromFile.addActionListener(new java.awt.event.ActionListener()
533 public void actionPerformed(ActionEvent e)
535 pdbFromFile_actionPerformed();
538 btn_pdbFromFile.addKeyListener(new KeyAdapter()
541 public void keyPressed(KeyEvent evt)
543 if (evt.getKeyCode() == KeyEvent.VK_ENTER)
545 pdbFromFile_actionPerformed();
550 JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
551 scrl_foundStructures.setPreferredSize(new Dimension(width, height));
553 JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
554 scrl_localPDB.setPreferredSize(new Dimension(width, height));
555 scrl_localPDB.setHorizontalScrollBarPolicy(
556 JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
558 chk_invertFilter.setFont(VERDANA_12);
559 txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true,
560 MessageManager.getString("label.enter_pdb_id_tip")));
561 txt_search.getDocument().addDocumentListener(new DocumentListener()
564 public void insertUpdate(DocumentEvent e)
566 txt_search_ActionPerformedDelayed();
570 public void removeUpdate(DocumentEvent e)
572 txt_search_ActionPerformedDelayed();
576 public void changedUpdate(DocumentEvent e)
578 txt_search_ActionPerformedDelayed();
582 cmb_filterOption.setFont(VERDANA_12);
583 cmb_filterOption.setToolTipText(
584 MessageManager.getString("info.select_filter_option"));
585 cmb_filterOption.addItemListener(this);
586 // add CustomComboSeparatorsRenderer to filter option combo-box
587 cmb_filterOption.setRenderer(new CustomComboSeparatorsRenderer(
588 (ListCellRenderer<Object>) cmb_filterOption.getRenderer())
591 protected boolean addSeparatorAfter(JList list, FilterOption value,
594 return value.isAddSeparatorAfter();
598 chk_invertFilter.addItemListener(this);
599 btn_queryTDB = new JButton();
600 if (Platform.isMac())
602 // needed to make icon button have round corners in vaqua
603 btn_queryTDB.putClientProperty("JButton.buttonType","bevel");
604 btn_queryTDB.setMargin(new Insets(0, 16, 0, 20));
608 btn_queryTDB.setMargin(new Insets(2, 16, 2, 20));
610 btn_queryTDB.setText(MessageManager.getString("label.search_3dbeacons"));
611 btn_queryTDB.setIconTextGap(12);
612 btn_queryTDB.setIcon(tdbImage);
613 btn_queryTDB.setVerticalTextPosition(SwingConstants.CENTER);
614 btn_queryTDB.setHorizontalTextPosition(SwingConstants.TRAILING);
615 btn_queryTDB.setFont(VERDANA_12);
616 btn_queryTDB.setToolTipText(
617 MessageManager.getString("label.find_models_from_3dbeacons"));
618 // btn_queryTDB.setPreferredSize(new Dimension(200, 32));
619 btn_queryTDB.setVisible(false);
621 targetView.setVisible(false);
623 JPanel actionsPanel = new JPanel(new MigLayout());
624 actionsPanel.add(targetView, "left");
625 actionsPanel.add(btn_add, "wrap");
626 actionsPanel.add(chk_superpose, "left");
627 actionsPanel.add(btn_newView);
628 actionsPanel.add(btn_cancel, "right");
630 JPanel pnl_main = new JPanel(new BorderLayout());
631 JPanel pnl_controls = new JPanel();
632 pnl_queryTDB = new JPanel();
633 pnl_queryTDB.setLayout(new FlowLayout(FlowLayout.CENTER, 4, 4));
634 pnl_queryTDB.setBackground(getBackground());
635 pnl_queryTDB.add(btn_queryTDB);
637 pnl_queryTDB.setVisible(false);
638 pnl_main.add(pnl_queryTDB, BorderLayout.NORTH);
639 pnl_controls.add(cmb_filterOption);
640 pnl_controls.add(lbl_loading);
641 pnl_controls.add(chk_invertFilter);
642 pnl_main.add(pnl_controls, BorderLayout.CENTER);
643 lbl_loading.setVisible(false);
645 JPanel pnl_fileChooser = new JPanel(new FlowLayout());
646 pnl_fileChooser.add(btn_pdbFromFile);
647 pnl_fileChooser.add(lbl_fromFileStatus);
648 JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
649 pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH);
650 pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER);
652 JPanel pnl_idInput = new JPanel(new FlowLayout());
653 pnl_idInput.add(txt_search);
654 pnl_idInput.add(lbl_pdbManualFetchStatus);
656 JPanel pnl_idInputBL = new JPanel(new BorderLayout());
657 pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH);
658 pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER);
660 final String foundStructureSummary = MessageManager
661 .getString("label.found_structures_summary");
662 final String configureCols = MessageManager
663 .getString("label.configure_displayed_columns");
664 ChangeListener changeListener = new ChangeListener()
667 public void stateChanged(ChangeEvent changeEvent)
669 JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
671 int index = sourceTabbedPane.getSelectedIndex();
672 btn_add.setVisible(targetView.isVisible());
673 btn_newView.setVisible(true);
674 btn_cancel.setVisible(true);
675 if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
677 btn_add.setEnabled(false);
678 btn_cancel.setEnabled(false);
679 btn_add.setVisible(false);
680 btn_newView.setEnabled(false);
681 btn_cancel.setVisible(false);
682 previousWantedFields = getFTSDocFieldPrefs()
683 .getStructureSummaryFields()
684 .toArray(new FTSDataColumnI[0]);
686 if (sourceTabbedPane.getTitleAt(index)
687 .equals(foundStructureSummary))
689 btn_cancel.setEnabled(true);
690 if (wantedFieldsUpdated())
696 validateSelections();
701 pnl_filter.addChangeListener(changeListener);
702 pnl_filter.setPreferredSize(new Dimension(width, height));
703 pnl_filter.add(foundStructureSummary, scrl_foundStructures);
704 pnl_filter.add(configureCols, getFTSDocFieldPrefs());
706 JPanel pnl_locPDB = new JPanel(new BorderLayout());
707 pnl_locPDB.add(scrl_localPDB);
709 pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE);
710 pnl_switchableViews.add(pnl_idInputBL, VIEWS_ENTER_ID);
711 pnl_switchableViews.add(pnl_filter, VIEWS_FILTER);
712 pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB);
714 this.setLayout(new BorderLayout());
715 this.add(pnl_main, java.awt.BorderLayout.NORTH);
716 this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER);
717 // this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
718 statusPanel.setLayout(new GridLayout());
720 JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
721 pnl_actionsAndStatus.add(actionsPanel, BorderLayout.CENTER);
722 pnl_actionsAndStatus.add(statusPanel, BorderLayout.SOUTH);
723 statusPanel.add(statusBar, null);
724 this.add(pnl_actionsAndStatus, java.awt.BorderLayout.SOUTH);
726 mainFrame.addInternalFrameListener(
727 new javax.swing.event.InternalFrameAdapter()
730 public void internalFrameClosing(InternalFrameEvent e)
732 closeAction(pnl_filter.getHeight());
735 mainFrame.setVisible(true);
736 mainFrame.setContentPane(this);
737 mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
738 Integer x = tempUserPrefs.get("structureChooser.x");
739 Integer y = tempUserPrefs.get("structureChooser.y");
740 if (x != null && y != null)
742 mainFrame.setLocation(x, y);
744 Desktop.addInternalFrame(mainFrame, frameTitle, width, height);
747 protected abstract boolean showPopupFor(int selectedRow, int x, int y);
749 protected void closeAction(int preferredHeight)
751 // System.out.println(">>>>>>>>>> closing internal frame!!!");
752 // System.out.println("width : " + mainFrame.getWidth());
753 // System.out.println("heigh : " + mainFrame.getHeight());
754 // System.out.println("x : " + mainFrame.getX());
755 // System.out.println("y : " + mainFrame.getY());
756 tempUserPrefs.put("structureChooser.width", pnl_filter.getWidth());
757 tempUserPrefs.put("structureChooser.height", preferredHeight);
758 tempUserPrefs.put("structureChooser.x", mainFrame.getX());
759 tempUserPrefs.put("structureChooser.y", mainFrame.getY());
763 public boolean wantedFieldsUpdated()
765 if (previousWantedFields == null)
770 FTSDataColumnI[] currentWantedFields = getFTSDocFieldPrefs()
771 .getStructureSummaryFields().toArray(new FTSDataColumnI[0]);
772 return Arrays.equals(currentWantedFields, previousWantedFields) ? false
779 * Event listener for the 'filter' combo-box and 'invert' check-box
781 public void itemStateChanged(ItemEvent e)
787 * This inner class provides the provides the data model for associate
788 * sequence combo-box - cmb_assSeq
793 public class AssociateSeqOptions
795 private SequenceI sequence;
799 public AssociateSeqOptions(SequenceI seq)
802 this.name = (seq.getName().length() >= 23)
803 ? seq.getName().substring(0, 23)
807 public AssociateSeqOptions(String name, SequenceI seq)
814 public String toString()
819 public String getName()
824 public void setName(String name)
829 public SequenceI getSequence()
834 public void setSequence(SequenceI sequence)
836 this.sequence = sequence;
842 * This inner class holds the Layout and configuration of the panel which
843 * handles association of manually fetched structures to a unique sequence
844 * when more than one sequence selection is made
849 public class AssociateSeqPanel extends JPanel implements ItemListener
851 private JComboBox<AssociateSeqOptions> cmb_assSeq = new JComboBox<>();
853 private JLabel lbl_associateSeq = new JLabel();
855 public AssociateSeqPanel()
857 this.setLayout(new FlowLayout());
858 this.add(cmb_assSeq);
859 this.add(lbl_associateSeq);
860 cmb_assSeq.setToolTipText(
861 MessageManager.getString("info.associate_wit_sequence"));
862 cmb_assSeq.addItemListener(this);
865 public void loadCmbAssSeq()
867 populateCmbAssociateSeqOptions(cmb_assSeq, lbl_associateSeq);
870 public JComboBox<AssociateSeqOptions> getCmb_assSeq()
875 public void setCmb_assSeq(JComboBox<AssociateSeqOptions> cmb_assSeq)
877 this.cmb_assSeq = cmb_assSeq;
881 public void itemStateChanged(ItemEvent e)
883 if (e.getStateChange() == ItemEvent.SELECTED)
885 cmbAssSeqStateChanged();
890 public JTable getResultTable()
895 public JComboBox<FilterOption> getCmbFilterOption()
897 return cmb_filterOption;
901 * Custom ListCellRenderer for adding a separator between different categories
902 * of structure chooser filter option drop-down.
907 public abstract class CustomComboSeparatorsRenderer
908 implements ListCellRenderer<Object>
910 private ListCellRenderer<Object> regent;
912 private JPanel separatorPanel = new JPanel(new BorderLayout());
914 private JSeparator jSeparator = new JSeparator();
916 public CustomComboSeparatorsRenderer(
917 ListCellRenderer<Object> listCellRenderer)
919 this.regent = listCellRenderer;
923 public Component getListCellRendererComponent(JList list, Object value,
924 int index, boolean isSelected, boolean cellHasFocus)
927 Component comp = regent.getListCellRendererComponent(list, value,
928 index, isSelected, cellHasFocus);
930 && addSeparatorAfter(list, (FilterOption) value, index))
932 separatorPanel.removeAll();
933 separatorPanel.add(comp, BorderLayout.CENTER);
934 separatorPanel.add(jSeparator, BorderLayout.SOUTH);
935 return separatorPanel;
943 protected abstract boolean addSeparatorAfter(JList list,
944 FilterOption value, int index);
947 protected abstract void stateChanged(ItemEvent e);
949 protected abstract void add_ActionPerformed();
951 protected abstract void newView_ActionPerformed();
953 protected abstract void pdbFromFile_actionPerformed();
955 protected abstract void txt_search_ActionPerformed();
957 protected abstract void populateCmbAssociateSeqOptions(
958 JComboBox<AssociateSeqOptions> cmb_assSeq,
959 JLabel lbl_associateSeq);
961 protected abstract void cmbAssSeqStateChanged();
963 protected abstract void tabRefresh();
965 protected abstract void validateSelections();
967 public JInternalFrame getFrame()