geoportal-data-viewer-app/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/QueryDataEvent.java

131 lines
2.9 KiB
Java
Raw Normal View History

2020-10-29 15:18:14 +01:00
package org.gcube.portlets.user.geoportaldataviewer.client.events;
2021-08-31 18:21:17 +02:00
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
2020-10-29 15:18:14 +01:00
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import com.google.gwt.event.shared.GwtEvent;
import ol.Coordinate;
/**
* The Class QueryDataEvent.
*
2021-08-31 18:21:17 +02:00
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
2020-10-29 15:18:14 +01:00
*
2021-08-31 18:21:17 +02:00
* Aug 31, 2021
2020-10-29 15:18:14 +01:00
*/
public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
public static Type<QueryDataEventHandler> TYPE = new Type<QueryDataEventHandler>();
private GeoQuery select;
2020-12-04 15:06:32 +01:00
private Coordinate onFailureCenterTo;
private String mongoItemId;
2020-12-04 15:06:32 +01:00
private boolean onInit;
2021-08-31 18:21:17 +02:00
private MapEventType sourceMapEventType;
2020-12-04 15:06:32 +01:00
2020-10-29 15:18:14 +01:00
/**
2020-12-04 15:06:32 +01:00
* Instantiates a new query data event.
*
* @param select the select
2020-12-04 15:06:32 +01:00
* @param onFailureCenterTo the on failure center to
* @param mongoItemId the mongo item id
* @param onInit the on init
2021-08-31 18:21:17 +02:00
* @param mapEventType the map event type
2020-10-29 15:18:14 +01:00
*/
2021-08-31 18:21:17 +02:00
public QueryDataEvent(GeoQuery select, Coordinate onFailureCenterTo, String mongoItemId, boolean onInit,
MapEventType mapEventType) {
2020-10-29 15:18:14 +01:00
this.select = select;
2020-12-04 15:06:32 +01:00
this.onFailureCenterTo = onFailureCenterTo;
this.mongoItemId = mongoItemId;
2020-12-04 15:06:32 +01:00
this.onInit = onInit;
2021-08-31 18:21:17 +02:00
this.sourceMapEventType = mapEventType;
2020-10-29 15:18:14 +01:00
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<QueryDataEventHandler> getAssociatedType() {
return TYPE;
}
2021-08-31 18:21:17 +02:00
/**
* Gets the mongo item id.
*
* @return the mongo item id
*/
public String getMongoItemId() {
return mongoItemId;
}
2020-10-29 15:18:14 +01:00
2020-12-04 15:06:32 +01:00
/**
* Checks if is on init.
*
* @return true, if is on init
*/
public boolean isOnInit() {
return onInit;
}
2020-10-29 15:18:14 +01:00
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(QueryDataEventHandler handler) {
handler.onQueryInteraction(this);
}
2020-12-04 15:06:32 +01:00
/**
* Gets the geo query.
*
* @return the geo query
*/
2020-10-29 15:18:14 +01:00
public GeoQuery getGeoQuery() {
return select;
}
2021-08-31 18:21:17 +02:00
/**
* Gets the on failure center to.
*
* @return the on failure center to
*/
2020-12-04 15:06:32 +01:00
public Coordinate getOnFailureCenterTo() {
return onFailureCenterTo;
2020-10-29 15:18:14 +01:00
}
2020-12-02 17:52:06 +01:00
2021-08-31 18:21:17 +02:00
/**
* Gets the source map event type.
*
* @return the source map event type
*/
public MapEventType getSourceMapEventType() {
return sourceMapEventType;
}
/**
* To string.
*
* @return the string
*/
2020-12-02 17:52:06 +01:00
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("QueryDataEvent [select=");
builder.append(select);
2020-12-04 15:06:32 +01:00
builder.append(", onFailureCenterTo=");
builder.append(onFailureCenterTo);
builder.append(", mongoItemId=");
builder.append(mongoItemId);
2020-12-04 15:06:32 +01:00
builder.append(", onInit=");
builder.append(onInit);
2021-08-31 18:21:17 +02:00
builder.append(", sourceMapEventType=");
builder.append(sourceMapEventType);
2020-12-02 17:52:06 +01:00
builder.append("]");
return builder.toString();
}
2020-12-04 15:06:32 +01:00
2020-10-29 15:18:14 +01:00
}