From dd645839efa022cd15c6247398692412b7c2ceaa Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 14 Apr 2010 14:39:18 +0000 Subject: [PATCH] todo and disable selection sharing between views on same alignment --- src/jalview/gui/SeqPanel.java | 8 +++---- src/jalview/schemes/ResidueProperties.java | 35 +++++++++++++++++++++------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index a961928..f260ec2 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1863,16 +1863,15 @@ public class SeqPanel extends JPanel implements MouseListener, { // TODO: fix this hack - source of messages is align viewport, but SeqPanel // handles selection messages... - if (av == source) + // TODO: extend config options to allow user to control if selections may be shared between viewports. + if (av == source || !av.followSelection || (source instanceof AlignViewport && ((AlignViewport)source).getSequenceSetId().equals(av.getSequenceSetId()))) { return; } // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) boolean repaint = false; - if (av.followSelection) - { - if (av.selectionGroup == null || !av.isSelectionGroupChanged()) + if (av.selectionGroup == null || !av.isSelectionGroupChanged()) { SequenceGroup sgroup = null; if (seqsel != null) @@ -1917,7 +1916,6 @@ public class SeqPanel extends JPanel implements MouseListener, } repaint |= av.isColSelChanged(); } - } if (av.hasHiddenColumns && (av.colSel==null || av.colSel.getHiddenColumns()==null)) { System.err.println("Bad things"); diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index a53b95f..48a9272 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -101,7 +101,7 @@ public class ResidueProperties nucleotideIndex = new int[255]; for (int i = 0; i < 255; i++) { - nucleotideIndex[i] = -1; + nucleotideIndex[i] = 10; // non-nucleotide symbols are all non-gap gaps. } nucleotideIndex['A'] = 0; @@ -280,7 +280,13 @@ public class ResidueProperties new Color(255, 179, 64), // C new Color(235, 65, 60), // G new Color(60, 136, 238), // T - new Color(60, 136, 238) // U + new Color(60, 136, 238), // U + Color.white, // I + Color.white, // X + Color.white, // R + Color.white, // Y + Color.white, // N + Color.white, // Gap }; // Zappo @@ -504,14 +510,27 @@ public class ResidueProperties ssHash.put("I", Color.pink); ssHash.put("B", Color.yellow); } - +/* new Color(60, 136, 238), // U + Color.white, // I + Color.white, // X + Color.white, // R + Color.white, // Y + Color.white, // N + Color.white, // Gap +*/ static final int[][] DNA = { - { 5, -4, -4, -4, 1 }, // C - { -4, 5, -4, -4, 1 }, // T - { -4, -4, 5, -4, 1 }, // A - { -4, -4, -4, 5, 1 }, // G - { 1, 1, 1, 1, 1 }, // - + { 10, -8, -8, -8, 1, 0 ,0 ,0 ,0 ,0 ,1 }, // C + { -8, 10, -8, -8, 1, 0 ,0 ,0 ,0 ,0 ,1 }, // T + { -8, -8, 10, -8, 1, 0 ,0 ,0 ,0 ,0 ,1 }, // A + { -8, -8, -8, 10, 1, 0 ,0 ,0 ,0 ,0 ,1 }, // G + { 1, 1, 1, 1, 10,0 ,0 ,0 ,0 ,0 ,1 }, // - + { 1, 1, 1, 1, 1 ,10 ,0 ,0 ,0 ,0 ,1 }, // - + { 1, 1, 1, 1, 1 ,0 ,10 ,0 ,0 ,0 ,1 }, // - + { 1, 1, 1, 1, 1 ,0 ,0 ,10 ,0 ,0 ,1 }, // - + { 1, 1, 1, 1, 1 ,0 ,0 ,0 ,10 ,0 ,1 }, // - + { 1, 1, 1, 1, 1 ,0 ,0 ,0 ,0 ,10 ,1 }, // - + { 1, 1, 1, 1, 1 ,1 ,1 ,1 ,1 ,1 ,1 }, // - }; /** * register matrices in list -- 1.7.10.2