int decay = (maxDecay + minDecay) / 2;
if (analyzer != null)
{
decay = (int) (analyzer.getSpectrumAnalyserDecay() * 100);
}
analyzerFalloff = new JSlider(JSlider.HORIZONTAL, minDecay, maxDecay, decay);
analyzerFalloff.setMajorTickSpacing(1);
analyzerFalloff.setPaintTicks(true);
analyzerFalloff.setMaximumSize(new Dimension(150, analyzerFalloff.getPreferredSize().height));
analyzerFalloff.setAlignmentX(Component.LEFT_ALIGNMENT);
analyzerFalloff.setSnapToTicks(true);
analyzerFalloff.addChangeListener(this);
spectrumPane.add(analyzerFalloff);
// Peaks falloff.
JLabel peaksFalloffLabel = new JLabel(getResource("spectrum.peaks.falloff"));
peaksFalloffLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
spectrumPane.add(peaksFalloffLabel);
int peakDelay = SpectrumTimeAnalyzer.DEFAULT_SPECTRUM_ANALYSER_PEAK_DELAY;
int fps = SpectrumTimeAnalyzer.DEFAULT_FPS;
if (analyzer != null)
{
fps = analyzer.getFps();
peakDelay = analyzer.getPeakDelay();
}
peaksFalloff = new JSlider(JSlider.HORIZONTAL, 0, 4, computeSliderValue(peakDelay, fps));
peaksFalloff.setMajorTickSpacing(1);
peaksFalloff.setPaintTicks(true);
peaksFalloff.setSnapToTicks(true);
Hashtable labelTable = new Hashtable();
labelTable.put(new Integer(0), new JLabel("Slow"));