From 330cd6b44c7c4c84c81dca69e8c8050118fb1bdd Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 24 Jul 2009 15:25:40 +0000 Subject: [PATCH] get consensus sequence and set ignore gaps flag for group consensus row --- src/jalview/gui/AnnotationLabels.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index bed71d3..0e766c4 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -214,7 +214,13 @@ public class AnnotationLabels extends JPanel implements MouseListener, } else if (evt.getActionCommand().equals(COPYCONS_SEQ)) { - SequenceI cons = av.getConsensusSeq(); + SequenceI cons = null; + if (aa[selectedRow].groupRef!=null) + { + cons = aa[selectedRow].groupRef.getConsensusSeq(); + } else { + cons = av.getConsensusSeq(); + } if (cons != null) { copy_annotseqtoclipboard(cons); @@ -449,16 +455,22 @@ public class AnnotationLabels extends JPanel implements MouseListener, item = new JMenuItem(OUTPUT_TEXT); item.addActionListener(this); pop.add(item); - // annotation object should be typed - if (selectedRow < aa.length && aa[selectedRow] == ap.av.consensus) + // TODO: annotation object should be typed for autocalculated/derived property methods + if (selectedRow < aa.length && aa[selectedRow].autoCalculated && aa[selectedRow].label.indexOf("Consensus")>-1) { pop.addSeparator(); + // av and sequencegroup need to implement same interface for final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( "Ignore Gaps In Consensus", ap.av.getIgnoreGapsConsensus()); + final AlignmentAnnotation aaa = aa[selectedRow]; cbmi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + if (aaa.groupRef!=null) + { + aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState()); + } ap.av.setIgnoreGapsConsensus(cbmi.getState(), ap); } }); -- 1.7.10.2