@SuppressWarnings("serial")
public class AnnotationColourChooser extends AnnotationRowFilter
{
- private static final int ONETHOUSAND = 1000;
-
private ColourSchemeI oldcs;
private JButton defColours;
"error.implementation_error_dont_know_about_threshold_setting"));
}
thresholdIsMin.setSelected(acg.isThresholdIsMinMax());
- thresholdValue.setText("" + acg.getAnnotationThreshold());
+ thresholdValue
+ .setText(String.valueOf(acg.getAnnotationThreshold()));
}
jbInit();
@Override
public void reset()
{
- av.setGlobalColourScheme(oldcs);
+ this.ap.alignFrame.changeColour(oldcs);
if (av.getAlignment().getGroups() != null)
{
{
updateView();
}
- getCurrentAnnotation().threshold.value = slider.getValue() / 1000f;
+ getCurrentAnnotation().threshold.value = getSliderValue();
propagateSeqAssociatedThreshold(updateAllAnnotation,
getCurrentAnnotation());
ap.paintAlignment(false, false);
thresholdValue.setEnabled(true);
thresholdIsMin.setEnabled(!useOriginalColours.isSelected());
+ final AlignmentAnnotation currentAnnotation = getCurrentAnnotation();
if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD)
{
slider.setEnabled(false);
thresholdIsMin.setEnabled(false);
}
else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD
- && getCurrentAnnotation().threshold == null)
+ && currentAnnotation.threshold == null)
{
- getCurrentAnnotation().setThreshold(new GraphLine(
- (getCurrentAnnotation().graphMax
- - getCurrentAnnotation().graphMin) / 2f,
+ currentAnnotation.setThreshold(new GraphLine(
+ (currentAnnotation.graphMax - currentAnnotation.graphMin)
+ / 2f,
"Threshold", Color.black));
}
if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD)
{
adjusting = true;
- float range = getCurrentAnnotation().graphMax * ONETHOUSAND
- - getCurrentAnnotation().graphMin * ONETHOUSAND;
-
- slider.setMinimum(
- (int) (getCurrentAnnotation().graphMin * ONETHOUSAND));
- slider.setMaximum(
- (int) (getCurrentAnnotation().graphMax * ONETHOUSAND));
- slider.setValue(
- (int) (getCurrentAnnotation().threshold.value * ONETHOUSAND));
- thresholdValue.setText(getCurrentAnnotation().threshold.value + "");
- slider.setMajorTickSpacing((int) (range / 10f));
+ setSliderModel(currentAnnotation.graphMin, currentAnnotation.graphMax,
+ currentAnnotation.threshold.value);
slider.setEnabled(true);
+
+ setThresholdValueText();
thresholdValue.setEnabled(true);
adjusting = false;
}
- colorAlignmentContaining(getCurrentAnnotation(), selectedThresholdItem);
+ colorAlignmentContaining(currentAnnotation, selectedThresholdItem);
ap.alignmentChanged();
}
acg.setThresholdIsMinMax(thresholdIsMin.isSelected());
- av.setGlobalColourScheme(acg);
+ this.ap.alignFrame.changeColour(acg);
if (av.getAlignment().getGroups() != null)
{
continue;
}
sg.setColourScheme(
- acg.getInstance(sg, ap.av.getHiddenRepSequences()));
+ acg.getInstance(av, sg));
}
}
}
+ @Override
+ protected void sliderDragReleased()
+ {
+ super.sliderDragReleased();
+ ap.paintAlignment(true, true);
+ }
}