*/
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;
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
{
@Override
public void refreshGUI()
{
+ if (getMappedStructureCount() == 0)
+ {
+ // too soon!
+ return;
+ }
// appJmolWindow.repaint();
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
JalviewStructureDisplayI theViewer = getViewer();
+ // invokes colourbySequence() via seqColour_ActionPerformed()
theViewer.updateTitleAndMenus();
((JComponent) theViewer).revalidate();
}
}
@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 ?
@Override
public void selectionChanged(BS arg0)
{
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void refreshPdbEntries()
- {
- // TODO Auto-generated method stub
-
}
@Override
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
// TODO Auto-generated method stub
return null;
}
+
+ @SuppressWarnings("unused")
+ public void cacheFiles(List<File> files)
+ {
+ if (files == null)
+ {
+ return;
+ }
+ for (File f : files)
+ {
+ Platform.cacheFileData(f);
+ }
+ }
}