package org.gcube.portlets.user.geoportaldataviewer.client.events; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import com.google.gwt.event.shared.GwtEvent; /** * The Class DoActionOnDetailLayersEvent. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * * Oct 8, 2021 */ public class DoActionOnDetailLayersEvent extends GwtEvent { public static Type TYPE = new Type(); /** * The Enum DO_LAYER_ACTION. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * * Oct 8, 2021 */ public static enum DO_LAYER_ACTION { VISIBILITY, SWAP, OPACITY } private DO_LAYER_ACTION doAction; private LayerItem layerSource; private LayerItem layerTarget; private int opacity; private boolean visibility; /** * Instantiates a new added layer to map event. * * @param action the action * @param layerSource the layer source * @param layerTarget the layer target */ public DoActionOnDetailLayersEvent(DO_LAYER_ACTION action, LayerItem layerSource, LayerItem layerTarget) { this.layerSource = layerSource; this.layerTarget = layerTarget; this.doAction = action; } public void setOpacity(int opacity) { this.opacity = opacity; } public void setVisibility(boolean visibility) { this.visibility = visibility; } /** * Gets the associated type. * * @return the associated type */ @Override public Type getAssociatedType() { return TYPE; } /** * Dispatch. * * @param handler the handler */ @Override protected void dispatch(DoActionOnDetailLayersEventHandler handler) { handler.onDoActionOnDetailLayers(this); } public DO_LAYER_ACTION getDoAction() { return doAction; } public LayerItem getLayerSource() { return layerSource; } public LayerItem getLayerTarget() { return layerTarget; } public int getOpacity() { return opacity; } public boolean getVisibility() { return visibility; } }