X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationColourChooser.java;h=487b75ccc3cd25709d5913f1a943726d89f8df47;hb=571d15a897c11bdc2dda76ce03686604596f220d;hp=5a9cd553e451e467487c59964bf728be97f778df;hpb=ba74c240931531706fd2f95bde111033e513e71e;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationColourChooser.java b/src/jalview/appletgui/AnnotationColourChooser.java index 5a9cd55..487b75c 100644 --- a/src/jalview/appletgui/AnnotationColourChooser.java +++ b/src/jalview/appletgui/AnnotationColourChooser.java @@ -20,6 +20,7 @@ */ package jalview.appletgui; +import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.SequenceGroup; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.ColourSchemeI; @@ -80,9 +81,9 @@ public class AnnotationColourChooser extends Panel implements oldgroupColours = new Hashtable(); for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - if (sg.cs != null) + if (sg.getColourScheme() != null) { - oldgroupColours.put(sg, sg.cs); + oldgroupColours.put(sg, sg.getColourScheme()); } else { @@ -96,7 +97,8 @@ public class AnnotationColourChooser extends Panel implements slider.addAdjustmentListener(this); slider.addMouseListener(this); - if (av.getAlignment().getAlignmentAnnotation() == null) + AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation(); + if (anns == null) { return; } @@ -117,11 +119,15 @@ public class AnnotationColourChooser extends Panel implements // seqAssociated.setState(acg.isSeqAssociated()); } - Vector list = new Vector(); + Vector list = new Vector(); int index = 1; - for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + for (int i = 0; i < anns.length; i++) { - String label = av.getAlignment().getAlignmentAnnotation()[i].label; + String label = anns[i].label; + if (anns[i].sequenceRef != null) + { + label = label + "_" + anns[i].sequenceRef.getName(); + } if (!list.contains(label)) { list.addElement(label); @@ -309,6 +315,7 @@ public class AnnotationColourChooser extends Panel implements Checkbox thresholdIsMin = new Checkbox(); + @Override public void actionPerformed(ActionEvent evt) { if (evt.getSource() == thresholdValue) @@ -351,6 +358,7 @@ public class AnnotationColourChooser extends Panel implements } } + @Override public void itemStateChanged(ItemEvent evt) { if (evt.getSource() == currentColours) @@ -368,6 +376,7 @@ public class AnnotationColourChooser extends Panel implements changeColour(); } + @Override public void adjustmentValueChanged(AdjustmentEvent evt) { if (!adjusting) @@ -478,8 +487,6 @@ public class AnnotationColourChooser extends Panel implements AnnotationColourGradient acg = null; if (currentColours.getState()) { - acg = new AnnotationColourGradient(currentAnnotation, - av.getGlobalColourScheme(), aboveThreshold); } else { @@ -504,21 +511,21 @@ public class AnnotationColourChooser extends Panel implements for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - if (sg.cs == null) + if (sg.getColourScheme() == null) { continue; } if (currentColours.getState()) { - sg.cs = new AnnotationColourGradient(currentAnnotation, sg.cs, - aboveThreshold); + sg.setColourScheme(new AnnotationColourGradient( + currentAnnotation, sg.getColourScheme(), aboveThreshold)); } else { - sg.cs = new AnnotationColourGradient(currentAnnotation, - minColour.getBackground(), maxColour.getBackground(), - aboveThreshold); + sg.setColourScheme(new AnnotationColourGradient( + currentAnnotation, minColour.getBackground(), maxColour + .getBackground(), aboveThreshold)); } } @@ -539,12 +546,12 @@ public class AnnotationColourChooser extends Panel implements Object cs = oldgroupColours.get(sg); if (cs instanceof ColourSchemeI) { - sg.cs = (ColourSchemeI) cs; + sg.setColourScheme((ColourSchemeI) cs); } else { // probably the "null" string we set it to if it was null originally. - sg.cs = null; + sg.setColourScheme(null); } } } @@ -552,23 +559,28 @@ public class AnnotationColourChooser extends Panel implements } + @Override public void mouseClicked(MouseEvent evt) { } + @Override public void mousePressed(MouseEvent evt) { } + @Override public void mouseReleased(MouseEvent evt) { ap.paintAlignment(true); } + @Override public void mouseEntered(MouseEvent evt) { } + @Override public void mouseExited(MouseEvent evt) { }