X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJalview2XML.java;h=105209f4e46f0905f9955131643aefe58c770ae2;hb=e0273ccaa778d70fea45dcca68b31f0cb66310f0;hp=dcf65b73c0233660c8073f5c2ac2d10b61f49bb2;hpb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index dcf65b7..105209f 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; @@ -30,6 +32,7 @@ import javax.swing.*; import org.exolab.castor.xml.*; +import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; @@ -37,6 +40,7 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; import jalview.schemabinding.version2.*; import jalview.schemes.*; +import jalview.util.MessageManager; import jalview.util.Platform; import jalview.util.jarInputStreamProvider; import jalview.viewmodel.AlignmentViewport; @@ -434,7 +438,7 @@ public class Jalview2XML for (String dssids : dsses.keySet()) { AlignFrame _af = dsses.get(dssids); - String jfileName = fileName + " Dataset for " + _af.getTitle(); + String jfileName = MessageManager.formatMessage("label.dataset_for", new String[]{fileName,_af.getTitle()}); if (!jfileName.endsWith(".xml")) { jfileName = jfileName + ".xml"; @@ -1499,8 +1503,7 @@ public class Jalview2XML return false; } } - throw new Error("Unsupported Version for calcIdparam " - + calcIdParam.toString()); + throw new Error(MessageManager.formatMessage("error.unsupported_version_calcIdparam", new String[]{calcIdParam.toString()})); } /** @@ -1793,7 +1796,7 @@ public class Jalview2XML try { // create list to store references for any new Jmol viewers created - newStructureViewers = new Vector(); + newStructureViewers = new Vector(); // UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING // Workaround is to make sure caller implements the JarInputStreamProvider // interface @@ -3130,10 +3133,11 @@ public class Jalview2XML @Override public void run() { - AppJmol sview = null; + JalviewStructureDisplayI sview = null; try { - sview = new AppJmol(pdbf, id, sq, alf.alignPanel, + // JAL-1333 note - we probably can't migrate Jmol views to UCSF Chimera! + sview = new StructureViewer(alf.alignPanel.getStructureSelectionManager()).createView(StructureViewer.Viewer.JMOL, pdbf, id, sq, alf.alignPanel, useinJmolsuperpos, usetoColourbyseq, jmolColouring, fileloc, rect, vid); addNewStructureViewer(sview); @@ -3209,15 +3213,18 @@ public class Jalview2XML /** * - * @param supported - minimum version we are comparing against - * @param version - version of data being processsed. + * @param supported + * - minimum version we are comparing against + * @param version + * - version of data being processsed. * @return true if version is development/null or evaluates to the same or * later X.Y.Z (where X,Y,Z are like [0-9]+b?[0-9]*) */ private boolean isVersionStringLaterThan(String supported, String version) { if (version == null || version.equalsIgnoreCase("DEVELOPMENT BUILD") - || version.equalsIgnoreCase("Test") || version.equalsIgnoreCase("AUTOMATED BUILD")) + || version.equalsIgnoreCase("Test") + || version.equalsIgnoreCase("AUTOMATED BUILD")) { System.err.println("Assuming project file with " + (version == null ? "null" : version) @@ -3260,13 +3267,13 @@ public class Jalview2XML return true; } - Vector newStructureViewers = null; + Vector newStructureViewers = null; - protected void addNewStructureViewer(AppJmol sview) + protected void addNewStructureViewer(JalviewStructureDisplayI sview) { if (newStructureViewers != null) { - sview.jmb.setFinishedLoadingFromArchive(false); + sview.getBinding().setFinishedLoadingFromArchive(false); newStructureViewers.add(sview); } } @@ -3275,9 +3282,9 @@ public class Jalview2XML { if (newStructureViewers != null) { - for (AppJmol sview : newStructureViewers) + for (JalviewStructureDisplayI sview : newStructureViewers) { - sview.jmb.setFinishedLoadingFromArchive(true); + sview.getBinding().setFinishedLoadingFromArchive(true); } newStructureViewers.clear(); newStructureViewers = null;