No longer used for annotation gradient
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Feb 2006 15:47:21 +0000 (15:47 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Feb 2006 15:47:21 +0000 (15:47 +0000)
src/jalview/gui/SliderPanel.java

index 6a1ae97..b830d5d 100755 (executable)
@@ -44,7 +44,6 @@ public class SliderPanel extends GSliderPanel
     static JInternalFrame PIDSlider;\r
     AlignmentPanel ap;\r
     boolean forConservation = true;\r
-    boolean forAnnotation = false;\r
     ColourSchemeI cs;\r
 \r
     /**\r
@@ -90,43 +89,6 @@ public class SliderPanel extends GSliderPanel
         valueField.setText(value + "");\r
     }\r
 \r
-    public SliderPanel(final AlignmentAnnotation annotation, final AlignmentPanel ap)\r
-    {\r
-      forAnnotation = true;\r
-      undoButton.setVisible(false);\r
-      applyButton.setVisible(false);\r
-      allGroupsCheck.setVisible(false);\r
-      label.setText("Adjust value - "+annotation.threshold.label);\r
-\r
-      float range = annotation.graphMax * 1000 - annotation.graphMin * 1000;\r
-\r
-      slider.setMinimum( (int) (annotation.graphMin * 1000));\r
-      slider.setMaximum( (int) (annotation.graphMax * 1000));\r
-      slider.setValue( (int) (annotation.threshold.value * 1000));\r
-      valueField.setText( annotation.threshold.value + "");\r
-      slider.setMajorTickSpacing( (int) (range / 10f));\r
-      slider.setMinorTickSpacing( (int) (range / 100f));\r
-      slider.setPaintTicks(true);\r
-\r
-      JInternalFrame slideFrame = new JInternalFrame();\r
-      slideFrame.setLayer(JLayeredPane.PALETTE_LAYER);\r
-      Desktop.addInternalFrame(slideFrame,\r
-                               "Adjust " + annotation.label +" value",\r
-                               250, 90);\r
-\r
-      slideFrame.setContentPane(this);\r
-      slider.addChangeListener(new ChangeListener()\r
-      {\r
-        public void stateChanged(ChangeEvent evt)\r
-        {\r
-          valueField.setText( ((float)slider.getValue()/1000f) + "");\r
-          annotation.threshold.value = (float)slider.getValue()/1000f;\r
-          ap.repaint();\r
-        }\r
-      });\r
-\r
-    }\r
-\r
 \r
     /**\r
      * DOCUMENT ME!\r
@@ -282,12 +244,10 @@ public class SliderPanel extends GSliderPanel
     public void valueChanged(int i)\r
     {\r
         if (cs == null)\r
-        {System.out.println("cs is null");\r
+        {\r
             return;\r
         }\r
 \r
-\r
-\r
         ColourSchemeI toChange = null;\r
         Vector allGroups = null;\r
         int groupIndex = 0;\r
@@ -354,18 +314,10 @@ public class SliderPanel extends GSliderPanel
     {\r
         try\r
         {\r
-          if (forAnnotation)\r
-          {\r
-            float f = Float.parseFloat(valueField.getText());\r
-            slider.setValue( (int)( f * 1000 ));\r
-          }\r
-          else\r
-          {\r
             int i = Integer.parseInt(valueField.getText());\r
             slider.setValue(i);\r
-          }\r
         }\r
-        catch (Exception ex)\r
+        catch (NumberFormatException ex)\r
         {\r
             valueField.setText(slider.getValue() + "");\r
         }\r