/*
 * This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
 *
 * Copyright 2008-2011 Geosparc nv, http://www.geosparc.com/, Belgium.
 *
 * The program is available in open source according to the GNU Affero
 * General Public License. All contributions in this program are covered
 * by the Geomajas Contributors License Agreement. For full licensing
 * details, see LICENSE.txt in the project root.
 */

package org.geomajas.puregwt.client.map;

import org.vaadin.gwtgraphics.client.Group;

/**
 * Default implementation of the WorldContainer interface. It represents a vector group element in world space.
 * 
 * @author Pieter De Graef
 */
public class WorldGroup extends Group implements WorldContainer {

	private String id;

	public WorldGroup(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}
}
@@ -470,39 +470,181 @@
 org.
-vaadin.gwtgraphics.client.Group
+geomajas.puregwt.client.spatial.Matrix;%0Aimport org.vaadin.gwtgraphics.client.Group;%0Aimport org.vaadin.gwtgraphics.client.VectorObject;%0A%0Aimport com.google.gwt.user.client.DOM
 ;%0A%0A/
@@ -881,16 +881,57 @@
 ng id;%0A%0A
+%09private boolean resizeChildren = true;%0A%0A
 %09public 
@@ -999,16 +999,16 @@
 tId() %7B%0A
-
 %09%09return
@@ -1014,10 +1014,1369 @@
 n id;%0A%09%7D
+%0A%0A%09public boolean isResizeChildren() %7B%0A%09%09return resizeChildren;%0A%09%7D%0A%0A%09public void setResizeChildren(boolean resizeChildren) %7B%0A%09%09this.resizeChildren = resizeChildren;%0A%09%7D%0A%0A%09protected void transform(ViewPortImpl viewPortImpl) %7B%0A%09%09// TODO SVG only atm...%0A%0A%09%09if (resizeChildren) %7B%0A%09%09%09Matrix matrix = viewPortImpl.getTransformationService().getWorldToViewTransformation();%0A%09%09%09DOM.setElementAttribute(getElement(), %22transform%22, parse(matrix));%09%09%09%0A%09%09%7D else %7B%0A%09%09%09for (int i = 0; i %3C getVectorObjectCount(); i++) %7B%0A%09%09%09%09VectorObject vo = getVectorObject(i);%0A%09%09%09%09// TODO implement this...%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09 * Parse a matrix object into a string, suitable for the SVG 'transform' attribute.%0A%09 * %0A%09 * @param matrix%0A%09 *            The matrix to parse.%0A%09 * @return The transform string.%0A%09 */%0A%09private String parse(Matrix matrix) %7B%0A%09%09String transform = %22%22;%0A%09%09if (matrix != null) %7B%0A%09%09%09double dx = matrix.getDx();%0A%09%09%09double dy = matrix.getDy();%0A%09%09%09if (matrix.getXx() != 0 && matrix.getYy() != 0 && matrix.getXx() != 1 && matrix.getYy() != 1) %7B%0A%09%09%09%09transform += %22scale(%22 + matrix.getXx() + %22, %22 + matrix.getYy() + %22)%22; // scale first%0A%09%09%09%09// no space between 'scale' and '(' !!!%0A%09%09%09%09dx /= matrix.getXx();%0A%09%09%09%09dy /= matrix.getYy();%0A%09%09%09%7D%0A%09%09%09transform += %22 translate(%22 + (float) dx + %22, %22 + (float) dy + %22)%22;%0A%09%09%09// no space between 'translate' and '(' !!!%0A%09%09%7D%0A%09%09return transform;%0A%09%7D
 %0A%7D

Allow for drawing vector objects in world space