summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java24
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java24
2 files changed, 42 insertions, 6 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
index 0f9d93be75..4b96f0de12 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.v7.ui.components.colorpicker;
-import java.awt.Point;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
@@ -34,6 +34,24 @@ import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGridState;
public class ColorPickerGrid extends AbstractComponent
implements ColorSelector {
+ private static class Point implements Serializable {
+ private int x;
+ private int y;
+
+ public Point(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+ }
+
private static final String STYLENAME = "v-colorpicker-grid";
private static final Method COLOR_CHANGE_METHOD;
@@ -150,8 +168,8 @@ public class ColorPickerGrid extends AbstractComponent
String color = c.getCSS();
colors[counter] = color;
- XCoords[counter] = String.valueOf((int) p.getX());
- YCoords[counter] = String.valueOf((int) p.getY());
+ XCoords[counter] = String.valueOf(p.getX());
+ YCoords[counter] = String.valueOf(p.getY());
counter++;
}
getState().changedColor = colors;
diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java
index e51d03c5e0..dd6e1b1d4c 100644
--- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.ui.components.colorpicker;
-import java.awt.Point;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -32,6 +32,24 @@ import com.vaadin.ui.AbstractField;
*/
public class ColorPickerGrid extends AbstractField<Color> {
+ private static class Point implements Serializable {
+ private int x;
+ private int y;
+
+ public Point(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+ }
+
private static final String STYLENAME = "v-colorpicker-grid";
private ColorPickerGridServerRpc rpc = new ColorPickerGridServerRpc() {
@@ -122,8 +140,8 @@ public class ColorPickerGrid extends AbstractField<Color> {
String color = c.getCSS();
colors[counter] = color;
- xCoords[counter] = String.valueOf((int) p.getX());
- yCoords[counter] = String.valueOf((int) p.getY());
+ xCoords[counter] = String.valueOf(p.getX());
+ yCoords[counter] = String.valueOf(p.getY());
counter++;
}
getState().changedColor = colors;