timeBench.ui.FisheyeSlider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timebench Show documentation
Show all versions of timebench Show documentation
TimeBench, a flexible, easy-to-use, and reusable software library written in Java that provides foundational data structures and algorithms for time- oriented data in Visual Analytics.
The newest version!
package timeBench.ui;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import timeBench.action.layout.timescale.FisheyeTimeScale;
/**
* Let's the user change the fisheye distortion intensity of a given
* {@link FisheyeTimeScale} from 0 to 5.
*
* @author peterw
* @see FisheyeTimeScale
*/
public class FisheyeSlider extends JSlider {
private static final long serialVersionUID = 6041848922729348421L;
public FisheyeSlider(final FisheyeTimeScale timeScale) {
super(0, 50, 0);
setPaintLabels(false);
setPaintTicks(false);
setPaintTrack(true);
addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
timeScale.setFisheyeIntensity(getValue() / 10d);
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy