// 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);
}
Scheduler.get().scheduleDeferred(layoutCommand);
}
}
-
- public MeasureManager.MeasuredSize getMeasuredSize(
- VPaintableWidget paintable) {
- return paintableMap.getMeasuredSize(paintable);
- }
-
}
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() {
private HashMap<Object, TooltipInfo> additionalTooltips;
/**
-
- /**
+ *
* @return the offsetSize
*/
Size getOffsetSize() {
}
return false;
}
-
- public MeasureManager.MeasuredSize getMeasuredSize() {
- return measuredSize;
- }
}
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());
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 {
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
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
*/
// FIXME: Rename to getParent()
public VPaintableWidgetContainer getParent();
+
+ public MeasuredSize getMeasuredSize();
}
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;
private String id;
private VPaintableWidgetContainer parent;
+ private final MeasuredSize measuredSize = new MeasuredSize();
+
/* State variables */
private boolean enabled = true;
}
}
}
+
+ public MeasuredSize getMeasuredSize() {
+ return measuredSize;
+ }
}
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());
}
.remove(component);
if (removedCaption != null) {
getWidgetForPaintable().remove(removedCaption);
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(component);
+ MeasureManager.MeasuredSize measuredSize = component
+ .getMeasuredSize();
measuredSize.deRegisterDependency(removedCaption.getElement());
}
}
if (!childUIDL.getBooleanAttribute("cached")) {
child.updateFromUIDL(childUIDL, client);
- client.getMeasuredSize(child).setDirty(true);
+ child.getMeasuredSize().setDirty(true);
}
// TODO Update alignments and expand ratios
getWidgetForPaintable().expandRatios = uidl
.getMapAttribute("expandRatios");
getWidgetForPaintable().alignments = uidl.getMapAttribute("alignments");
- client.getMeasuredSize(this).setDirty(true);
+ getMeasuredSize().setDirty(true);
}
private int getCaptionWidth(VPaintableWidget child) {
if (caption == null) {
return 0;
} else {
- MeasureManager.MeasuredSize measuredSize = getWidgetForPaintable().client
- .getMeasuredSize(child);
+ MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize();
return measuredSize.getDependencyWidth(caption.getElement());
}
}
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());
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 {