-
- void reset()
- {
- av.setGlobalColourScheme(oldcs);
- if (av.getAlignment().getGroups() != null)
- {
-
- for (SequenceGroup sg : ap.av.getAlignment().getGroups())
- {
- sg.cs = (ColourSchemeI) oldgroupColours.get(sg);
- }
- }
- }
-
- public void thresholdCheck_actionPerformed(ActionEvent e)
- {
- changeColour();
- }
-
- public void annotations_actionPerformed(ActionEvent e)
- {
- changeColour();
- }
-
- public void threshold_actionPerformed(ActionEvent e)
- {
- changeColour();
- }
-
- public void thresholdValue_actionPerformed(ActionEvent e)
- {
- try
- {
- float f = Float.parseFloat(thresholdValue.getText());
- slider.setValue((int) (f * 1000));
- } catch (NumberFormatException ex)
- {
- }
- }
-
- public void valueChanged(boolean updateAllAnnotation)
- {
- if (currentColours.isSelected()
- && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
- {
- changeColour();
- }
- currentAnnotation.threshold.value = slider.getValue() / 1000f;
- propagateSeqAssociatedThreshold(updateAllAnnotation);
- ap.paintAlignment(false);
- }
-
- private void propagateSeqAssociatedThreshold(boolean allAnnotation)
- {
- if (currentAnnotation.sequenceRef == null
- || currentAnnotation.threshold == null)
- {
- return;
- }
- // TODO: JAL-1327 only update visible annotation thresholds if allAnnotation
- // is false, since we only need to provide a quick visual indicator
-
- float thr = currentAnnotation.threshold.value;
- for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
- {
- AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[i];
- if (aa.label.equals(currentAnnotation.label))
- {
- aa.threshold.value = thr;
- }
- }
- }
-
- public void currentColours_actionPerformed(ActionEvent e)
- {
- if (currentColours.isSelected())
- {
- reset();
- }
-
- maxColour.setEnabled(!currentColours.isSelected());
- minColour.setEnabled(!currentColours.isSelected());
-
- changeColour();
- }
-
- public void thresholdIsMin_actionPerformed(ActionEvent actionEvent)
- {
- changeColour();
- }
-