summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2011-12-09 12:50:30 +0200
committerArtur Signell <artur@vaadin.com>2011-12-09 12:50:30 +0200
commitee4a9921681730d1a92be5cdf9b26739c135daea (patch)
treef5c69c21a976fca8a0cf7272327a75ed24d13c7b
parent06e97f31bef4dfb36388975e6ae0efa1520229d2 (diff)
downloadvaadin-framework-ee4a9921681730d1a92be5cdf9b26739c135daea.tar.gz
vaadin-framework-ee4a9921681730d1a92be5cdf9b26739c135daea.zip
#8026 Removed deprecated API from Slider/VSlider
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VSlider.java33
-rw-r--r--src/com/vaadin/ui/Slider.java116
2 files changed, 0 insertions, 149 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
index 6322837e73..5b215cfff4 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java
@@ -39,16 +39,13 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
private boolean immediate;
private boolean disabled;
private boolean readonly;
- private boolean scrollbarStyle;
private int acceleration = 1;
- private int handleSize;
private double min;
private double max;
private int resolution;
private Double value;
private boolean vertical;
- private boolean arrows;
private final HTML feedback = new HTML("", false);
private final VOverlay feedbackPopup = new VOverlay(true, false, true) {
@@ -130,20 +127,12 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
readonly = uidl.getBooleanAttribute("readonly");
vertical = uidl.hasAttribute("vertical");
- arrows = uidl.hasAttribute("arrows");
String style = "";
if (uidl.hasAttribute("style")) {
style = uidl.getStringAttribute("style");
}
- scrollbarStyle = style.indexOf("scrollbar") > -1;
-
- if (arrows) {
- DOM.setStyleAttribute(smaller, "display", "block");
- DOM.setStyleAttribute(bigger, "display", "block");
- }
-
if (vertical) {
addStyleName(CLASSNAME + "-vertical");
} else {
@@ -157,8 +146,6 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
setFeedbackValue(value);
- handleSize = uidl.getIntAttribute("hsize");
-
buildBase();
if (!vertical) {
@@ -233,30 +220,10 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
}
private void buildHandle() {
- final String styleAttribute = vertical ? "height" : "width";
final String handleAttribute = vertical ? "marginTop" : "marginLeft";
- final String domProperty = vertical ? "offsetHeight" : "offsetWidth";
DOM.setStyleAttribute(handle, handleAttribute, "0");
- if (scrollbarStyle) {
- // Only stretch the handle if scrollbar style is set.
- int s = (int) (Double.parseDouble(DOM.getElementProperty(base,
- domProperty)) / 100 * handleSize);
- if (handleSize == -1) {
- final int baseS = Integer.parseInt(DOM.getElementProperty(base,
- domProperty));
- final double range = (max - min) * (resolution + 1) * 3;
- s = (int) (baseS - range);
- }
- if (s < 3) {
- s = 3;
- }
- DOM.setStyleAttribute(handle, styleAttribute, s + "px");
- } else {
- DOM.setStyleAttribute(handle, styleAttribute, "");
- }
-
// Restore visibility
DOM.setStyleAttribute(handle, "visibility", "visible");
diff --git a/src/com/vaadin/ui/Slider.java b/src/com/vaadin/ui/Slider.java
index 8c2ea531b1..50d4fbb9c4 100644
--- a/src/com/vaadin/ui/Slider.java
+++ b/src/com/vaadin/ui/Slider.java
@@ -53,15 +53,6 @@ public class Slider extends AbstractField<Double> {
public static final int ORIENTATION_VERTICAL = 1;
- /**
- * Style constant representing a scrollbar styled slider. Use this with
- * {@link #addStyleName(String)}. Default styling usually represents a
- * common slider found e.g. in Adobe Photoshop. The client side
- * implementation dictates how different styles will look.
- */
- @Deprecated
- public static final String STYLE_SCROLLBAR = "scrollbar";
-
/** Minimum value of slider */
private double min = 0;
@@ -80,35 +71,6 @@ public class Slider extends AbstractField<Double> {
private int orientation = ORIENTATION_HORIZONTAL;
/**
- * Slider size in pixels. In horizontal mode, if set to -1, allow 100% width
- * of container. In vertical mode, if set to -1, default height is
- * determined by the client-side implementation.
- *
- * @deprecated
- */
- @Deprecated
- private int size = -1;
-
- /**
- * Handle (draggable control element) size in percents relative to base
- * size. Must be a value between 1-99. Other values are converted to nearest
- * bound. A negative value sets the width to auto (client-side
- * implementation calculates).
- *
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- private int handleSize = -1;
-
- /**
- * Show arrows that can be pressed to slide the handle in some increments
- * (client-side implementation decides the increment, usually somewhere
- * between 5-10% of slide range).
- */
- @Deprecated
- private final boolean arrows = false;
-
- /**
* Default slider constructor. Sets all values to defaults and the slide
* handle at minimum value.
*
@@ -305,70 +267,6 @@ public class Slider extends AbstractField<Double> {
super.setValue(newValue, repaintIsNotNeeded);
}
- /**
- * Get the current slider size.
- *
- * @return size in pixels or -1 for auto sizing.
- * @deprecated use standard getWidth/getHeight instead
- */
- @Deprecated
- public int getSize() {
- return size;
- }
-
- /**
- * Set the size for this slider.
- *
- * @param size
- * in pixels, or -1 auto sizing.
- * @deprecated use standard setWidth/setHeight instead
- */
- @Deprecated
- public void setSize(int size) {
- this.size = size;
- switch (orientation) {
- case ORIENTATION_HORIZONTAL:
- setWidth(size, UNITS_PIXELS);
- break;
- default:
- setHeight(size, UNITS_PIXELS);
- break;
- }
- requestRepaint();
- }
-
- /**
- * Get the handle size of this slider.
- *
- * @return handle size in percentages.
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- public int getHandleSize() {
- return handleSize;
- }
-
- /**
- * Set the handle size of this slider.
- *
- * @param handleSize
- * in percentages relative to slider base size.
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- public void setHandleSize(int handleSize) {
- if (handleSize < 0) {
- this.handleSize = -1;
- } else if (handleSize > 99) {
- this.handleSize = 99;
- } else if (handleSize < 1) {
- this.handleSize = 1;
- } else {
- this.handleSize = handleSize;
- }
- requestRepaint();
- }
-
@Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
@@ -391,20 +289,6 @@ public class Slider extends AbstractField<Double> {
target.addAttribute("vertical", true);
}
- if (arrows) {
- target.addAttribute("arrows", true);
- }
-
- if (size > -1) {
- target.addAttribute("size", size);
- }
-
- if (min != max && min < max) {
- target.addAttribute("hsize", handleSize);
- } else {
- target.addAttribute("hsize", 100);
- }
-
}
/**