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

112 lines
2.2 KiB
Java
Raw Normal View History

2020-10-29 15:18:14 +01:00
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import com.google.gwt.event.shared.GwtEvent;
import ol.Coordinate;
/**
* The Class QueryDataEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Oct 29, 2020
*/
public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
public static Type<QueryDataEventHandler> TYPE = new Type<QueryDataEventHandler>();
private GeoQuery select;
2020-12-04 16:32:03 +01:00
private Coordinate onFailureCenterTo;
private Long recordId;
2020-12-04 16:32:03 +01:00
private boolean onInit;
2020-10-29 15:18:14 +01:00
/**
2020-12-04 16:32:03 +01:00
* Instantiates a new query data event.
*
* @param select the select
* @param onFailureCenterTo the on failure center to
* @param recordId the record id
* @param onInit the on init
2020-10-29 15:18:14 +01:00
*/
2020-12-04 16:32:03 +01:00
public QueryDataEvent(GeoQuery select, Coordinate onFailureCenterTo, Long recordId, boolean onInit) {
2020-10-29 15:18:14 +01:00
this.select = select;
2020-12-04 16:32:03 +01:00
this.onFailureCenterTo = onFailureCenterTo;
this.recordId = recordId;
2020-12-04 16:32:03 +01:00
this.onInit = onInit;
2020-10-29 15:18:14 +01:00
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<QueryDataEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Gets the record id.
*
* @return the record id
*/
public Long getRecordId() {
return recordId;
}
2020-10-29 15:18:14 +01:00
2020-12-04 16:32:03 +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 16:32:03 +01:00
/**
* Gets the geo query.
*
* @return the geo query
*/
2020-10-29 15:18:14 +01:00
public GeoQuery getGeoQuery() {
return select;
}
2020-12-04 16:32:03 +01:00
public Coordinate getOnFailureCenterTo() {
return onFailureCenterTo;
2020-10-29 15:18:14 +01:00
}
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 16:32:03 +01:00
builder.append(", onFailureCenterTo=");
builder.append(onFailureCenterTo);
2020-12-02 17:52:06 +01:00
builder.append(", recordId=");
builder.append(recordId);
2020-12-04 16:32:03 +01:00
builder.append(", onInit=");
builder.append(onInit);
2020-12-02 17:52:06 +01:00
builder.append("]");
return builder.toString();
}
2020-12-04 16:32:03 +01:00
2020-10-29 15:18:14 +01:00
}