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
79 private static final String UNMAPPED = "(unmapped)";
82 * names for colour options (additional to Jalview colour schemes)
86 BySequence, ByChain, ChargeCysteine, ByViewer
90 * list of sequenceSet ids associated with the view
92 protected List<String> _aps = new ArrayList<>();
95 * list of alignment panels to use for superposition
97 protected Vector<AlignmentViewPanel> _alignwith = new Vector<>();
100 * list of alignment panels that are used for colouring structures by aligned
103 protected Vector<AlignmentViewPanel> _colourwith = new Vector<>();
105 private String viewId = null;
107 private AlignmentPanel ap;
109 protected boolean alignAddedStructures = false;
111 protected volatile boolean _started = false;
113 protected volatile boolean addingStructures = false;
115 protected Thread worker = null;
117 protected boolean allChainsSelected = false;
119 protected JMenu viewSelectionMenu;
122 * set after sequence colouring has been applied for this structure viewer.
123 * used to determine if the final sequence/structure mapping has been
126 protected volatile boolean seqColoursApplied = false;
129 * Default constructor
131 public StructureViewerBase()
137 * @return true if added structures should be aligned to existing one(s)
140 public boolean isAlignAddedStructures()
142 return alignAddedStructures;
148 * if added structures should be aligned to existing one(s)
151 public void setAlignAddedStructures(boolean alignAdded)
153 alignAddedStructures = alignAdded;
159 * @return true if this Jmol instance is linked with the given alignPanel
161 public boolean isLinkedWith(AlignmentPanel ap2)
163 return _aps.contains(ap2.av.getSequenceSetId());
166 public boolean isUsedforaligment(AlignmentPanel ap2)
169 return (_alignwith != null) && _alignwith.contains(ap2);
173 public boolean isUsedforcolourby(AlignmentViewPanel avp)
175 return (_colourwith != null) && _colourwith.contains(avp);
180 * @return TRUE if the view is NOT being coloured by the alignment colours.
182 public boolean isColouredByViewer()
184 return !getBinding().isColourBySequence();
187 public String getViewId()
191 viewId = System.currentTimeMillis() + "." + this.hashCode();
196 protected void setViewId(String viewId)
198 this.viewId = viewId;
201 public abstract String getStateInfo();
203 protected void buildActionMenu()
205 if (_alignwith == null)
207 _alignwith = new Vector<>();
209 if (_alignwith.size() == 0 && ap != null)
214 for (Component c : viewerActionMenu.getMenuComponents())
216 if (c != alignStructs)
218 viewerActionMenu.remove((JMenuItem) c);
223 public AlignmentPanel getAlignmentPanel()
228 protected void setAlignmentPanel(AlignmentPanel alp)
234 public AlignmentPanel[] getAllAlignmentPanels()
236 AlignmentPanel[] t, list = new AlignmentPanel[0];
237 for (String setid : _aps)
239 AlignmentPanel[] panels = PaintRefresher.getAssociatedPanels(setid);
242 t = new AlignmentPanel[list.length + panels.length];
243 System.arraycopy(list, 0, t, 0, list.length);
244 System.arraycopy(panels, 0, t, list.length, panels.length);
253 * set the primary alignmentPanel reference and add another alignPanel to the
254 * list of ones to use for colouring and aligning
258 public void addAlignmentPanel(AlignmentPanel nap)
260 if (getAlignmentPanel() == null)
262 setAlignmentPanel(nap);
264 if (!_aps.contains(nap.av.getSequenceSetId()))
266 _aps.add(nap.av.getSequenceSetId());
271 * remove any references held to the given alignment panel
275 public void removeAlignmentPanel(AlignmentPanel nap)
279 _alignwith.remove(nap);
280 _colourwith.remove(nap);
281 if (getAlignmentPanel() == nap)
283 setAlignmentPanel(null);
284 for (AlignmentPanel aps : getAllAlignmentPanels())
288 setAlignmentPanel(aps);
293 } catch (Exception ex)
296 if (getAlignmentPanel() != null)
302 public void useAlignmentPanelForSuperposition(AlignmentPanel nap)
304 addAlignmentPanel(nap);
305 if (!_alignwith.contains(nap))
311 public void excludeAlignmentPanelForSuperposition(AlignmentPanel nap)
313 if (_alignwith.contains(nap))
315 _alignwith.remove(nap);
319 public void useAlignmentPanelForColourbyseq(AlignmentPanel nap,
320 boolean enableColourBySeq)
322 useAlignmentPanelForColourbyseq(nap);
323 getBinding().setColourBySequence(enableColourBySeq);
324 seqColour.setSelected(enableColourBySeq);
325 viewerColour.setSelected(!enableColourBySeq);
328 public void useAlignmentPanelForColourbyseq(AlignmentPanel nap)
330 addAlignmentPanel(nap);
331 if (!_colourwith.contains(nap))
333 _colourwith.add(nap);
337 public void excludeAlignmentPanelForColourbyseq(AlignmentPanel nap)
339 if (_colourwith.contains(nap))
341 _colourwith.remove(nap);
345 public abstract ViewerType getViewerType();
347 protected abstract IProgressIndicator getIProgressIndicator();
350 * add a new structure (with associated sequences and chains) to this viewer,
351 * retrieving it if necessary first.
357 * if true, new structure(s) will be aligned using associated
361 protected void addStructure(final PDBEntry pdbentry,
362 final SequenceI[] seqs, final String[] chains,
363 final IProgressIndicator alignFrame)
365 if (pdbentry.getFile() == null)
367 if (worker != null && worker.isAlive())
369 // a retrieval is in progress, wait around and add ourselves to the
371 new Thread(new Runnable()
376 while (worker != null && worker.isAlive() && _started)
380 Thread.sleep(100 + ((int) Math.random() * 100));
382 } catch (Exception e)
386 // and call ourselves again.
387 addStructure(pdbentry, seqs, chains, alignFrame);
393 // otherwise, start adding the structure.
394 getBinding().addSequenceAndChain(new PDBEntry[] { pdbentry },
396 { seqs }, new String[][] { chains });
397 addingStructures = true;
399 worker = new Thread(this);
404 protected boolean hasPdbId(String pdbId)
406 return getBinding().hasPdbId(pdbId);
410 * Returns a list of any viewer of the instantiated type. The list is
411 * restricted to those linked to the given alignment panel if it is not null.
413 protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
415 return Desktop.instance.getStructureViewers(alp, this.getClass());
419 public void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
420 String[] chains, final AlignmentViewPanel apanel, String pdbId)
423 * JAL-1742 exclude view with this structure already mapped (don't offer
424 * to align chain B to chain A of the same structure); code may defend
425 * against this possibility before we reach here
431 AlignmentPanel alignPanel = (AlignmentPanel) apanel; // Implementation error if this
433 useAlignmentPanelForSuperposition(alignPanel);
434 addStructure(pdbentry, seq, chains, alignPanel.alignFrame);
438 * Adds mappings for the given sequences to an already opened PDB structure,
439 * and updates any viewers that have the PDB file
446 public void addSequenceMappingsToStructure(SequenceI[] seq,
447 String[] chains, final AlignmentViewPanel alpanel,
450 AlignmentPanel apanel = (AlignmentPanel) alpanel;
452 // TODO : Fix multiple seq to one chain issue here.
454 * create the mappings
456 apanel.getStructureSelectionManager().setMapping(seq, chains,
457 pdbFilename, DataSourceType.FILE, getIProgressIndicator());
460 * alert the FeatureRenderer to show new (PDB RESNUM) features
462 if (apanel.getSeqPanel().seqCanvas.fr != null)
464 apanel.getSeqPanel().seqCanvas.fr.featuresAdded();
465 // note - we don't do a refresh for structure here because we do it
466 // explicitly for all panels later on
467 apanel.paintAlignment(true, false);
471 * add the sequences to any other viewers (of the same type) for this pdb
474 // JBPNOTE: this looks like a binding routine, rather than a gui routine
475 for (StructureViewerBase viewer : getViewersFor(null))
477 AAStructureBindingModel bindingModel = viewer.getBinding();
478 for (int pe = 0; pe < bindingModel.getPdbCount(); pe++)
480 if (bindingModel.getPdbEntry(pe).getFile().equals(pdbFilename))
482 bindingModel.addSequence(pe, seq);
483 viewer.addAlignmentPanel(apanel);
485 * add it to the set of alignments used for colouring structure by
488 viewer.useAlignmentPanelForColourbyseq(apanel);
489 viewer.buildActionMenu();
490 apanel.getStructureSelectionManager()
491 .sequenceColoursChanged(apanel);
499 public boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
500 final AlignmentViewPanel apanel, String pdbId)
502 String alreadyMapped = apanel.getStructureSelectionManager()
503 .alreadyMappedToFile(pdbId);
505 if (alreadyMapped == null)
510 addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
514 void setChainMenuItems(List<String> chainNames)
516 chainMenu.removeAll();
517 if (chainNames == null || chainNames.isEmpty())
523 * add the 'All' menu item
525 JMenuItem menuItem = new JMenuItem(
526 MessageManager.getString("label.all"));
527 menuItem.addActionListener(new ActionListener()
530 public void actionPerformed(ActionEvent evt)
532 allChainsSelected = true;
533 for (int i = 0; i < chainMenu.getItemCount(); i++)
535 if (chainMenu.getItem(i) instanceof JCheckBoxMenuItem)
537 ((JCheckBoxMenuItem) chainMenu.getItem(i)).setSelected(true);
540 showSelectedChains();
541 allChainsSelected = false;
544 chainMenu.add(menuItem);
547 * add a menu item for each structure and chain
549 Collections.sort(chainNames);
550 for (String chain : chainNames)
552 String seqName = getSequenceNameForChain(chain);
557 int nameLength = seqName.length();
560 seqName = seqName.substring(0, 8) + "..."
561 + seqName.substring(nameLength - 8, nameLength);
563 String text = chain + " " + 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);
783 viewMenu.add(fitToWindow);
785 final ItemListener handler = new ItemListener()
788 public void itemStateChanged(ItemEvent e)
790 alignStructs.setEnabled(!_alignwith.isEmpty());
791 alignStructs.setToolTipText(MessageManager.formatMessage(
792 "label.align_structures_using_linked_alignment_views",
796 viewSelectionMenu = new ViewSelectionMenu(
797 MessageManager.getString("label.superpose_with"), this,
798 _alignwith, handler);
799 handler.itemStateChanged(null);
800 viewerActionMenu.add(viewSelectionMenu, 0);
801 viewerActionMenu.addMenuListener(new MenuListener()
804 public void menuSelected(MenuEvent e)
806 handler.itemStateChanged(null);
810 public void menuDeselected(MenuEvent e)
815 public void menuCanceled(MenuEvent e)
824 * Sends commands to the structure viewer to superimpose structures based on
825 * currently associated alignments. May optionally return an error message for
829 protected String alignStructs_actionPerformed(ActionEvent actionEvent)
831 return alignStructs_withAllAlignPanels();
834 protected String alignStructs_withAllAlignPanels()
836 if (getAlignmentPanel() == null)
841 if (_alignwith.size() == 0)
843 _alignwith.add(getAlignmentPanel());
849 AlignmentI[] als = new Alignment[_alignwith.size()];
850 HiddenColumns[] alc = new HiddenColumns[_alignwith.size()];
851 int[] alm = new int[_alignwith.size()];
854 for (AlignmentViewPanel alignPanel : _alignwith)
856 AlignViewportI av = alignPanel.getAlignViewport();
857 als[a] = av.getAlignment();
859 alc[a++] = av.getAlignment().getHiddenColumns();
861 reply = getBinding().superposeStructures(als, alm, alc);
864 String text = MessageManager
865 .formatMessage("error.superposition_failed", reply);
866 statusBar.setText(text);
868 } catch (Exception e)
870 StringBuffer sp = new StringBuffer();
871 for (AlignmentViewPanel avp : _alignwith)
874 "'" + ((AlignmentPanel) avp).alignFrame.getTitle() + "' ");
876 Cache.log.info("Couldn't align structures with the " + sp.toString()
877 + "associated alignment panels.", e);
883 public void background_actionPerformed(ActionEvent actionEvent)
885 Color col = JColorChooser.showDialog(this,
886 MessageManager.getString("label.select_background_colour"),
890 getBinding().setBackgroundColour(col);
895 public void viewerColour_actionPerformed(ActionEvent actionEvent)
897 if (viewerColour.isSelected())
899 // disable automatic sequence colouring.
900 getBinding().setColourBySequence(false);
905 public void chainColour_actionPerformed(ActionEvent actionEvent)
907 chainColour.setSelected(true);
908 getBinding().colourByChain();
912 public void chargeColour_actionPerformed(ActionEvent actionEvent)
914 chargeColour.setSelected(true);
915 getBinding().colourByCharge();
919 public void seqColour_actionPerformed(ActionEvent actionEvent)
921 AAStructureBindingModel binding = getBinding();
922 binding.setColourBySequence(seqColour.isSelected());
923 if (_colourwith == null)
925 _colourwith = new Vector<>();
927 if (binding.isColourBySequence())
929 if (!binding.isLoadingFromArchive())
931 if (_colourwith.size() == 0 && getAlignmentPanel() != null)
933 // Make the currently displayed alignment panel the associated view
934 _colourwith.add(getAlignmentPanel().alignFrame.alignPanel);
937 // Set the colour using the current view for the associated alignframe
938 for (AlignmentViewPanel avp : _colourwith)
940 binding.updateStructureColours(avp);
942 seqColoursApplied = true;
947 public void pdbFile_actionPerformed(ActionEvent actionEvent)
949 JalviewFileChooser chooser = new JalviewFileChooser(
950 Cache.getProperty("LAST_DIRECTORY"));
952 chooser.setFileView(new JalviewFileView());
953 chooser.setDialogTitle(MessageManager.getString("label.save_pdb_file"));
954 chooser.setToolTipText(MessageManager.getString("action.save"));
956 int value = chooser.showSaveDialog(this);
958 if (value == JalviewFileChooser.APPROVE_OPTION)
960 BufferedReader in = null;
963 // TODO: cope with multiple PDB files in view
964 in = new BufferedReader(
965 new FileReader(getBinding().getStructureFiles()[0]));
966 File outFile = chooser.getSelectedFile();
968 PrintWriter out = new PrintWriter(new FileOutputStream(outFile));
970 while ((data = in.readLine()) != null)
972 if (!(data.indexOf("<PRE>") > -1 || data.indexOf("</PRE>") > -1))
978 } catch (Exception ex)
980 ex.printStackTrace();
988 } catch (IOException e)
998 public void viewMapping_actionPerformed(ActionEvent actionEvent)
1000 CutAndPasteTransfer cap = new CutAndPasteTransfer();
1003 cap.appendText(getBinding().printMappings());
1004 } catch (OutOfMemoryError e)
1007 "composing sequence-structure alignments for display in text box.",
1012 Desktop.addInternalFrame(cap,
1013 MessageManager.getString("label.pdb_sequence_mapping"), 550,
1017 protected abstract String getViewerName();
1020 * Configures the title and menu items of the viewer panel.
1023 public void updateTitleAndMenus()
1025 AAStructureBindingModel binding = getBinding();
1026 if (binding.hasFileLoadingError())
1031 setChainMenuItems(binding.getChainNames());
1033 this.setTitle(binding.getViewerTitle(getViewerName(), true));
1036 * enable 'Superpose with' if more than one mapped structure
1038 viewSelectionMenu.setEnabled(false);
1039 if (getBinding().getStructureFiles().length > 1
1040 && getBinding().getSequence().length > 1)
1042 viewSelectionMenu.setEnabled(true);
1046 * Show action menu if it has any enabled items
1048 viewerActionMenu.setVisible(false);
1049 for (int i = 0; i < viewerActionMenu.getItemCount(); i++)
1051 if (viewerActionMenu.getItem(i).isEnabled())
1053 viewerActionMenu.setVisible(true);
1058 if (!binding.isLoadingFromArchive())
1060 seqColour_actionPerformed(null);
1065 public String toString()
1071 public boolean hasMapping()
1073 if (worker != null && (addingStructures || _started))
1077 if (getBinding() == null)
1079 if (_aps == null || _aps.size() == 0)
1081 // viewer has been closed, but we did at some point run.
1086 String[] pdbids = getBinding().getStructureFiles();
1092 for (String pdbid:pdbids) {
1093 StructureMapping sm[] = getBinding().getSsm().getMapping(pdbid);
1094 if (sm!=null && sm.length>0 && sm[0]!=null) {
1098 // only return true if there is a mapping for every structure file we have loaded
1099 if (p == 0 || p != pdbids.length)
1103 // and that coloring has been applied
1104 return seqColoursApplied;
1108 public void raiseViewer()
1114 public abstract AAStructureBindingModel getBinding();
1117 * Show only the selected chain(s) in the viewer
1119 protected void showSelectedChains()
1124 * refresh display without resizing - easier to see what changed
1126 getBinding().showStructures(getAlignmentPanel().getAlignViewport(),