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.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
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
{\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