All Downloads are FREE. Search and download functionalities are using the official Maven repository.

timeBench.ui.FisheyeSlider Maven / Gradle / Ivy

Go to download

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