static JInternalFrame PIDSlider;\r
AlignmentPanel ap;\r
boolean forConservation = true;\r
+ boolean forAnnotation = false;\r
ColourSchemeI cs;\r
\r
/**\r
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.getGraphLine(0).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.getGraphLine(0).value * 1000));\r
+ valueField.setText( annotation.getGraphLine(0).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.getGraphLine(0).value = (float)slider.getValue()/1000f;\r
+ ap.repaint();\r
+ }\r
+ });\r
+\r
+ }\r
+\r
+\r
/**\r
* DOCUMENT ME!\r
*\r
{\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
{\r