From 94c57dea3848635e0ae42fae464e23301f9e7c2c Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Wed, 27 Sep 2017 13:06:27 +0300 Subject: Eliminate the use of AWT in non-test code (#10094) --- .../ui/components/colorpicker/ColorPickerGrid.java | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'compatibility-server') 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; -- cgit v1.2.3