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.
21 package jalview.api.structures;
24 import java.util.Collections;
25 import java.util.List;
27 import jalview.api.AlignmentViewPanel;
28 import jalview.datamodel.PDBEntry;
29 import jalview.datamodel.SequenceI;
30 import jalview.gui.AlignmentPanel;
31 import jalview.gui.StructureViewer;
32 import jalview.structures.models.AAStructureBindingModel;
34 public interface JalviewStructureDisplayI
37 AAStructureBindingModel getBinding();
40 * @return true if there is an active GUI handling a structure display
45 * enable or disable the structure display - note this might just hide or show
46 * a GUI element, but not actually reset the display
50 void setVisible(boolean b);
53 * free up any external resources that were used by this display and collect
59 * Shutdown any Jalview structure viewing processes started by this display
61 * @param closeExternalViewer
62 * if true, force close any linked external viewer process
64 void closeViewer(boolean closeExternalViewer);
67 * Check if the external viewer is still running
69 boolean stillRunning();
73 * @return true if all background sequence/structure binding threads have
74 * completed for this viewer instance
79 * Checks if the PDB file is already loaded in this viewer, if so just adds
80 * mappings as necessary and answers true, else answers false. This supports
81 * the use case of adding additional chains of the same structure to a viewer.
89 boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
90 AlignmentViewPanel apanel, String pdbId);
93 * Adds one or more chains (sequences) of a PDB structure to this structure
103 void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
104 String[] chains, AlignmentViewPanel apanel, String pdbId);
107 * refresh GUI after reconfiguring structure(s) and alignment panels
109 void updateTitleAndMenus();
112 * Answers true if the viewer should attempt to align any added structures,
117 boolean isAlignAddedStructures();
120 * Sets the flag for whether added structures should be aligned
124 void setAlignAddedStructures(boolean alignAdded);
127 * Raise the panel to the top of the stack...
131 AlignmentViewPanel getAlignmentPanel();
134 * Answers true if the given alignment view is used to colour structures by
135 * sequence, false if not
140 boolean isUsedForColourBy(AlignmentViewPanel ap);
143 * If implemented, shows a command line console in the structure viewer
146 * true to show, false to hide
148 void showConsole(boolean show);
151 * Remove references to the given alignment view for this structure viewer
155 void removeAlignmentPanel(AlignmentViewPanel avp);
158 * Updates the progress bar if there is one. Call stopProgressBar with the
159 * returned handle to remove the message.
164 long startProgressBar(String msg);
167 * Ends the progress bar with the specified handle, leaving a message (if not
168 * null) on the status bar
173 void stopProgressBar(String msg, long handle);
177 * @return true if the actions menu is shown for this viewer
179 boolean hasViewerActionsMenu();
183 StructureViewer.ViewerType getViewerType();
185 boolean isUsedforaligment(AlignmentViewPanel ap);
187 boolean isColouredByViewer();
199 * @return heteroatoms in a form suitable for display and passing to command
200 * generator to display hetatms
202 default List<String> getHetatms()
204 return Collections.EMPTY_LIST;