From: jprocter Date: Mon, 25 Apr 2011 16:22:19 +0000 (+0000) Subject: JAL-824 - additional methods to allow jmol colouring state indicator to be passed... X-Git-Tag: Release_2_7~198 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b6f60233c9312c6025094a81a22c652bf1d1e884;p=jalview.git JAL-824 - additional methods to allow jmol colouring state indicator to be passed in and modified on an instantiated view --- diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index f71cd30..62f4d13 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -79,7 +79,7 @@ public class AppJmol extends GStructureViewer implements Runnable, this(new String[] { file }, new String[] { id }, new SequenceI[][] - { seq }, ap, true, true, loadStatus, bounds, viewid); + { seq }, ap, true, true, false, loadStatus, bounds, viewid); } ViewSelectionMenu seqColourBy; @@ -96,12 +96,14 @@ public class AppJmol extends GStructureViewer implements Runnable, * @param useToAlign * - add the alignment panel to the list used for aligning these * structures + * @param leaveColouringToJmol + * - do not update the colours from any other source. Jmol is handling them * @param loadStatus * @param bounds * @param viewid */ public AppJmol(String[] files, String[] ids, SequenceI[][] seqs, - AlignmentPanel ap, boolean usetoColour, boolean useToAlign, + AlignmentPanel ap, boolean usetoColour, boolean useToAlign, boolean leaveColouringToJmol, String loadStatus, Rectangle bounds, String viewid) { PDBEntry[] pdbentrys = new PDBEntry[files.length]; @@ -122,15 +124,18 @@ public class AppJmol extends GStructureViewer implements Runnable, { useAlignmentPanelForSuperposition(ap); } + if (leaveColouringToJmol || !usetoColour) + { + jmb.setColourBySequence(false); + seqColour.setSelected(false); + jmolColour.setSelected(true); + } if (usetoColour) { useAlignmentPanelForColourbyseq(ap); jmb.setColourBySequence(true); seqColour.setSelected(true); - } else { - jmb.setColourBySequence(false); - seqColour.setSelected(false); - jmolColour.setSelected(true); + jmolColour.setSelected(false); } this.setBounds(bounds); initMenus(); @@ -435,6 +440,13 @@ public class AppJmol extends GStructureViewer implements Runnable, } } + public void useAlignmentPanelForColourbyseq(AlignmentPanel nap, boolean enableColourBySeq) + { + useAlignmentPanelForColourbyseq(nap); + jmb.setColourBySequence(enableColourBySeq); + seqColour.setSelected(enableColourBySeq); + jmolColour.setSelected(!enableColourBySeq); + } public void useAlignmentPanelForColourbyseq(AlignmentPanel nap) { addAlignmentPanel(nap); @@ -1267,4 +1279,14 @@ public class AppJmol extends GStructureViewer implements Runnable, return (_colourwith != null) && _colourwith.contains(ap2); } + /** + * + * @return TRUE if the view is NOT being coloured by sequence associations. + */ + public boolean isColouredByJmol() + { + return !jmb.isColourBySequence(); + } + + }