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.
23 import jalview.api.AlignViewportI;
24 import jalview.api.AlignmentViewPanel;
25 import jalview.bin.Cache;
26 import jalview.datamodel.Alignment;
27 import jalview.datamodel.AlignmentI;
28 import jalview.datamodel.HiddenColumns;
29 import jalview.datamodel.PDBEntry;
30 import jalview.datamodel.SequenceI;
31 import jalview.gui.StructureViewer.ViewerType;
32 import jalview.gui.ViewSelectionMenu.ViewSetProvider;
33 import jalview.io.DataSourceType;
34 import jalview.io.JalviewFileChooser;
35 import jalview.io.JalviewFileView;
36 import jalview.jbgui.GStructureViewer;
37 import jalview.schemes.ColourSchemeI;
38 import jalview.schemes.ColourSchemes;
39 import jalview.structure.StructureMapping;
40 import jalview.structures.models.AAStructureBindingModel;
41 import jalview.util.MessageManager;
43 import java.awt.Color;
44 import java.awt.Component;
45 import java.awt.event.ActionEvent;
46 import java.awt.event.ActionListener;
47 import java.awt.event.ItemEvent;
48 import java.awt.event.ItemListener;
49 import java.io.BufferedReader;
51 import java.io.FileOutputStream;
52 import java.io.FileReader;
53 import java.io.IOException;
54 import java.io.PrintWriter;
55 import java.util.ArrayList;
56 import java.util.Collections;
57 import java.util.List;
58 import java.util.Vector;
60 import javax.swing.ButtonGroup;
61 import javax.swing.JCheckBoxMenuItem;
62 import javax.swing.JColorChooser;
63 import javax.swing.JMenu;
64 import javax.swing.JMenuItem;
65 import javax.swing.JRadioButtonMenuItem;
66 import javax.swing.event.MenuEvent;
67 import javax.swing.event.MenuListener;
70 * Base class with common functionality for JMol, Chimera or other structure
76 public abstract class StructureViewerBase extends GStructureViewer
77 implements Runnable, ViewSetProvider
80 * names for colour options (additional to Jalview colour schemes)
84 BySequence, ByChain, ChargeCysteine, ByViewer
88 * list of sequenceSet ids associated with the view
90 protected List<String> _aps = new ArrayList<>();
93 * list of alignment panels to use for superposition
95 protected Vector<AlignmentViewPanel> _alignwith = new Vector<>();
98 * list of alignment panels that are used for colouring structures by aligned
101 protected Vector<AlignmentViewPanel> _colourwith = new Vector<>();
103 private String viewId = null;
105 private AlignmentPanel ap;
107 protected boolean alignAddedStructures = false;
109 protected volatile boolean _started = false;
111 protected volatile boolean addingStructures = false;
113 protected Thread worker = null;
115 protected boolean allChainsSelected = false;
117 protected JMenu viewSelectionMenu;
120 * set after sequence colouring has been applied for this structure viewer.
121 * used to determine if the final sequence/structure mapping has been
124 protected volatile boolean seqColoursApplied = false;
127 * Default constructor
129 public StructureViewerBase()
135 * @return true if added structures should be aligned to existing one(s)
138 public boolean isAlignAddedStructures()
140 return alignAddedStructures;
146 * if added structures should be aligned to existing one(s)
149 public void setAlignAddedStructures(boolean alignAdded)
151 alignAddedStructures = alignAdded;
157 * @return true if this Jmol instance is linked with the given alignPanel
159 public boolean isLinkedWith(AlignmentPanel ap2)
161 return _aps.contains(ap2.av.getSequenceSetId());
164 public boolean isUsedforaligment(AlignmentPanel ap2)
167 return (_alignwith != null) && _alignwith.contains(ap2);
171 public boolean isUsedforcolourby(AlignmentViewPanel avp)
173 return (_colourwith != null) && _colourwith.contains(avp);
178 * @return TRUE if the view is NOT being coloured by the alignment colours.
180 public boolean isColouredByViewer()
182 return !getBinding().isColourBySequence();
185 public String getViewId()
189 viewId = System.currentTimeMillis() + "." + this.hashCode();
194 protected void setViewId(String viewId)
196 this.viewId = viewId;
199 public abstract String getStateInfo();
201 protected void buildActionMenu()
203 if (_alignwith == null)
205 _alignwith = new Vector<>();
207 if (_alignwith.size() == 0 && ap != null)
212 for (Component c : viewerActionMenu.getMenuComponents())
214 if (c != alignStructs)
216 viewerActionMenu.remove((JMenuItem) c);
221 public AlignmentPanel getAlignmentPanel()
226 protected void setAlignmentPanel(AlignmentPanel alp)
232 public AlignmentPanel[] getAllAlignmentPanels()
234 AlignmentPanel[] t, list = new AlignmentPanel[0];
235 for (String setid : _aps)
237 AlignmentPanel[] panels = PaintRefresher.getAssociatedPanels(setid);
240 t = new AlignmentPanel[list.length + panels.length];
241 System.arraycopy(list, 0, t, 0, list.length);
242 System.arraycopy(panels, 0, t, list.length, panels.length);
251 * set the primary alignmentPanel reference and add another alignPanel to the
252 * list of ones to use for colouring and aligning
256 public void addAlignmentPanel(AlignmentPanel nap)
258 if (getAlignmentPanel() == null)
260 setAlignmentPanel(nap);
262 if (!_aps.contains(nap.av.getSequenceSetId()))
264 _aps.add(nap.av.getSequenceSetId());
269 * remove any references held to the given alignment panel
273 public void removeAlignmentPanel(AlignmentPanel nap)
277 _alignwith.remove(nap);
278 _colourwith.remove(nap);
279 if (getAlignmentPanel() == nap)
281 setAlignmentPanel(null);
282 for (AlignmentPanel aps : getAllAlignmentPanels())
286 setAlignmentPanel(aps);
291 } catch (Exception ex)
294 if (getAlignmentPanel() != null)
300 public void useAlignmentPanelForSuperposition(AlignmentPanel nap)
302 addAlignmentPanel(nap);
303 if (!_alignwith.contains(nap))
309 public void excludeAlignmentPanelForSuperposition(AlignmentPanel nap)
311 if (_alignwith.contains(nap))
313 _alignwith.remove(nap);
317 public void useAlignmentPanelForColourbyseq(AlignmentPanel nap,
318 boolean enableColourBySeq)
320 useAlignmentPanelForColourbyseq(nap);
321 getBinding().setColourBySequence(enableColourBySeq);
322 seqColour.setSelected(enableColourBySeq);
323 viewerColour.setSelected(!enableColourBySeq);
326 public void useAlignmentPanelForColourbyseq(AlignmentPanel nap)
328 addAlignmentPanel(nap);
329 if (!_colourwith.contains(nap))
331 _colourwith.add(nap);
335 public void excludeAlignmentPanelForColourbyseq(AlignmentPanel nap)
337 if (_colourwith.contains(nap))
339 _colourwith.remove(nap);
343 public abstract ViewerType getViewerType();
345 protected abstract IProgressIndicator getIProgressIndicator();
348 * add a new structure (with associated sequences and chains) to this viewer,
349 * retrieving it if necessary first.
355 * if true, new structure(s) will be aligned using associated
359 protected void addStructure(final PDBEntry pdbentry,
360 final SequenceI[] seqs, final String[] chains,
361 final IProgressIndicator alignFrame)
363 if (pdbentry.getFile() == null)
365 if (worker != null && worker.isAlive())
367 // a retrieval is in progress, wait around and add ourselves to the
369 new Thread(new Runnable()
374 while (worker != null && worker.isAlive() && _started)
378 Thread.sleep(100 + ((int) Math.random() * 100));
380 } catch (Exception e)
384 // and call ourselves again.
385 addStructure(pdbentry, seqs, chains, alignFrame);
391 // otherwise, start adding the structure.
392 getBinding().addSequenceAndChain(new PDBEntry[] { pdbentry },
394 { seqs }, new String[][] { chains });
395 addingStructures = true;
397 worker = new Thread(this);
402 protected boolean hasPdbId(String pdbId)
404 return getBinding().hasPdbId(pdbId);
408 * Returns a list of any viewer of the instantiated type. The list is
409 * restricted to those linked to the given alignment panel if it is not null.
411 protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
413 return Desktop.instance.getStructureViewers(alp, this.getClass());
417 public void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
418 String[] chains, final AlignmentViewPanel apanel, String pdbId)
421 * JAL-1742 exclude view with this structure already mapped (don't offer
422 * to align chain B to chain A of the same structure); code may defend
423 * against this possibility before we reach here
429 AlignmentPanel alignPanel = (AlignmentPanel) apanel; // Implementation error if this
431 useAlignmentPanelForSuperposition(alignPanel);
432 addStructure(pdbentry, seq, chains, alignPanel.alignFrame);
436 * Adds mappings for the given sequences to an already opened PDB structure,
437 * and updates any viewers that have the PDB file
444 public void addSequenceMappingsToStructure(SequenceI[] seq,
445 String[] chains, final AlignmentViewPanel alpanel,
448 AlignmentPanel apanel = (AlignmentPanel) alpanel;
450 // TODO : Fix multiple seq to one chain issue here.
452 * create the mappings
454 apanel.getStructureSelectionManager().setMapping(seq, chains,
455 pdbFilename, DataSourceType.FILE, getIProgressIndicator());
458 * alert the FeatureRenderer to show new (PDB RESNUM) features
460 if (apanel.getSeqPanel().seqCanvas.fr != null)
462 apanel.getSeqPanel().seqCanvas.fr.featuresAdded();
463 // note - we don't do a refresh for structure here because we do it
464 // explicitly for all panels later on
465 apanel.paintAlignment(true, false);
469 * add the sequences to any other viewers (of the same type) for this pdb
472 // JBPNOTE: this looks like a binding routine, rather than a gui routine
473 for (StructureViewerBase viewer : getViewersFor(null))
475 AAStructureBindingModel bindingModel = viewer.getBinding();
476 for (int pe = 0; pe < bindingModel.getPdbCount(); pe++)
478 if (bindingModel.getPdbEntry(pe).getFile().equals(pdbFilename))
480 bindingModel.addSequence(pe, seq);
481 viewer.addAlignmentPanel(apanel);
483 * add it to the set of alignments used for colouring structure by
486 viewer.useAlignmentPanelForColourbyseq(apanel);
487 viewer.buildActionMenu();
488 apanel.getStructureSelectionManager()
489 .sequenceColoursChanged(apanel);
497 public boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
498 final AlignmentViewPanel apanel, String pdbId)
500 String alreadyMapped = apanel.getStructureSelectionManager()
501 .alreadyMappedToFile(pdbId);
503 if (alreadyMapped == null)
508 addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
512 void setChainMenuItems(List<String> chainNames)
514 chainMenu.removeAll();
515 if (chainNames == null || chainNames.isEmpty())
521 * add the 'All' menu item
523 JMenuItem menuItem = new JMenuItem(
524 MessageManager.getString("label.all"));
525 menuItem.addActionListener(new ActionListener()
528 public void actionPerformed(ActionEvent evt)
530 allChainsSelected = true;
531 for (int i = 0; i < chainMenu.getItemCount(); i++)
533 if (chainMenu.getItem(i) instanceof JCheckBoxMenuItem)
535 ((JCheckBoxMenuItem) chainMenu.getItem(i)).setSelected(true);
538 showSelectedChains();
539 allChainsSelected = false;
542 chainMenu.add(menuItem);
545 * add a menu item for each structure and chain
547 Collections.sort(chainNames);
548 String lastSeqName = "";
549 for (String chain : chainNames)
551 String seqName = getSequenceNameForChain(chain);
552 int nameLength = seqName.length();
555 seqName = seqName.substring(0, 8) + "..."
556 + seqName.substring(nameLength - 8, nameLength);
559 if (!lastSeqName.equals(seqName))
561 text = text + " " + seqName;
563 lastSeqName = seqName;
564 menuItem = new JCheckBoxMenuItem(text, true);
565 menuItem.addItemListener(new ItemListener()
568 public void itemStateChanged(ItemEvent evt)
570 if (!allChainsSelected)
572 showSelectedChains();
577 chainMenu.add(menuItem);
582 * Answers the name of the sequence mapped to the given chain (formatted as
583 * pdbId:chainId, e.g. 1A70:A). Answers null if no mapped sequence is found. If
584 * more than one sequence is matched, just answers the name of the first one
590 private String getSequenceNameForChain(String chain)
592 String[] tokens = chain.split(":");
593 String pdbId = tokens[0];
594 String chainId = tokens[1];
595 List<StructureMapping> mappings = getBinding().getSsm()
596 .getMappingForChain(pdbId, chainId);
597 return mappings.isEmpty() ? null
598 : mappings.get(0).getSequence().getName();
602 * Action on selecting one of Jalview's registered colour schemes
605 public void changeColour_actionPerformed(String colourSchemeName)
607 AlignmentI al = getAlignmentPanel().av.getAlignment();
608 ColourSchemeI cs = ColourSchemes.getInstance()
609 .getColourScheme(colourSchemeName, getAlignmentPanel().av, al,
611 getBinding().setJalviewColourScheme(cs);
615 * Builds the colour menu
617 protected void buildColourMenu()
619 colourMenu.removeAll();
620 AlignmentI al = getAlignmentPanel().av.getAlignment();
623 * add colour by sequence, by chain, by charge and cysteine
625 colourMenu.add(seqColour);
626 colourMenu.add(chainColour);
627 colourMenu.add(chargeColour);
628 chargeColour.setEnabled(!al.isNucleotide());
631 * add all 'simple' (per-residue) colour schemes registered to Jalview
633 ButtonGroup itemGroup = ColourMenuHelper.addMenuItems(colourMenu, this,
637 * add 'colour by viewer' (menu item text is set in subclasses)
639 viewerColour.setSelected(false);
640 viewerColour.addActionListener(new ActionListener()
643 public void actionPerformed(ActionEvent actionEvent)
645 viewerColour_actionPerformed(actionEvent);
648 colourMenu.add(viewerColour);
651 * add 'set background colour'
653 JMenuItem backGround = new JMenuItem();
655 .setText(MessageManager.getString("action.background_colour"));
656 backGround.addActionListener(new ActionListener()
659 public void actionPerformed(ActionEvent actionEvent)
661 background_actionPerformed(actionEvent);
664 colourMenu.add(backGround);
667 * add colour buttons to a group so their selection is
668 * mutually exclusive (background colour is a separate option)
670 itemGroup.add(seqColour);
671 itemGroup.add(chainColour);
672 itemGroup.add(chargeColour);
673 itemGroup.add(viewerColour);
677 * Construct menu items
679 protected void initMenus()
681 AAStructureBindingModel binding = getBinding();
683 seqColour = new JRadioButtonMenuItem();
684 seqColour.setText(MessageManager.getString("action.by_sequence"));
685 seqColour.setName(ViewerColour.BySequence.name());
686 seqColour.setSelected(binding.isColourBySequence());
687 seqColour.addActionListener(new ActionListener()
690 public void actionPerformed(ActionEvent actionEvent)
692 seqColour_actionPerformed(actionEvent);
696 chainColour = new JRadioButtonMenuItem();
697 chainColour.setText(MessageManager.getString("action.by_chain"));
698 chainColour.setName(ViewerColour.ByChain.name());
699 chainColour.addActionListener(new ActionListener()
702 public void actionPerformed(ActionEvent actionEvent)
704 chainColour_actionPerformed(actionEvent);
708 chargeColour = new JRadioButtonMenuItem();
709 chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
710 chargeColour.setName(ViewerColour.ChargeCysteine.name());
711 chargeColour.addActionListener(new ActionListener()
714 public void actionPerformed(ActionEvent actionEvent)
716 chargeColour_actionPerformed(actionEvent);
720 viewerColour = new JRadioButtonMenuItem();
721 // text is set in overrides of this method
722 viewerColour.setName(ViewerColour.ByViewer.name());
723 viewerColour.setSelected(!binding.isColourBySequence());
725 if (_colourwith == null)
727 _colourwith = new Vector<>();
729 if (_alignwith == null)
731 _alignwith = new Vector<>();
734 ViewSelectionMenu seqColourBy = new ViewSelectionMenu(
735 MessageManager.getString("label.colour_by"), this, _colourwith,
739 public void itemStateChanged(ItemEvent e)
741 if (!seqColour.isSelected())
747 // update the Chimera display now.
748 seqColour_actionPerformed(null);
752 viewMenu.add(seqColourBy);
754 showAlignmentOnly = new JCheckBoxMenuItem(
755 MessageManager.getString("label.show_alignment_only"));
756 showAlignmentOnly.addActionListener(new ActionListener()
759 public void actionPerformed(ActionEvent e)
761 hideHiddenRegions.setEnabled(showAlignmentOnly.isSelected());
762 getBinding().setShowAlignmentOnly(showAlignmentOnly.isSelected());
763 getBinding().showStructures(getAlignmentPanel().getAlignViewport(),
767 viewMenu.add(showAlignmentOnly);
769 hideHiddenRegions = new JCheckBoxMenuItem(
770 MessageManager.getString("label.hide_hidden_regions"));
771 hideHiddenRegions.setEnabled(false);
772 hideHiddenRegions.addActionListener(new ActionListener()
775 public void actionPerformed(ActionEvent e)
777 getBinding().setHideHiddenRegions(hideHiddenRegions.isSelected());
778 getBinding().showStructures(getAlignmentPanel().getAlignViewport(),
782 viewMenu.add(hideHiddenRegions);
784 final ItemListener handler = new ItemListener()
787 public void itemStateChanged(ItemEvent e)
789 alignStructs.setEnabled(!_alignwith.isEmpty());
790 alignStructs.setToolTipText(MessageManager.formatMessage(
791 "label.align_structures_using_linked_alignment_views",
795 viewSelectionMenu = new ViewSelectionMenu(
796 MessageManager.getString("label.superpose_with"), this,
797 _alignwith, handler);
798 handler.itemStateChanged(null);
799 viewerActionMenu.add(viewSelectionMenu, 0);
800 viewerActionMenu.addMenuListener(new MenuListener()
803 public void menuSelected(MenuEvent e)
805 handler.itemStateChanged(null);
809 public void menuDeselected(MenuEvent e)
814 public void menuCanceled(MenuEvent e)
823 * Sends commands to the structure viewer to superimpose structures based on
824 * currently associated alignments. May optionally return an error message for
828 protected String alignStructs_actionPerformed(ActionEvent actionEvent)
830 return alignStructs_withAllAlignPanels();
833 protected String alignStructs_withAllAlignPanels()
835 if (getAlignmentPanel() == null)
840 if (_alignwith.size() == 0)
842 _alignwith.add(getAlignmentPanel());
848 AlignmentI[] als = new Alignment[_alignwith.size()];
849 HiddenColumns[] alc = new HiddenColumns[_alignwith.size()];
850 int[] alm = new int[_alignwith.size()];
853 for (AlignmentViewPanel alignPanel : _alignwith)
855 AlignViewportI av = alignPanel.getAlignViewport();
856 als[a] = av.getAlignment();
858 alc[a++] = av.getAlignment().getHiddenColumns();
860 reply = getBinding().superposeStructures(als, alm, alc);
863 String text = MessageManager
864 .formatMessage("error.superposition_failed", reply);
865 statusBar.setText(text);
867 } catch (Exception e)
869 StringBuffer sp = new StringBuffer();
870 for (AlignmentViewPanel avp : _alignwith)
873 "'" + ((AlignmentPanel) avp).alignFrame.getTitle() + "' ");
875 Cache.log.info("Couldn't align structures with the " + sp.toString()
876 + "associated alignment panels.", e);
882 public void background_actionPerformed(ActionEvent actionEvent)
884 Color col = JColorChooser.showDialog(this,
885 MessageManager.getString("label.select_background_colour"),
889 getBinding().setBackgroundColour(col);
894 public void viewerColour_actionPerformed(ActionEvent actionEvent)
896 if (viewerColour.isSelected())
898 // disable automatic sequence colouring.
899 getBinding().setColourBySequence(false);
904 public void chainColour_actionPerformed(ActionEvent actionEvent)
906 chainColour.setSelected(true);
907 getBinding().colourByChain();
911 public void chargeColour_actionPerformed(ActionEvent actionEvent)
913 chargeColour.setSelected(true);
914 getBinding().colourByCharge();
918 public void seqColour_actionPerformed(ActionEvent actionEvent)
920 AAStructureBindingModel binding = getBinding();
921 binding.setColourBySequence(seqColour.isSelected());
922 if (_colourwith == null)
924 _colourwith = new Vector<>();
926 if (binding.isColourBySequence())
928 if (!binding.isLoadingFromArchive())
930 if (_colourwith.size() == 0 && getAlignmentPanel() != null)
932 // Make the currently displayed alignment panel the associated view
933 _colourwith.add(getAlignmentPanel().alignFrame.alignPanel);
936 // Set the colour using the current view for the associated alignframe
937 for (AlignmentViewPanel avp : _colourwith)
939 binding.updateStructureColours(avp);
941 seqColoursApplied = true;
946 public void pdbFile_actionPerformed(ActionEvent actionEvent)
948 JalviewFileChooser chooser = new JalviewFileChooser(
949 Cache.getProperty("LAST_DIRECTORY"));
951 chooser.setFileView(new JalviewFileView());
952 chooser.setDialogTitle(MessageManager.getString("label.save_pdb_file"));
953 chooser.setToolTipText(MessageManager.getString("action.save"));
955 int value = chooser.showSaveDialog(this);
957 if (value == JalviewFileChooser.APPROVE_OPTION)
959 BufferedReader in = null;
962 // TODO: cope with multiple PDB files in view
963 in = new BufferedReader(
964 new FileReader(getBinding().getStructureFiles()[0]));
965 File outFile = chooser.getSelectedFile();
967 PrintWriter out = new PrintWriter(new FileOutputStream(outFile));
969 while ((data = in.readLine()) != null)
971 if (!(data.indexOf("<PRE>") > -1 || data.indexOf("</PRE>") > -1))
977 } catch (Exception ex)
979 ex.printStackTrace();
987 } catch (IOException e)
997 public void viewMapping_actionPerformed(ActionEvent actionEvent)
999 CutAndPasteTransfer cap = new CutAndPasteTransfer();
1002 cap.appendText(getBinding().printMappings());
1003 } catch (OutOfMemoryError e)
1006 "composing sequence-structure alignments for display in text box.",
1011 Desktop.addInternalFrame(cap,
1012 MessageManager.getString("label.pdb_sequence_mapping"), 550,
1016 protected abstract String getViewerName();
1019 * Configures the title and menu items of the viewer panel.
1022 public void updateTitleAndMenus()
1024 AAStructureBindingModel binding = getBinding();
1025 if (binding.hasFileLoadingError())
1030 setChainMenuItems(binding.getChainNames());
1032 this.setTitle(binding.getViewerTitle(getViewerName(), true));
1035 * enable 'Superpose with' if more than one mapped structure
1037 viewSelectionMenu.setEnabled(false);
1038 if (getBinding().getStructureFiles().length > 1
1039 && getBinding().getSequence().length > 1)
1041 viewSelectionMenu.setEnabled(true);
1045 * Show action menu if it has any enabled items
1047 viewerActionMenu.setVisible(false);
1048 for (int i = 0; i < viewerActionMenu.getItemCount(); i++)
1050 if (viewerActionMenu.getItem(i).isEnabled())
1052 viewerActionMenu.setVisible(true);
1057 if (!binding.isLoadingFromArchive())
1059 seqColour_actionPerformed(null);
1064 public String toString()
1070 public boolean hasMapping()
1072 if (worker != null && (addingStructures || _started))
1076 if (getBinding() == null)
1078 if (_aps == null || _aps.size() == 0)
1080 // viewer has been closed, but we did at some point run.
1085 String[] pdbids = getBinding().getStructureFiles();
1091 for (String pdbid:pdbids) {
1092 StructureMapping sm[] = getBinding().getSsm().getMapping(pdbid);
1093 if (sm!=null && sm.length>0 && sm[0]!=null) {
1097 // only return true if there is a mapping for every structure file we have loaded
1098 if (p == 0 || p != pdbids.length)
1102 // and that coloring has been applied
1103 return seqColoursApplied;
1107 public void raiseViewer()
1113 public abstract AAStructureBindingModel getBinding();
1116 * Show only the selected chain(s) in the viewer
1118 protected void showSelectedChains()
1120 setSelectedChains();
1123 * refresh display without resizing - easier to see what changed
1125 getBinding().showStructures(getAlignmentPanel().getAlignViewport(),