diff --git a/WebContent/index.html b/WebContent/index.html index ff366e3998..acfdc3a6b7 100644 --- a/WebContent/index.html +++ b/WebContent/index.html @@ -159,7 +159,7 @@ diff --git a/WebContent/reservr.html b/WebContent/reservr.html deleted file mode 100644 index 320679d891..0000000000 --- a/WebContent/reservr.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - IT Mill Toolkit 5 Demo: Reservr - - - - - - - - - - -
- - diff --git a/build/build.xml b/build/build.xml index 6ae700de8d..774424061d 100644 --- a/build/build.xml +++ b/build/build.xml @@ -660,11 +660,11 @@ - - + + - - + + com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet diff --git a/src/com/itmill/toolkit/demo/reservation/GoogleMap.java b/src/com/itmill/toolkit/demo/reservation/GoogleMap.java index b2a20bdae5..929d7213e7 100644 --- a/src/com/itmill/toolkit/demo/reservation/GoogleMap.java +++ b/src/com/itmill/toolkit/demo/reservation/GoogleMap.java @@ -21,8 +21,6 @@ public class GoogleMap extends AbstractComponent implements Sizeable, Container.Viewer { private final String TAG_MARKERS = "markers"; private final String TAG_MARKER = "marker"; - private int width = 400; - private int height = 300; private int zoomLevel = 15; private Point2D.Double mapCenter; @@ -37,13 +35,20 @@ public class GoogleMap extends AbstractComponent implements Sizeable, public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); + // Add size info as variables + if (getHeight() > -1) { + target.addVariable(this, "height", getHeight() + + UNIT_SYMBOLS[getHeightUnits()]); + } + if (getWidth() > -1) { + target.addVariable(this, "width", getWidth() + + UNIT_SYMBOLS[getWidthUnits()]); + } if (null != mapCenter) { target.addAttribute("centerX", mapCenter.getX()); target.addAttribute("centerY", mapCenter.getY()); } target.addAttribute("zoom", zoomLevel); - target.addAttribute("width", width); - target.addAttribute("height", height); if (dataSource != null) { target.startTag(TAG_MARKERS); @@ -81,40 +86,14 @@ public class GoogleMap extends AbstractComponent implements Sizeable, // Sizeable methods: - public int getHeight() { - return height; - } - public int getHeightUnits() { return Sizeable.UNITS_PIXELS; } - public int getWidth() { - return width; - } - public int getWidthUnits() { return Sizeable.UNITS_PIXELS; } - public void setHeight(int height) { - this.height = height; - requestRepaint(); - } - - public void setHeightUnits(int units) { - throw new UnsupportedOperationException(); - } - - public void setWidth(int width) { - this.width = width; - requestRepaint(); - } - - public void setWidthUnits(int units) { - throw new UnsupportedOperationException(); - } - public void setMapCenter(Point2D.Double center) { mapCenter = center; } @@ -221,13 +200,4 @@ public class GoogleMap extends AbstractComponent implements Sizeable, setContainerDataSource(null); } - public void setSizeFull() { - // TODO Auto-generated method stub - - } - - public void setSizeUndefined() { - // TODO Auto-generated method stub - - } } \ No newline at end of file diff --git a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java index 31fe0cd047..07cd81a77d 100644 --- a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java +++ b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java @@ -90,7 +90,7 @@ public class ReservationApplication extends Application { resourceName.setCaption("Choose resource"); infoLayout.addComponent(resourceName); description = new TextField(); - description.setColumns(20); + description.setWidth("250px"); description.setRows(5); infoLayout.addComponent(description); reservationButton = new Button("Make reservation", this, @@ -98,10 +98,8 @@ public class ReservationApplication extends Application { infoLayout.addComponent(reservationButton); map = new GoogleMap(); - // TODO support EM - // map.setWidthUnits(Size.UNITS_EM); - map.setWidth(266); - map.setHeight(210); + map.setWidth("250px"); + map.setHeight("250px"); map.setItemMarkerHtmlPropertyId(SampleDB.Resource.PROPERTY_ID_NAME); map.setItemMarkerXPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONX); map.setItemMarkerYPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONY); diff --git a/src/com/itmill/toolkit/demo/reservation/gwt/ReservationWidgetSet.gwt.xml b/src/com/itmill/toolkit/demo/reservation/gwt/ReservationWidgetSet.gwt.xml index 1b0c3a4b8a..4298a0e164 100644 --- a/src/com/itmill/toolkit/demo/reservation/gwt/ReservationWidgetSet.gwt.xml +++ b/src/com/itmill/toolkit/demo/reservation/gwt/ReservationWidgetSet.gwt.xml @@ -2,12 +2,25 @@ - - + + + +