X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmolBinding.java;h=158bb545d6f2decfbf64a839b79a1ca7878ef044;hb=e57f77dc13f5a295cf49a403da05770a68a6e22b;hp=2699db187e9f7b1ff113c4e8483627d348775c5e;hpb=a1984b1c8c273ed33c7ce9283039f4027dcae2de;p=jalview.git diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 2699db1..158bb54 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -33,8 +33,8 @@ import org.openscience.jmol.app.jmolpanel.console.AppConsole; import jalview.api.AlignmentViewPanel; import jalview.api.structures.JalviewStructureDisplayI; -import jalview.bin.Cache; -import jalview.datamodel.AlignmentI; +import jalview.bin.Console; +import jalview.bin.Jalview; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.ext.jmol.JalviewJmolBinding; @@ -42,9 +42,6 @@ import jalview.io.DataSourceType; import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.util.Platform; -import jalview.ws.dbsources.EBIAlfaFold; -import jalview.ws.dbsources.Pdb; -import jalview.ws.utils.UrlDownloadClient; import javajs.util.BS; public class AppJmolBinding extends JalviewJmolBinding @@ -91,7 +88,7 @@ public class AppJmolBinding extends JalviewJmolBinding jalview.util.BrowserLauncher.openURL(url); } catch (Exception e) { - Cache.error("Failed to launch Jmol-associated url " + url, e); + Console.error("Failed to launch Jmol-associated url " + url, e); // TODO: 2.6 : warn user if browser was not configured. } } @@ -156,7 +153,7 @@ public class AppJmolBinding extends JalviewJmolBinding { jmolViewer.setJmolCallbackListener(this); // BH comment: can't do this yet [for JS only, or generally?] - return Platform.isJS() ? null + return Platform.isJS() || Jalview.isHeadlessMode() ? null : new AppConsole(jmolViewer, consolePanel, buttonsToShow); } @@ -214,7 +211,7 @@ public class AppJmolBinding extends JalviewJmolBinding { // todo - record which pdbids were successfully imported. StringBuilder errormsgs = new StringBuilder(); - + List files = new ArrayList<>(); String pdbid = ""; try @@ -222,7 +219,7 @@ public class AppJmolBinding extends JalviewJmolBinding String[] filesInViewer = getStructureFiles(); // TODO: replace with reference fetching/transfer code (validate PDBentry // as a DBRef?) - + for (int pi = 0; pi < getPdbCount(); pi++) { PDBEntry strucEntry = getPdbEntry(pi); @@ -231,7 +228,8 @@ public class AppJmolBinding extends JalviewJmolBinding if (file == null) { pdbid = strucEntry.getId(); - try{ + try + { file = structureViewer.fetchPdbFile(strucEntry); } catch (OutOfMemoryError oomerror) { @@ -241,7 +239,7 @@ public class AppJmolBinding extends JalviewJmolBinding ex.printStackTrace(); errormsgs.append("'").append(pdbid).append("'"); } - if (file!=null) + if (file != null) { // success files.add(file);