X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmolBinding.java;h=98787cbb749edd01f9eb5e9859940ba57fa9146a;hb=c38d37887ae51d63942ac4321f6769308188ed6b;hp=aa6a15923c780d8ee0f2e05ba51a3c1a00293240;hpb=f2511dd2e8e37b8e999e924f8a53d150377b21b5;p=jalview.git diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index aa6a159..98787cb 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -20,6 +20,16 @@ */ package jalview.gui; +import java.awt.Container; +import java.io.File; +import java.util.List; +import java.util.Map; + +import javax.swing.JComponent; + +import org.jmol.api.JmolAppConsoleInterface; +import org.openscience.jmol.app.jmolpanel.console.AppConsole; + import jalview.api.AlignmentViewPanel; import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; @@ -28,15 +38,8 @@ import jalview.datamodel.SequenceI; import jalview.ext.jmol.JalviewJmolBinding; import jalview.io.DataSourceType; import jalview.structure.StructureSelectionManager; - -import java.awt.Container; -import java.util.Map; - -import javax.swing.JComponent; - -import org.jmol.api.JmolAppConsoleInterface; -import org.jmol.java.BS; -import org.openscience.jmol.app.jmolpanel.console.AppConsole; +import jalview.util.Platform; +import javajs.util.BS; public class AppJmolBinding extends JalviewJmolBinding { @@ -90,6 +93,11 @@ public class AppJmolBinding extends JalviewJmolBinding @Override public void refreshGUI() { + if (getMappedStructureCount() == 0) + { + // too soon! + return; + } // appJmolWindow.repaint(); javax.swing.SwingUtilities.invokeLater(new Runnable() { @@ -97,6 +105,7 @@ public class AppJmolBinding extends JalviewJmolBinding public void run() { JalviewStructureDisplayI theViewer = getViewer(); + // invokes colourbySequence() via seqColour_ActionPerformed() theViewer.updateTitleAndMenus(); ((JComponent) theViewer).revalidate(); } @@ -104,21 +113,6 @@ public class AppJmolBinding extends JalviewJmolBinding } @Override - public void updateColours(Object source) - { - AlignmentPanel ap = (AlignmentPanel) source; - // ignore events from panels not used to colour this view - if (!getViewer().isUsedForColourBy(ap)) - { - return; - } - if (!isLoadingFromArchive()) - { - colourBySequence(ap); - } - } - - @Override public void notifyScriptTermination(String strStatus, int msWalltime) { // todo - script termination doesn't happen ? @@ -142,15 +136,6 @@ public class AppJmolBinding extends JalviewJmolBinding @Override public void selectionChanged(BS arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void refreshPdbEntries() - { - // TODO Auto-generated method stub - } @Override @@ -164,7 +149,9 @@ public class AppJmolBinding extends JalviewJmolBinding Container consolePanel, String buttonsToShow) { jmolViewer.setJmolCallbackListener(this); - return new AppConsole(jmolViewer, consolePanel, buttonsToShow); + // BH comment: can't do this yet [for JS only, or generally?] + return Platform.isJS() ? null + : new AppConsole(jmolViewer, consolePanel, buttonsToShow); } @Override @@ -189,4 +176,17 @@ public class AppJmolBinding extends JalviewJmolBinding // TODO Auto-generated method stub return null; } + + @SuppressWarnings("unused") + public void cacheFiles(List files) + { + if (files == null) + { + return; + } + for (File f : files) + { + Platform.cacheFileData(f); + } + } }