X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmol.java;h=0c3674568067c2a4ce965e02a60de393672a58df;hb=747167089ecf8d6afc70d417f5a20352e029bd95;hp=217d2b1c5f89b5b641e38e5c31120d100b1587f1;hpb=9d2408483e451285fd555c3cd6e0273977acbaa7;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 217d2b1..0c36745 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -38,7 +38,7 @@ import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; import jalview.api.AlignmentViewPanel; -import jalview.bin.Cache; +import jalview.bin.Console; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.datamodel.StructureViewerModel; @@ -52,7 +52,6 @@ import jalview.util.BrowserLauncher; import jalview.util.ImageMaker; import jalview.util.MessageManager; import jalview.util.Platform; - public class AppJmol extends StructureViewerBase { // ms to wait for Jmol to load files @@ -106,7 +105,6 @@ public class AppJmol extends StructureViewerBase .toArray(new SequenceI[sequencesForPdb.size()]); i++; } - // TODO: check if protocol is needed to be set, and if chains are // autodiscovered. jmb = new AppJmolBinding(this, ap.getStructureSelectionManager(), @@ -134,7 +132,6 @@ public class AppJmol extends StructureViewerBase seqColour.setSelected(true); viewerColour.setSelected(false); } - this.setBounds(viewerModel.getX(), viewerModel.getY(), viewerModel.getWidth(), viewerModel.getHeight()); setViewId(viewid); @@ -159,6 +156,7 @@ public class AppJmol extends StructureViewerBase { super.initMenus(); + viewerColour .setText(MessageManager.getString("label.colour_with_jmol")); viewerColour.setToolTipText(MessageManager @@ -184,8 +182,7 @@ public class AppJmol extends StructureViewerBase } private void openNewJmol(AlignmentPanel ap, boolean alignAdded, - PDBEntry[] pdbentrys, - SequenceI[][] seqs) + PDBEntry[] pdbentrys, SequenceI[][] seqs) { setProgressIndicator(ap.alignFrame); jmb = new AppJmolBinding(this, ap.getStructureSelectionManager(), @@ -234,7 +231,6 @@ public class AppJmol extends StructureViewerBase openNewJmol(ap, alignAdded, pe, seqs); } - void initJmol(String command) { jmb.setFinishedInit(false); @@ -309,10 +305,10 @@ public class AppJmol extends StructureViewerBase } catch (OutOfMemoryError oomerror) { new OOMWarning("When trying to open the Jmol viewer!", oomerror); - Cache.log.debug("File locations are " + filesString); + Console.debug("File locations are " + filesString); } catch (Exception ex) { - Cache.log.error("Couldn't open Jmol viewer!", ex); + Console.error("Couldn't open Jmol viewer!", ex); ex.printStackTrace(); return; } @@ -333,11 +329,11 @@ public class AppJmol extends StructureViewerBase { new OOMWarning("When trying to add structures to the Jmol viewer!", oomerror); - Cache.log.debug("File locations are " + filesString); + Console.debug("File locations are " + filesString); return; } catch (Exception ex) { - Cache.log.error("Couldn't add files to Jmol viewer!", ex); + Console.error("Couldn't add files to Jmol viewer!", ex); ex.printStackTrace(); return; } @@ -353,7 +349,7 @@ public class AppJmol extends StructureViewerBase { try { - Cache.log.debug("Waiting around for jmb notify."); + Console.debug("Waiting around for jmb notify."); waitTotal += waitFor; // Thread.sleep() throws an exception in JS @@ -436,7 +432,8 @@ public class AppJmol extends StructureViewerBase jmb.jmolViewer.renderScreenImage(g, width, height); } }; - String view = MessageManager.getString("action.view").toLowerCase(Locale.ROOT); + String view = MessageManager.getString("action.view") + .toLowerCase(Locale.ROOT); ImageExporter exporter = new ImageExporter(writer, getProgressIndicator(), type, getTitle()); exporter.doExport(null, this, width, height, view); @@ -448,7 +445,7 @@ public class AppJmol extends StructureViewerBase try { BrowserLauncher // BH 2018 - .openURL("http://wiki.jmol.org");//http://jmol.sourceforge.net/docs/JmolUserGuide/"); + .openURL("http://wiki.jmol.org");// http://jmol.sourceforge.net/docs/JmolUserGuide/"); } catch (Exception ex) { System.err.println("Show Jmol help failed with: " + ex.getMessage()); @@ -458,6 +455,7 @@ public class AppJmol extends StructureViewerBase @Override public void showConsole(boolean showConsole) { + if (showConsole) { if (splitPane == null) @@ -523,7 +521,8 @@ public class AppJmol extends StructureViewerBase } } } - else if (jmb == null || jmb.jmolViewer == null || !jmb.isFinishedInit()) + else if (jmb == null || jmb.jmolViewer == null + || !jmb.isFinishedInit()) { g.setColor(Color.black); g.fillRect(0, 0, currentSize.width, currentSize.height);