aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-05-25 12:54:13 +0000
committerArtur Signell <artur.signell@itmill.com>2010-05-25 12:54:13 +0000
commitf2928c7054bb0fceba31066438e53c8e085941fc (patch)
treeb90dbebf541ea6501967c045a585eb9000ffc918 /src/com
parentefc5dea2454b116d27a19618967bbc4c9d7aca8d (diff)
downloadvaadin-framework-f2928c7054bb0fceba31066438e53c8e085941fc.tar.gz
vaadin-framework-f2928c7054bb0fceba31066438e53c8e085941fc.zip
Fix for #4427 - Updating sub-window position information back to server should not call requestRepaint
svn changeset:13356/svn branch:6.3
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/ui/Window.java47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java
index fd4edccb59..ea3d583c4e 100644
--- a/src/com/vaadin/ui/Window.java
+++ b/src/com/vaadin/ui/Window.java
@@ -941,12 +941,16 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
final Integer positionx = (Integer) variables.get("positionx");
if (positionx != null) {
final int x = positionx.intValue();
- setPositionX(x < 0 ? -1 : x);
+ // This is information from the client so it is already using the
+ // position. No need to repaint.
+ setPositionX(x < 0 ? -1 : x, false);
}
final Integer positiony = (Integer) variables.get("positiony");
if (positiony != null) {
final int y = positiony.intValue();
- setPositionY(y < 0 ? -1 : y);
+ // This is information from the client so it is already using the
+ // position. No need to repaint.
+ setPositionY(y < 0 ? -1 : y, false);
}
if (isClosable()) {
@@ -1015,9 +1019,26 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* @since 4.0.0
*/
public void setPositionX(int positionX) {
+ setPositionX(positionX, true);
+ }
+
+ /**
+ * Sets the distance of Window left border in pixels from left border of the
+ * containing (main window).
+ *
+ * @param positionX
+ * the Distance of Window left border in pixels from left border
+ * of the containing (main window). or -1 if unspecified.
+ * @param repaintRequired
+ * true if the window needs to be repainted, false otherwise
+ * @since 6.3.4
+ */
+ private void setPositionX(int positionX, boolean repaintRequired) {
this.positionX = positionX;
centerRequested = false;
- requestRepaint();
+ if (repaintRequired) {
+ requestRepaint();
+ }
}
/**
@@ -1044,9 +1065,27 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* @since 4.0.0
*/
public void setPositionY(int positionY) {
+ setPositionY(positionY, true);
+ }
+
+ /**
+ * Sets the distance of Window top border in pixels from top border of the
+ * containing (main window).
+ *
+ * @param positionY
+ * the Distance of Window top border in pixels from top border of
+ * the containing (main window). or -1 if unspecified
+ * @param repaintRequired
+ * true if the window needs to be repainted, false otherwise
+ *
+ * @since 6.3.4
+ */
+ private void setPositionY(int positionY, boolean repaintRequired) {
this.positionY = positionY;
centerRequested = false;
- requestRepaint();
+ if (repaintRequired) {
+ requestRepaint();
+ }
}
private static final Method WINDOW_CLOSE_METHOD;