diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-09-27 13:06:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 13:06:27 +0300 |
commit | 94c57dea3848635e0ae42fae464e23301f9e7c2c (patch) | |
tree | af8c11734f0765b98349b0f20cb5c3cd6166cf2f /server/src/main/java/com/vaadin/ui/components | |
parent | 22566d5d9d3794edc1bad59a709f3a78b3a3ba28 (diff) | |
download | vaadin-framework-94c57dea3848635e0ae42fae464e23301f9e7c2c.tar.gz vaadin-framework-94c57dea3848635e0ae42fae464e23301f9e7c2c.zip |
Eliminate the use of AWT in non-test code (#10094)
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/components')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java | 24 |
1 files changed, 21 insertions, 3 deletions
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; |