X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FStructureViewerBase.java;fp=src%2Fjalview%2Fgui%2FStructureViewerBase.java;h=20f5c1f390b5dfdcce585afcfbd318ce03bc8ef0;hb=e06ef51ba3dd8cdae7632d71db162ff416b88256;hp=3b80ff0962c1b527aad56056275863aa1e7ee0e3;hpb=0e07457ca16b632091d64ec76934b6bf772b180c;p=jalview.git diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 3b80ff0..20f5c1f 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -130,6 +130,26 @@ public abstract class StructureViewerBase extends GStructureViewer } /** + * @return true if added structures should be aligned to existing one(s) + */ + @Override + public boolean isAlignAddedStructures() + { + return alignAddedStructures; + } + + /** + * + * @param true + * if added structures should be aligned to existing one(s) + */ + @Override + public void setAlignAddedStructures(boolean alignAdded) + { + alignAddedStructures = alignAdded; + } + + /** * * @param ap2 * @return true if this Jmol instance is linked with the given alignPanel @@ -335,7 +355,7 @@ public abstract class StructureViewerBase extends GStructureViewer */ protected void addStructure(final PDBEntry pdbentry, final SequenceI[] seqs, final String[] chains, - final boolean align, final IProgressIndicator alignFrame) + final IProgressIndicator alignFrame) { if (pdbentry.getFile() == null) { @@ -359,7 +379,7 @@ public abstract class StructureViewerBase extends GStructureViewer } } // and call ourselves again. - addStructure(pdbentry, seqs, chains, align, alignFrame); + addStructure(pdbentry, seqs, chains, alignFrame); } }).start(); return; @@ -371,33 +391,11 @@ public abstract class StructureViewerBase extends GStructureViewer { seqs }, new String[][] { chains }); addingStructures = true; _started = false; - alignAddedStructures = align; worker = new Thread(this); worker.start(); return; } - /** - * Presents a dialog with the option to add an align a structure to an - * existing structure view - * - * @param pdbId - * @param view - * @return YES, NO or CANCEL JvOptionPane code - */ - protected int chooseAlignStructureToViewer(String pdbId, - StructureViewerBase view) - { - int option = JvOptionPane.showInternalConfirmDialog(Desktop.desktop, - MessageManager.formatMessage("label.add_pdbentry_to_view", - new Object[] - { pdbId, view.getTitle() }), - MessageManager - .getString("label.align_to_existing_structure_view"), - JvOptionPane.YES_NO_CANCEL_OPTION); - return option; - } - protected boolean hasPdbId(String pdbId) { return getBinding().hasPdbId(pdbId); @@ -439,7 +437,7 @@ public abstract class StructureViewerBase extends GStructureViewer AlignmentPanel ap = (AlignmentPanel) apanel; // Implementation error if this // cast fails useAlignmentPanelForSuperposition(ap); - addStructure(pdbentry, seq, chains, true, ap.alignFrame); + addStructure(pdbentry, seq, chains, ap.alignFrame); return true; }