X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAPopupMenu.java;h=68960f4393c73374684e671a65791ba2827dd332;hb=8a5c39442bced20fc95272efe6d3176719ca3f15;hp=858770a35ec187ca5849712d7b189fa046e988c6;hpb=29f89f52f3fc99e904a55e426c53a830290408cc;p=jalview.git diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 858770a..68960f4 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -379,29 +379,24 @@ public class APopupMenu protected void abovePIDColour_itemStateChanged(ItemEvent ie) { SequenceGroup sg = getGroup(); + if(sg.cs==null) + return; + if (abovePIDColour.getState()) { sg.cs.setConsensus(AAFrequency.calculate(sg.sequences, 0, ap.av.alignment.getWidth())); int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup().getName()); - if (sg.cs instanceof ResidueColourScheme) - { - ( (ResidueColourScheme) sg.cs).setThreshold(threshold); - } - else if (sg.cs instanceof ScoreColourScheme) - { - ( (ScoreColourScheme) sg.cs).setThreshold(threshold); - } + + sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus()); SliderPanel.showPIDSlider(); } else // remove PIDColouring { - ResidueColourScheme rcs = (ResidueColourScheme) sg.cs; - rcs.setThreshold(0); - sg.cs = rcs; + sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus()); } refresh(); @@ -443,6 +438,8 @@ public class APopupMenu protected void conservationMenuItem_itemStateChanged(ItemEvent ie) { SequenceGroup sg = getGroup(); + if(sg.cs==null) + return; if (conservationMenuItem.getState()) { @@ -454,17 +451,15 @@ public class APopupMenu c.calculate(); c.verdict(false, ap.av.ConsPercGaps); - ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs); - sg.cs = ccs; + sg.cs.setConservation(c); - SliderPanel.setConservationSlider(ap, ccs, sg.getName()); + SliderPanel.setConservationSlider(ap, sg.cs, sg.getName()); SliderPanel.showConservationSlider(); } else // remove ConservationColouring { - ConservationColourScheme ccs = (ConservationColourScheme) sg.cs; - sg.cs = ccs.cs; + sg.cs.setConservation(null); } refresh(); @@ -472,7 +467,7 @@ public class APopupMenu protected void analyze_actionPerformed(ActionEvent e) { - CutAndPasteTransfer cap = new CutAndPasteTransfer(false); + CutAndPasteTransfer cap = new CutAndPasteTransfer(false, ap.alignFrame.applet); Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, "Analyze this - ", 400, 300);