From: gmungoc Date: Thu, 10 Nov 2016 11:03:14 +0000 (+0000) Subject: JAL-2320 added getViewer() method to return Chimera or Jmol panel X-Git-Tag: Release_2_10_1^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd8f0eb5083ecbb73bde4b87c45e0d4286998ab9;p=jalview.git JAL-2320 added getViewer() method to return Chimera or Jmol panel --- diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 1c54a5e..ffa34f83 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -21,6 +21,7 @@ package jalview.gui; import jalview.api.AlignmentViewPanel; +import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; @@ -113,6 +114,7 @@ public class AppJmolBinding extends JalviewJmolBinding // appJmolWindow.repaint(); javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { appJmolWindow.updateTitleAndMenus(); @@ -121,6 +123,7 @@ public class AppJmolBinding extends JalviewJmolBinding }); } + @Override public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; @@ -144,6 +147,7 @@ public class AppJmolBinding extends JalviewJmolBinding // msWalltime); } + @Override public void showUrl(String url) { showUrl(url, "jmol"); @@ -205,4 +209,10 @@ public class AppJmolBinding extends JalviewJmolBinding // TODO Auto-generated method stub return null; } + + @Override + public JalviewStructureDisplayI getViewer() + { + return appJmolWindow; + } } diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index 7a54732..4bb7180 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -21,6 +21,7 @@ package jalview.gui; import jalview.api.AlignmentViewPanel; +import jalview.api.structures.JalviewStructureDisplayI; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.ext.rbvi.chimera.JalviewChimeraBinding; @@ -72,6 +73,7 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { cvf.updateTitleAndMenus(); @@ -80,6 +82,7 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding }); } + @Override public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; @@ -113,6 +116,7 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding * Send an asynchronous command to Chimera, in a new thread, optionally with * an 'in progress' message in a progress bar somewhere */ + @Override protected void sendAsynchronousCommand(final String command, final String progressMsg) { @@ -135,4 +139,11 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding thread.start(); } + + @Override + public JalviewStructureDisplayI getViewer() + { + return cvf; + } + } diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index b00f1bc..b618bc0 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -21,6 +21,7 @@ package jalview.structures.models; import jalview.api.StructureSelectionManagerProvider; +import jalview.api.structures.JalviewStructureDisplayI; import jalview.datamodel.AlignmentI; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; @@ -674,4 +675,14 @@ public abstract class AAStructureBindingModel extends { this.finishedInit = fi; } + + /** + * Returns the Jalview panel hosting the structure viewer (if any) + * + * @return + */ + public JalviewStructureDisplayI getViewer() + { + return null; + } }