aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConnection.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ComponentDetail.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/MeasureManager.java4
-rw-r--r--src/com/vaadin/terminal/gwt/client/VPaintableMap.java14
-rw-r--r--src/com/vaadin/terminal/gwt/client/VPaintableWidget.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java7
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java21
7 files changed, 24 insertions, 43 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 9b112587a0..afd8130ada 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -1789,7 +1789,8 @@ public class ApplicationConnection {
// Dirty if either dimension changed between relative and non-relative
if (w.endsWith("%") != style.getWidth().endsWith("%")
|| h.endsWith("%") != style.getHeight().endsWith("%")) {
- MeasureManager.MeasuredSize measuredSize = getMeasuredSize(paintable);
+ MeasureManager.MeasuredSize measuredSize = paintable
+ .getMeasuredSize();
if (measuredSize != null) {
measuredSize.setDirty(true);
}
@@ -2252,10 +2253,4 @@ public class ApplicationConnection {
Scheduler.get().scheduleDeferred(layoutCommand);
}
}
-
- public MeasureManager.MeasuredSize getMeasuredSize(
- VPaintableWidget paintable) {
- return paintableMap.getMeasuredSize(paintable);
- }
-
}
diff --git a/src/com/vaadin/terminal/gwt/client/ComponentDetail.java b/src/com/vaadin/terminal/gwt/client/ComponentDetail.java
index e70a49fdad..eff5a76583 100644
--- a/src/com/vaadin/terminal/gwt/client/ComponentDetail.java
+++ b/src/com/vaadin/terminal/gwt/client/ComponentDetail.java
@@ -6,13 +6,11 @@ package com.vaadin.terminal.gwt.client;
import java.util.HashMap;
import com.google.gwt.core.client.JsArrayString;
-import com.vaadin.terminal.gwt.client.MeasureManager.MeasuredSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
class ComponentDetail {
private TooltipInfo tooltipInfo = new TooltipInfo();
- private MeasureManager.MeasuredSize measuredSize = new MeasureManager.MeasuredSize();
public ComponentDetail() {
@@ -49,8 +47,7 @@ class ComponentDetail {
private HashMap<Object, TooltipInfo> additionalTooltips;
/**
-
- /**
+ *
* @return the offsetSize
*/
Size getOffsetSize() {
@@ -110,8 +107,4 @@ class ComponentDetail {
}
return false;
}
-
- public MeasureManager.MeasuredSize getMeasuredSize() {
- return measuredSize;
- }
}
diff --git a/src/com/vaadin/terminal/gwt/client/MeasureManager.java b/src/com/vaadin/terminal/gwt/client/MeasureManager.java
index ed0bb20cf8..cab4822ef4 100644
--- a/src/com/vaadin/terminal/gwt/client/MeasureManager.java
+++ b/src/com/vaadin/terminal/gwt/client/MeasureManager.java
@@ -180,8 +180,8 @@ public class MeasureManager {
for (VPaintableWidget paintableWidget : paintableWidgets) {
Widget widget = paintableWidget.getWidgetForPaintable();
- MeasureManager.MeasuredSize measuredSize = paintableMap
- .getMeasuredSize(paintableWidget);
+ MeasureManager.MeasuredSize measuredSize = paintableWidget
+ .getMeasuredSize();
measuredSize.setWidth(widget.getOffsetWidth());
measuredSize.setHeight(widget.getOffsetHeight());
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintableMap.java b/src/com/vaadin/terminal/gwt/client/VPaintableMap.java
index 309c527e7a..48d32f4a5b 100644
--- a/src/com/vaadin/terminal/gwt/client/VPaintableMap.java
+++ b/src/com/vaadin/terminal/gwt/client/VPaintableMap.java
@@ -17,7 +17,6 @@ import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.Paintable;
-import com.vaadin.terminal.gwt.client.MeasureManager.MeasuredSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
public class VPaintableMap {
@@ -392,17 +391,4 @@ public class VPaintableMap {
return getPid(w) != null;
}
- /**
- * FIXME: Should not be here
- */
- @Deprecated
- public MeasuredSize getMeasuredSize(VPaintableWidget paintable) {
- ComponentDetail componentDetail = getComponentDetail(paintable);
- if (componentDetail == null) {
- return null;
- }
-
- return componentDetail.getMeasuredSize();
- }
-
} \ No newline at end of file
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java b/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java
index 4b8720b132..a66129fd87 100644
--- a/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java
+++ b/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java
@@ -5,6 +5,7 @@
package com.vaadin.terminal.gwt.client;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.MeasureManager.MeasuredSize;
/**
* An interface used by client-side widgets or paintable parts to receive
@@ -28,4 +29,6 @@ public interface VPaintableWidget extends VPaintable {
*/
// FIXME: Rename to getParent()
public VPaintableWidgetContainer getParent();
+
+ public MeasuredSize getMeasuredSize();
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java
index 9747deacd1..1555371e47 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java
@@ -5,6 +5,7 @@ package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.MeasureManager.MeasuredSize;
import com.vaadin.terminal.gwt.client.VPaintableMap;
import com.vaadin.terminal.gwt.client.VPaintableWidget;
import com.vaadin.terminal.gwt.client.VPaintableWidgetContainer;
@@ -16,6 +17,8 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget {
private String id;
private VPaintableWidgetContainer parent;
+ private final MeasuredSize measuredSize = new MeasuredSize();
+
/* State variables */
private boolean enabled = true;
@@ -106,4 +109,8 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget {
}
}
}
+
+ public MeasuredSize getMeasuredSize() {
+ return measuredSize;
+ }
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java
index 5e0565f539..f1838cf30e 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java
@@ -31,8 +31,8 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
getWidgetForPaintable().addCaption(caption, widget);
getWidgetForPaintable().captions.put(component, caption);
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(component);
+ MeasureManager.MeasuredSize measuredSize = component
+ .getMeasuredSize();
measuredSize.registerDependency(caption.getElement());
}
@@ -42,8 +42,8 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
.remove(component);
if (removedCaption != null) {
getWidgetForPaintable().remove(removedCaption);
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(component);
+ MeasureManager.MeasuredSize measuredSize = component
+ .getMeasuredSize();
measuredSize.deRegisterDependency(removedCaption.getElement());
}
}
@@ -82,7 +82,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
if (!childUIDL.getBooleanAttribute("cached")) {
child.updateFromUIDL(childUIDL, client);
- client.getMeasuredSize(child).setDirty(true);
+ child.getMeasuredSize().setDirty(true);
}
// TODO Update alignments and expand ratios
@@ -113,7 +113,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
getWidgetForPaintable().expandRatios = uidl
.getMapAttribute("expandRatios");
getWidgetForPaintable().alignments = uidl.getMapAttribute("alignments");
- client.getMeasuredSize(this).setDirty(true);
+ getMeasuredSize().setDirty(true);
}
private int getCaptionWidth(VPaintableWidget child) {
@@ -121,8 +121,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
if (caption == null) {
return 0;
} else {
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(child);
+ MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize();
return measuredSize.getDependencyWidth(caption.getElement());
}
}
@@ -131,8 +130,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
VCaption caption = getWidgetForPaintable().captions.get(child);
if (caption != null) {
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(child);
+ MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize();
int captionHeight = measuredSize.getDependencyHeight(caption
.getElement());
@@ -181,8 +179,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
private int getMeasuredInDirection(VPaintableWidget paintable,
boolean isVertical) {
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(paintable);
+ MeasureManager.MeasuredSize measuredSize = paintable.getMeasuredSize();
if (isVertical) {
return measuredSize.getHeight();
} else {