96 lines
2.1 KiB
Java
96 lines
2.1 KiB
Java
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<DoActionOnDetailLayersEventHandler> {
|
|
public static Type<DoActionOnDetailLayersEventHandler> TYPE = new Type<DoActionOnDetailLayersEventHandler>();
|
|
|
|
/**
|
|
* 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<DoActionOnDetailLayersEventHandler> 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;
|
|
}
|
|
|
|
} |