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 { public static Type TYPE = new Type(); private GeoQuery select; private Coordinate onFailureCenterTo; private Long recordId; private boolean onInit; /** * 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 */ public QueryDataEvent(GeoQuery select, Coordinate onFailureCenterTo, Long recordId, boolean onInit) { this.select = select; this.onFailureCenterTo = onFailureCenterTo; this.recordId = recordId; this.onInit = onInit; } /** * Gets the associated type. * * @return the associated type */ @Override public Type getAssociatedType() { return TYPE; } /** * Gets the record id. * * @return the record id */ public Long getRecordId() { return recordId; } /** * Checks if is on init. * * @return true, if is on init */ public boolean isOnInit() { return onInit; } /** * Dispatch. * * @param handler the handler */ @Override protected void dispatch(QueryDataEventHandler handler) { handler.onQueryInteraction(this); } /** * Gets the geo query. * * @return the geo query */ public GeoQuery getGeoQuery() { return select; } public Coordinate getOnFailureCenterTo() { return onFailureCenterTo; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("QueryDataEvent [select="); builder.append(select); builder.append(", onFailureCenterTo="); builder.append(onFailureCenterTo); builder.append(", recordId="); builder.append(recordId); builder.append(", onInit="); builder.append(onInit); builder.append("]"); return builder.toString(); } }