// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/client/event/UrlParametersChangeEvent.java
// public class UrlParametersChangeEvent extends GwtEvent<UrlParametersChangeEventHandler> {
// 
// 	private static GwtEvent.Type<UrlParametersChangeEventHandler> TYPE;
// 
// 	private HashMap<String, String> paramaters;
// 
// 	public UrlParametersChangeEvent(){
// 		super();
// 	}
// 	
// 	public UrlParametersChangeEvent(HashMap<String, String> paramters) {
// 		super();
// 		setParamaters(paramters);
// 	}
// 
// 	public static Type<UrlParametersChangeEventHandler> getType() {
// 		if (TYPE == null) {
// 			TYPE = new Type<UrlParametersChangeEventHandler>();
// 		}
// 		return TYPE;
// 	}
// 
// 
// 	@Override
// 	protected void dispatch(UrlParametersChangeEventHandler handler) {
// 		// TODO Auto-generated method stub
// 		handler.onParametersChange(this);
// 	}
// 
// 	@Override
// 	public Type<UrlParametersChangeEventHandler> getAssociatedType() {
// 		return getType();
// 	}
// 
// 	public HashMap<String, String> getParamaters() {
// 		return paramaters;
// 	}
// 
// 	public void setParamaters(HashMap<String, String> paramaters) {
// 		this.paramaters = paramaters;
// 	}
// 
// }


import net.customware.gwt.presenter.client.widget.WidgetDisplay;
import net.customware.gwt.presenter.client.widget.WidgetPresenter;
import com.google.gwt.user.client.ui.Widget;
import es.upm.fi.dia.oeg.map4rdf.client.event.UrlParametersChangeEvent;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.place.Place;
import net.customware.gwt.presenter.client.place.PlaceRequest;
import net.customware.gwt.presenter.client.place.PlaceRequestEvent;
import net.customware.gwt.presenter.client.place.PlaceRequestHandler;
	public AppController(Display display, EventBus eventBus) {
		super(display, eventBus);
		presenters = new HashSet<WidgetPresenter<?>>();
		eventBus.addHandler(PlaceRequestEvent.getType(), this);
	}

	public AppController(Display display, EventBus eventBus, WidgetPresenter<?>... presenters) {
		this(display, eventBus);
		Collections.addAll(this.presenters, presenters);
	}
    

	public void addPresenter(WidgetPresenter<?> presenter) {
		presenters.add(presenter);
	}

	public void removePresenter(WidgetPresenter<?> presenter) {
		presenters.remove(presenter);
	}

    @Override
	public void onPlaceRequest(PlaceRequestEvent event) {
    	Place place = getPlaceFromQueryString(event);
    	HashMap<String, String> myMap = getParamtersMap(event);
		if (place == null) {
			return;
		}
        for (WidgetPresenter<?> presenter : presenters) {
			if (place.equals(presenter.getPlace())) {
				if (myMap != null) {
// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/client/event/UrlParametersChangeEvent.java
// public class UrlParametersChangeEvent extends GwtEvent<UrlParametersChangeEventHandler> {
// 
// 	private static GwtEvent.Type<UrlParametersChangeEventHandler> TYPE;
// 
// 	private HashMap<String, String> paramaters;
// 
// 	public UrlParametersChangeEvent(){
// 		super();
// 	}
// 	
// 	public UrlParametersChangeEvent(HashMap<String, String> paramters) {
// 		super();
// 		setParamaters(paramters);
// 	}
// 
// 	public static Type<UrlParametersChangeEventHandler> getType() {
// 		if (TYPE == null) {
// 			TYPE = new Type<UrlParametersChangeEventHandler>();
// 		}
// 		return TYPE;
// 	}
// 
// 
// 	@Override
// 	protected void dispatch(UrlParametersChangeEventHandler handler) {
// 		// TODO Auto-generated method stub
// 		handler.onParametersChange(this);
// 	}
// 
// 	@Override
// 	public Type<UrlParametersChangeEventHandler> getAssociatedType() {
// 		return getType();
// 	}
// 
// 	public HashMap<String, String> getParamaters() {
// 		return paramaters;
// 	}
// 
// 	public void setParamaters(HashMap<String, String> paramaters) {
// 		this.paramaters = paramaters;
// 	}
// 
// }


// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/client/controllers/AppController.java
import net.customware.gwt.presenter.client.widget.WidgetDisplay;
import net.customware.gwt.presenter.client.widget.WidgetPresenter;
import com.google.gwt.user.client.ui.Widget;
import es.upm.fi.dia.oeg.map4rdf.client.event.UrlParametersChangeEvent;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.place.Place;
import net.customware.gwt.presenter.client.place.PlaceRequest;
import net.customware.gwt.presenter.client.place.PlaceRequestEvent;
import net.customware.gwt.presenter.client.place.PlaceRequestHandler;

	public AppController(Display display, EventBus eventBus) {
		super(display, eventBus);
		presenters = new HashSet<WidgetPresenter<?>>();
		eventBus.addHandler(PlaceRequestEvent.getType(), this);
	}

	public AppController(Display display, EventBus eventBus, WidgetPresenter<?>... presenters) {
		this(display, eventBus);
		Collections.addAll(this.presenters, presenters);
	}
    

	public void addPresenter(WidgetPresenter<?> presenter) {
		presenters.add(presenter);
	}

	public void removePresenter(WidgetPresenter<?> presenter) {
		presenters.remove(presenter);
	}

    @Override
	public void onPlaceRequest(PlaceRequestEvent event) {
    	Place place = getPlaceFromQueryString(event);
    	HashMap<String, String> myMap = getParamtersMap(event);
		if (place == null) {
			return;
		}
        for (WidgetPresenter<?> presenter : presenters) {
			if (place.equals(presenter.getPlace())) {
				if (myMap != null) {
					UrlParametersChangeEvent parametersChangeEvent = new UrlParametersChangeEvent(myMap);