From fc3f7f62b05ae69b242d64084f676d7733962c60 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 24 Aug 2012 16:33:15 +0300 Subject: Migrate Slider to Vaadin 7 (#9304) --- .../vaadin/shared/ui/slider/SliderOrientation.java | 5 ++ .../vaadin/shared/ui/slider/SliderServerRpc.java | 14 +++++ .../com/vaadin/shared/ui/slider/SliderState.java | 60 ++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java create mode 100644 shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java create mode 100644 shared/src/com/vaadin/shared/ui/slider/SliderState.java (limited to 'shared') diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java new file mode 100644 index 0000000000..d130550946 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java @@ -0,0 +1,5 @@ +package com.vaadin.shared.ui.slider; + +public enum SliderOrientation { + HORIZONTAL, VERTICAL; +} diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java new file mode 100644 index 0000000000..6ea02f0a95 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java @@ -0,0 +1,14 @@ +package com.vaadin.shared.ui.slider; + +import com.vaadin.shared.communication.ServerRpc; + +public interface SliderServerRpc extends ServerRpc { + + /** + * Invoked when the value of a variable has changed. Slider listeners are + * notified if the slider value has changed. + * + * @param value + */ + public void valueChanged(double value); +} diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderState.java b/shared/src/com/vaadin/shared/ui/slider/SliderState.java new file mode 100644 index 0000000000..98168b80af --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderState.java @@ -0,0 +1,60 @@ +package com.vaadin.shared.ui.slider; + +import com.vaadin.shared.AbstractFieldState; + +public class SliderState extends AbstractFieldState { + + protected double value; + + protected double maxValue; + protected double minValue; + + /** + * The number of fractional digits that are considered significant. Must be + * non-negative. + */ + protected int resolution; + + protected SliderOrientation orientation; + + public double getValue() { + return value; + } + + public void setValue(double value) { + this.value = value; + } + + public double getMaxValue() { + return maxValue; + } + + public void setMaxValue(double maxValue) { + this.maxValue = maxValue; + } + + public double getMinValue() { + return minValue; + } + + public void setMinValue(double minValue) { + this.minValue = minValue; + } + + public int getResolution() { + return resolution; + } + + public void setResolution(int resolution) { + this.resolution = resolution; + } + + public SliderOrientation getOrientation() { + return orientation; + } + + public void setOrientation(SliderOrientation orientation) { + this.orientation = orientation; + } + +} -- cgit v1.2.3