layer_switcher #3
|
@ -363,13 +363,18 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
applicationBus.addHandler(DoActionOnDetailLayersEvent.TYPE, new DoActionOnDetailLayersEventHandler() {
|
applicationBus.addHandler(DoActionOnDetailLayersEvent.TYPE, new DoActionOnDetailLayersEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDoActionOnDetailLayers(DoActionOnDetailLayersEvent doActionOnDetailLayersEvent) {
|
public void onDoActionOnDetailLayers(DoActionOnDetailLayersEvent doLayerActionEvent) {
|
||||||
|
|
||||||
|
DO_LAYER_ACTION doAction = doLayerActionEvent.getDoAction();
|
||||||
|
GWT.log("event: "+doAction);
|
||||||
|
GWT.log("layer source: "+doLayerActionEvent.getLayerSource().getName());
|
||||||
|
GWT.log("layer target: "+doLayerActionEvent.getLayerTarget());
|
||||||
|
|
||||||
DO_LAYER_ACTION doAction = doActionOnDetailLayersEvent.getDoAction();
|
|
||||||
switch (doAction) {
|
switch (doAction) {
|
||||||
case OPACITY:
|
case OPACITY:
|
||||||
olMapMng.getOLOSMMap().setWMSDetailLayerOpacity(doActionOnDetailLayersEvent.getLayerSource(),
|
GWT.log("opacity: "+doLayerActionEvent.getOpacity());
|
||||||
doActionOnDetailLayersEvent.getOpacity());
|
olMapMng.getOLOSMMap().setWMSDetailLayerOpacity(doLayerActionEvent.getLayerSource(),
|
||||||
|
doLayerActionEvent.getOpacity());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWAP:
|
case SWAP:
|
||||||
|
@ -377,8 +382,9 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VISIBILITY:
|
case VISIBILITY:
|
||||||
olMapMng.getOLOSMMap().setWMSDetailLayerVisible(doActionOnDetailLayersEvent.getLayerSource(),
|
GWT.log("visibility: "+doLayerActionEvent.getVisibility());
|
||||||
doActionOnDetailLayersEvent.getVisibility());
|
olMapMng.getOLOSMMap().setWMSDetailLayerVisible(doLayerActionEvent.getLayerSource(),
|
||||||
|
doLayerActionEvent.getVisibility());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -93,4 +93,23 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
||||||
return visibility;
|
return visibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("DoActionOnDetailLayersEvent [doAction=");
|
||||||
|
builder.append(doAction);
|
||||||
|
builder.append(", layerSource=");
|
||||||
|
builder.append(layerSource);
|
||||||
|
builder.append(", layerTarget=");
|
||||||
|
builder.append(layerTarget);
|
||||||
|
builder.append(", opacity=");
|
||||||
|
builder.append(opacity);
|
||||||
|
builder.append(", visibility=");
|
||||||
|
builder.append(visibility);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -774,6 +774,7 @@ public abstract class OpenLayerOSM {
|
||||||
|
|
||||||
public void setWMSDetailLayerVisible(LayerItem layerItem, boolean visible) {
|
public void setWMSDetailLayerVisible(LayerItem layerItem, boolean visible) {
|
||||||
String key = layerItem.getName();
|
String key = layerItem.getName();
|
||||||
|
GWT.log("current layers: "+wmsDetailsLayerMap.keySet());
|
||||||
Image layer = wmsDetailsLayerMap.get(key);
|
Image layer = wmsDetailsLayerMap.get(key);
|
||||||
layer.setVisible(visible);
|
layer.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,13 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
|
import com.google.gwt.event.dom.client.DragStartEvent;
|
||||||
|
import com.google.gwt.event.dom.client.DragStartHandler;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
import com.google.gwt.user.client.Event;
|
||||||
|
import com.google.gwt.user.client.EventListener;
|
||||||
|
import com.google.gwt.user.client.Random;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
@ -14,17 +19,32 @@ public class RangeSlider extends Composite {
|
||||||
interface RangeSliderUiBinder extends UiBinder<Widget, RangeSlider> {
|
interface RangeSliderUiBinder extends UiBinder<Widget, RangeSlider> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RangeSlider() {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
Element theSlider;
|
Element theSlider;
|
||||||
|
|
||||||
public RangeSlider(String firstName) {
|
private String sliderId;
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
|
|
||||||
|
public RangeSlider() {
|
||||||
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
String sliderId = "slider-" +Random.nextInt();
|
||||||
theSlider.addClassName("slider");
|
theSlider.addClassName("slider");
|
||||||
|
theSlider.setId(sliderId);
|
||||||
|
|
||||||
|
Event.sinkEvents(theSlider, Event.ONMOUSEUP);
|
||||||
|
Event.setEventListener(theSlider, new EventListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBrowserEvent(Event event) {
|
||||||
|
System.out.println("ok");
|
||||||
|
if(Event.ONMOUSEUP == event.getTypeInt()) {
|
||||||
|
GWT.log("Event.ONMOUSEUP");
|
||||||
|
GWT.log("obj"+theSlider.getPropertyObject("value"));
|
||||||
|
GWT.log("attr"+theSlider.getAttribute("value"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue