X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAPopupMenu.java;h=0d1dad38390a064bbf4c9d40e8a43f22d1b2b1d4;hb=a28c9340eeadfdaa551a21b9dea1d0f1530126e3;hp=858770a35ec187ca5849712d7b189fa046e988c6;hpb=29f89f52f3fc99e904a55e426c53a830290408cc;p=jalview.git diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 858770a..0d1dad3 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -46,7 +46,7 @@ public class APopupMenu MenuItem noColourmenuItem = new MenuItem(); protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem(); - AlignmentPanel ap; + final AlignmentPanel ap; MenuItem unGroupMenuItem = new MenuItem(); MenuItem nucleotideMenuItem = new MenuItem(); Menu colourMenu = new Menu(); @@ -54,7 +54,7 @@ public class APopupMenu CheckboxMenuItem showText = new CheckboxMenuItem(); CheckboxMenuItem showColourText = new CheckboxMenuItem(); - public APopupMenu(AlignmentPanel ap, Sequence seq, Vector links) + public APopupMenu(AlignmentPanel apanel, Sequence seq, Vector links) { /////////////////////////////////////////////////////////// // If this is activated from the sequence panel, the user may want to @@ -63,7 +63,7 @@ public class APopupMenu // If from the IDPanel, we must display the sequence menu ////////////////////////////////////////////////////////// - this.ap = ap; + this.ap = apanel; try { @@ -105,7 +105,7 @@ public class APopupMenu { public void actionPerformed(ActionEvent e) { - jalview.bin.JalviewLite.showURL(url, target); + ap.alignFrame.showURL(url, target); } }); linkMenu.add(item); @@ -319,6 +319,8 @@ public class APopupMenu } } ap.seqPanel.seqCanvas.repaint(); + if(ap.overviewPanel!=null) + ap.overviewPanel.updateOverviewImage(); } protected void clustalColour_actionPerformed(ActionEvent e) @@ -379,29 +381,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 +440,8 @@ public class APopupMenu protected void conservationMenuItem_itemStateChanged(ItemEvent ie) { SequenceGroup sg = getGroup(); + if(sg.cs==null) + return; if (conservationMenuItem.getState()) { @@ -454,17 +453,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 +469,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);