Merge branch 'develop' into features/JAL-2360colourSchemeApplicability
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 20 Jan 2017 11:56:07 +0000 (11:56 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 20 Jan 2017 11:56:07 +0000 (11:56 +0000)
Conflicts:
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/PopupMenu.java

src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/SliderPanel.java

index 1f3d318..863d625 100644 (file)
@@ -1092,6 +1092,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
             .getString("label.modify_conservation_threshold"));
     modifyConservation.addActionListener(this);
 
+    PIDColour.addActionListener(this);
+    BLOSUM62Colour.addActionListener(this);
+
     editMenu.add(copy);
     copy.addActionListener(this);
     editMenu.add(cut);
index 5179eb0..53a2824 100644 (file)
@@ -186,8 +186,8 @@ public class SliderPanel extends Panel implements ActionListener,
     if (PIDSlider != null)
     {
       PIDSlider.setVisible(false);
+      PIDSlider = null;
     }
-    PIDSlider = null;
   }
 
   /**
@@ -198,8 +198,8 @@ public class SliderPanel extends Panel implements ActionListener,
     if (conservationSlider != null)
     {
       conservationSlider.setVisible(false);
+      conservationSlider = null;
     }
-    conservationSlider = null;
   }
   public SliderPanel(AlignmentPanel ap, int value, boolean forConserve,
           ColourSchemeI cs)
index 7057c2a..b6587fb 100644 (file)
@@ -3350,6 +3350,7 @@ public class Jalview2XML
           if (cs != null)
           {
             cs.setThreshold(jGroup.getPidThreshold(), true);
+            cs.setConservationInc(jGroup.getConsThreshold());
           }
         }
 
index 83193dc..7d733c9 100755 (executable)
@@ -34,6 +34,8 @@ import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
 
 /**
  * DOCUMENT ME!
@@ -139,6 +141,7 @@ public class SliderPanel extends GSliderPanel
     else
     {
       sp = (SliderPanel) conservationSlider.getContentPane();
+      sp.slider.setValue(cs.getConservationInc());
       sp.cs = cs;
     }
 
@@ -198,24 +201,17 @@ public class SliderPanel extends GSliderPanel
    */
   public static void showConservationSlider()
   {
-    try
-    {
-      PIDSlider.setClosed(true);
-      PIDSlider = null;
-    } catch (Exception ex)
-    {
-    }
+    hidePIDSlider();
 
     if (!conservationSlider.isVisible())
     {
       Desktop.addInternalFrame(conservationSlider,
               conservationSlider.getTitle(), 420, 90, false);
       conservationSlider
-              .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+              .addInternalFrameListener(new InternalFrameAdapter()
               {
                 @Override
-                public void internalFrameClosed(
-                        javax.swing.event.InternalFrameEvent e)
+                public void internalFrameClosed(InternalFrameEvent e)
                 {
                   conservationSlider = null;
                 }
@@ -253,6 +249,7 @@ public class SliderPanel extends GSliderPanel
     else
     {
       pid = (SliderPanel) PIDSlider.getContentPane();
+      pid.slider.setValue(cs.getThreshold());
       pid.cs = cs;
     }
 
@@ -278,29 +275,21 @@ public class SliderPanel extends GSliderPanel
    */
   public static void showPIDSlider()
   {
-    try
-    {
-      conservationSlider.setClosed(true);
-      conservationSlider = null;
-    } catch (Exception ex)
-    {
-    }
+    hideConservationSlider();
 
     if (!PIDSlider.isVisible())
     {
       Desktop.addInternalFrame(PIDSlider, PIDSlider.getTitle(), 420, 90,
               false);
       PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
-      PIDSlider
-              .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
-              {
-                @Override
-                public void internalFrameClosed(
-                        javax.swing.event.InternalFrameEvent e)
-                {
-                  PIDSlider = null;
-                }
-              });
+      PIDSlider.addInternalFrameListener(new InternalFrameAdapter()
+      {
+        @Override
+        public void internalFrameClosed(InternalFrameEvent e)
+        {
+          PIDSlider = null;
+        }
+      });
       PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
     }
   }