added modal on Open interaction
This commit is contained in:
parent
87514c4f43
commit
26eeb3bf67
|
@ -4,9 +4,13 @@ import java.util.Iterator;
|
||||||
|
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||||
|
@ -166,7 +170,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
bindEvents();
|
bindEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +263,26 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
applicationBus.addHandler(ZoomOutOverMinimumEvent.TYPE, new ZoomOutOverMinimumEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
|
||||||
|
|
||||||
|
if(mainPanel.getDisplyedRecord()==null && !olMapMng.isQueryPointActive()) {
|
||||||
|
olMapMng.hidePopInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
applicationBus.addHandler(ClosedViewDetailsEvent.TYPE, new ClosedViewDetailsEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClosed(ClosedViewDetailsEvent closedViewDetailsEvent) {
|
||||||
|
olMapMng.hidePopInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMap
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
||||||
|
@ -320,9 +322,24 @@ public class LayerManager {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
layerManagerBus.addHandler(ZoomOutOverMinimumEvent.TYPE, new ZoomOutOverMinimumEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
|
||||||
|
applicationBus.fireEvent(zoomOutEvent);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the geona references.
|
||||||
|
*
|
||||||
|
* @param itemType the item type
|
||||||
|
* @param fRow the f row
|
||||||
|
* @return the show details event
|
||||||
|
*/
|
||||||
private ShowDetailsEvent parseGeonaReferences(String itemType, FeatureRow fRow) {
|
private ShowDetailsEvent parseGeonaReferences(String itemType, FeatureRow fRow) {
|
||||||
if(fRow==null)
|
if(fRow==null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -468,7 +485,6 @@ public class LayerManager {
|
||||||
return layerItem;
|
return layerItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is layer visible.
|
* Checks if is layer visible.
|
||||||
*
|
*
|
||||||
|
@ -479,7 +495,6 @@ public class LayerManager {
|
||||||
return olMap.isLayerVisible(layerItem.getName());
|
return olMap.isLayerVisible(layerItem.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the ol map.
|
* Sets the ol map.
|
||||||
*
|
*
|
||||||
|
@ -489,6 +504,11 @@ public class LayerManager {
|
||||||
this.olMap = olMap;
|
this.olMap = olMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the layer manager bus.
|
||||||
|
*
|
||||||
|
* @return the layer manager bus
|
||||||
|
*/
|
||||||
public HandlerManager getLayerManagerBus() {
|
public HandlerManager getLayerManagerBus() {
|
||||||
return layerManagerBus;
|
return layerManagerBus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.geoportaldataviewer.client;
|
package org.gcube.portlets.user.geoportaldataviewer.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||||
|
@ -15,6 +16,13 @@ import ol.MapBrowserEvent;
|
||||||
import ol.MapEvent;
|
import ol.MapEvent;
|
||||||
import ol.OLFactory;
|
import ol.OLFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class OLMapManager.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
public class OLMapManager {
|
public class OLMapManager {
|
||||||
|
|
||||||
private String targetId;
|
private String targetId;
|
||||||
|
@ -26,12 +34,21 @@ public class OLMapManager {
|
||||||
private ol.Extent dragEndExtent = null;
|
private ol.Extent dragEndExtent = null;
|
||||||
private static final int QUERY_MIN_ZOOM_LEVEL = 13;
|
private static final int QUERY_MIN_ZOOM_LEVEL = 13;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new OL map manager.
|
||||||
|
*
|
||||||
|
* @param targetId the target id
|
||||||
|
* @param layerManagerBus the layer manager bus
|
||||||
|
*/
|
||||||
public OLMapManager(String targetId, HandlerManager layerManagerBus) {
|
public OLMapManager(String targetId, HandlerManager layerManagerBus) {
|
||||||
this.targetId = targetId;
|
this.targetId = targetId;
|
||||||
this.layerManagerBus = layerManagerBus;
|
this.layerManagerBus = layerManagerBus;
|
||||||
instanceOLMap();
|
instanceOLMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instance OL map.
|
||||||
|
*/
|
||||||
public void instanceOLMap() {
|
public void instanceOLMap() {
|
||||||
|
|
||||||
olMap = new OpenLayerOSM(targetId, layerManagerBus) {
|
olMap = new OpenLayerOSM(targetId, layerManagerBus) {
|
||||||
|
@ -145,10 +162,18 @@ public class OLMapManager {
|
||||||
return select;
|
return select;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the OLOSM map.
|
||||||
|
*
|
||||||
|
* @return the OLOSM map
|
||||||
|
*/
|
||||||
public OpenLayerOSM getOLOSMMap() {
|
public OpenLayerOSM getOLOSMMap() {
|
||||||
return olMap;
|
return olMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check select query.
|
||||||
|
*/
|
||||||
private void checkSelectQuery() {
|
private void checkSelectQuery() {
|
||||||
|
|
||||||
GWT.log("Zoom is:" + olMap.getCurrentZoomLevel());
|
GWT.log("Zoom is:" + olMap.getCurrentZoomLevel());
|
||||||
|
@ -171,13 +196,16 @@ public class OLMapManager {
|
||||||
}
|
}
|
||||||
else if(zoomStart!=null && zoomEnd!=null) {
|
else if(zoomStart!=null && zoomEnd!=null) {
|
||||||
|
|
||||||
if(zoomEnd<QUERY_MIN_ZOOM_LEVEL && !olMap.isQueryPointActive()) {
|
if(zoomEnd<QUERY_MIN_ZOOM_LEVEL) {
|
||||||
olMap.hidePopup();
|
layerManagerBus.fireEvent(new ZoomOutOverMinimumEvent(zoomStart, zoomEnd, QUERY_MIN_ZOOM_LEVEL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the drag start.
|
||||||
|
*/
|
||||||
private void setDragStart() {
|
private void setDragStart() {
|
||||||
if (olMap.getCurrentZoomLevel() > QUERY_MIN_ZOOM_LEVEL) {
|
if (olMap.getCurrentZoomLevel() > QUERY_MIN_ZOOM_LEVEL) {
|
||||||
dragStartExtent = olMap.getExtent();
|
dragStartExtent = olMap.getExtent();
|
||||||
|
@ -188,7 +216,7 @@ public class OLMapManager {
|
||||||
/**
|
/**
|
||||||
* To data point query.
|
* To data point query.
|
||||||
*
|
*
|
||||||
* @param coordinate the coordinate
|
* @param extent the extent
|
||||||
* @return the geo query
|
* @return the geo query
|
||||||
*/
|
*/
|
||||||
private GeoQuery toDataBoxQuery(ol.Extent extent) {
|
private GeoQuery toDataBoxQuery(ol.Extent extent) {
|
||||||
|
@ -196,5 +224,22 @@ public class OLMapManager {
|
||||||
return new GeoQuery(extent.getLowerLeftX(), extent.getLowerLeftY(), extent.getUpperRightX(), extent.getUpperRightY(), TYPE.BOX);
|
return new GeoQuery(extent.getLowerLeftX(), extent.getLowerLeftY(), extent.getUpperRightX(), extent.getUpperRightY(), TYPE.BOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is query point active.
|
||||||
|
*
|
||||||
|
* @return true, if is query point active
|
||||||
|
*/
|
||||||
|
public boolean isQueryPointActive() {
|
||||||
|
return olMap.isQueryPointActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide pop info.
|
||||||
|
*/
|
||||||
|
public void hidePopInfo() {
|
||||||
|
olMap.hidePopup();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class ClosedViewDetailsEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
|
public class ClosedViewDetailsEvent extends GwtEvent<ClosedViewDetailsEventHandler> {
|
||||||
|
public static Type<ClosedViewDetailsEventHandler> TYPE = new Type<ClosedViewDetailsEventHandler>();
|
||||||
|
|
||||||
|
public ClosedViewDetailsEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<ClosedViewDetailsEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ClosedViewDetailsEventHandler handler) {
|
||||||
|
handler.onClosed(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface ClosedViewDetailsEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
|
public interface ClosedViewDetailsEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On closed.
|
||||||
|
*
|
||||||
|
* @param closedViewDetailsEvent the closed view details event
|
||||||
|
*/
|
||||||
|
void onClosed(ClosedViewDetailsEvent closedViewDetailsEvent);
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class ZoomOutEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
|
public class ZoomOutOverMinimumEvent extends GwtEvent<ZoomOutOverMinimumEventHandler> {
|
||||||
|
public static Type<ZoomOutOverMinimumEventHandler> TYPE = new Type<ZoomOutOverMinimumEventHandler>();
|
||||||
|
private double startZoom;
|
||||||
|
private double endZoom;
|
||||||
|
private double minimum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new zoom out event.
|
||||||
|
*
|
||||||
|
* @param startZoom the start zoom
|
||||||
|
* @param endZoom the end zoom
|
||||||
|
* @param minimum the minimum
|
||||||
|
*/
|
||||||
|
public ZoomOutOverMinimumEvent(double startZoom, double endZoom, double minimum) {
|
||||||
|
this.startZoom = startZoom;
|
||||||
|
this.endZoom = endZoom;
|
||||||
|
this.minimum = minimum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<ZoomOutOverMinimumEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ZoomOutOverMinimumEventHandler handler) {
|
||||||
|
handler.onZoomOut(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getStartZoom() {
|
||||||
|
return startZoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getEndZoom() {
|
||||||
|
return endZoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getMinimum() {
|
||||||
|
return minimum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface ZoomOutEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
|
public interface ZoomOutOverMinimumEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On zoom out.
|
||||||
|
*
|
||||||
|
* @param zoomOutEvent the zoom out event
|
||||||
|
*/
|
||||||
|
void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent);
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni.ConcessioneView;
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni.ConcessioneView;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaItemRef;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaItemRef;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||||
|
@ -11,6 +12,7 @@ import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
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.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
@ -32,12 +34,15 @@ public class DetailsPanel extends Composite {
|
||||||
|
|
||||||
private RecordDV displayedRecord = null;
|
private RecordDV displayedRecord = null;
|
||||||
|
|
||||||
|
private HandlerManager applicationBus;
|
||||||
|
|
||||||
interface DetailsPanelUiBinder extends UiBinder<Widget, DetailsPanel> {
|
interface DetailsPanelUiBinder extends UiBinder<Widget, DetailsPanel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DetailsPanel() {
|
public DetailsPanel() {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
closeButton.setType(ButtonType.LINK);
|
closeButton.setType(ButtonType.LINK);
|
||||||
closeButton.setIcon(IconType.REMOVE_SIGN);
|
closeButton.setIcon(IconType.REMOVE_SIGN);
|
||||||
|
|
||||||
|
@ -46,9 +51,13 @@ public class DetailsPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
hidePanelDetails();
|
hidePanelDetails();
|
||||||
|
applicationBus.fireEvent(new ClosedViewDetailsEvent());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplicationBus(HandlerManager applicationBus) {
|
||||||
|
this.applicationBus = applicationBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,24 @@ import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class GeonaDataViewMainPanel.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
public class GeonaDataViewMainPanel extends Composite {
|
public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
|
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface GeonaDataViewMainPanelUiBinder.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
*
|
||||||
|
* Nov 19, 2020
|
||||||
|
*/
|
||||||
interface GeonaDataViewMainPanelUiBinder extends UiBinder<Widget, GeonaDataViewMainPanel> {
|
interface GeonaDataViewMainPanelUiBinder extends UiBinder<Widget, GeonaDataViewMainPanel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,13 +65,21 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
private OpenLayerOSM map;
|
private OpenLayerOSM map;
|
||||||
|
|
||||||
private HandlerManager eventBus;
|
private HandlerManager applicationBus;
|
||||||
|
|
||||||
public GeonaDataViewMainPanel(HandlerManager eventBus, int mapHeight) {
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new geona data view main panel.
|
||||||
|
*
|
||||||
|
* @param applicationBus the application bus
|
||||||
|
* @param mapHeight the map height
|
||||||
|
*/
|
||||||
|
public GeonaDataViewMainPanel(HandlerManager applicationBus, int mapHeight) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.eventBus = eventBus;
|
this.applicationBus = applicationBus;
|
||||||
mapPanel = new MapPanel(mapHeight+"px");
|
mapPanel = new MapPanel(mapHeight+"px");
|
||||||
detailsPanel.setHeight(mapHeight+"px");
|
detailsPanel.setHeight(mapHeight+"px");
|
||||||
|
detailsPanel.setApplicationBus(applicationBus);
|
||||||
mainContainerPanel.add(mapPanel);
|
mainContainerPanel.add(mapPanel);
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
dataPointSelection.setIcon(IconType.SCREENSHOT);
|
dataPointSelection.setIcon(IconType.SCREENSHOT);
|
||||||
|
@ -66,20 +88,38 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
removeQuery.setIcon(IconType.REMOVE);
|
removeQuery.setIcon(IconType.REMOVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the panels height.
|
||||||
|
*
|
||||||
|
* @param height the new panels height
|
||||||
|
*/
|
||||||
public void setPanelsHeight(int height) {
|
public void setPanelsHeight(int height) {
|
||||||
String toH = height + "px";
|
String toH = height + "px";
|
||||||
mapPanel.setMapHeight(height);
|
mapPanel.setMapHeight(height);
|
||||||
detailsPanel.setHeight(toH);
|
detailsPanel.setHeight(toH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the map panel.
|
||||||
|
*
|
||||||
|
* @return the map panel
|
||||||
|
*/
|
||||||
public MapPanel getMapPanel() {
|
public MapPanel getMapPanel() {
|
||||||
return mapPanel;
|
return mapPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the map.
|
||||||
|
*
|
||||||
|
* @param map the new map
|
||||||
|
*/
|
||||||
public void setMap(OpenLayerOSM map) {
|
public void setMap(OpenLayerOSM map) {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bind handlers.
|
||||||
|
*/
|
||||||
public void bindHandlers() {
|
public void bindHandlers() {
|
||||||
|
|
||||||
dataPointSelection.addClickHandler(new ClickHandler() {
|
dataPointSelection.addClickHandler(new ClickHandler() {
|
||||||
|
@ -119,16 +159,30 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show as details.
|
||||||
|
*
|
||||||
|
* @param concessioneDV the concessione DV
|
||||||
|
* @param geonaItemRef the geona item ref
|
||||||
|
*/
|
||||||
public void showAsDetails(ConcessioneDV concessioneDV, GeoNaItemRef geonaItemRef) {
|
public void showAsDetails(ConcessioneDV concessioneDV, GeoNaItemRef geonaItemRef) {
|
||||||
detailsPanel.showDetailsFor(concessioneDV, geonaItemRef);
|
detailsPanel.showDetailsFor(concessioneDV, geonaItemRef);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide panel details.
|
||||||
|
*/
|
||||||
public void hidePanelDetails() {
|
public void hidePanelDetails() {
|
||||||
detailsPanel.hidePanelDetails();
|
detailsPanel.hidePanelDetails();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the displyed record.
|
||||||
|
*
|
||||||
|
* @return the displyed record
|
||||||
|
*/
|
||||||
public RecordDV getDisplyedRecord() {
|
public RecordDV getDisplyedRecord() {
|
||||||
return detailsPanel.getDisplayedRecord();
|
return detailsPanel.getDisplayedRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel ui:field="mainHTMLPanel">
|
<g:HTMLPanel ui:field="mainHTMLPanel">
|
||||||
<g:HTMLPanel ui:field="mainContainerPanel">
|
<g:HTMLPanel ui:field="mainContainerPanel">
|
||||||
<g:HTMLPanel ui:field="mainToolBar" addStyleNames="inner-toolbar">
|
<g:HTMLPanel ui:field="mainToolBar"
|
||||||
|
addStyleNames="inner-toolbar">
|
||||||
<b:DropdownButton type="LINK" text="Query">
|
<b:DropdownButton type="LINK" text="Query">
|
||||||
<!-- <b:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
|
<!-- <b:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
|
||||||
<b:NavLink ui:field="dataPointSelection"
|
<b:NavLink ui:field="dataPointSelection"
|
||||||
|
|
|
@ -154,7 +154,28 @@ public class DialogShareableLink extends Composite {
|
||||||
// fieldSetPrivate.setVisible(false);
|
// fieldSetPrivate.setVisible(false);
|
||||||
// fieldPrivateSharing.setVisible(false);
|
// fieldPrivateSharing.setVisible(false);
|
||||||
cgPublicLink.setVisible(true);
|
cgPublicLink.setVisible(true);
|
||||||
fieldSetPrivate.setVisible(true);
|
|
||||||
|
fieldPrivateSharing.setVisible(false);
|
||||||
|
fieldSetPrivate.setVisible(false);
|
||||||
|
|
||||||
|
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
if(result!=null) {
|
||||||
|
fieldPrivateSharing.setVisible(true);
|
||||||
|
fieldSetPrivate.setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
showMessage("", false);
|
showMessage("", false);
|
||||||
|
|
||||||
//alertFilePublicLink.setVisible(true);
|
//alertFilePublicLink.setVisible(true);
|
||||||
|
|
|
@ -60,6 +60,7 @@ public class ImageView extends Composite {
|
||||||
|
|
||||||
expandImage.setType(ButtonType.LINK);
|
expandImage.setType(ButtonType.LINK);
|
||||||
expandImage.setIcon(IconType.RESIZE_FULL);
|
expandImage.setIcon(IconType.RESIZE_FULL);
|
||||||
|
expandImage.setTitle("Open Image in New Browser Window");
|
||||||
|
|
||||||
expandImage.addClickHandler(new ClickHandler() {
|
expandImage.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.Relazio
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
|
import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
|
import com.github.gwtbootstrap.client.ui.ModalFooter;
|
||||||
import com.github.gwtbootstrap.client.ui.PageHeader;
|
import com.github.gwtbootstrap.client.ui.PageHeader;
|
||||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||||
import com.github.gwtbootstrap.client.ui.Thumbnails;
|
import com.github.gwtbootstrap.client.ui.Thumbnails;
|
||||||
|
@ -85,15 +87,17 @@ public class ConcessioneView extends Composite {
|
||||||
private CustomFlexTable customTable = new CustomFlexTable();
|
private CustomFlexTable customTable = new CustomFlexTable();
|
||||||
|
|
||||||
private GeoNaItemRef geonaItemRef;
|
private GeoNaItemRef geonaItemRef;
|
||||||
|
|
||||||
|
private String myLogin;
|
||||||
|
|
||||||
private ConcessioneView() {
|
private ConcessioneView() {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
pageViewDetails.getElement().setId("page-view-details");
|
pageViewDetails.getElement().setId("page-view-details");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConcessioneView(GeoNaItemRef item, ConcessioneDV concessioneDV) {
|
public ConcessioneView(GeoNaItemRef item, ConcessioneDV concDV) {
|
||||||
this();
|
this();
|
||||||
this.concessioneDV = concessioneDV;
|
this.concessioneDV = concDV;
|
||||||
this.geonaItemRef = item;
|
this.geonaItemRef = item;
|
||||||
|
|
||||||
titolo.setText(concessioneDV.getNome());
|
titolo.setText(concessioneDV.getNome());
|
||||||
|
@ -165,6 +169,7 @@ public class ConcessioneView extends Composite {
|
||||||
|
|
||||||
shareButton.setType(ButtonType.LINK);
|
shareButton.setType(ButtonType.LINK);
|
||||||
shareButton.setIcon(IconType.SHARE);
|
shareButton.setIcon(IconType.SHARE);
|
||||||
|
shareButton.setTitle("Get a link to share with...");
|
||||||
|
|
||||||
shareButton.addClickHandler(new ClickHandler() {
|
shareButton.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@ -177,28 +182,55 @@ public class ConcessioneView extends Composite {
|
||||||
|
|
||||||
openButton.setType(ButtonType.LINK);
|
openButton.setType(ButtonType.LINK);
|
||||||
openButton.setIcon(IconType.EXPAND);
|
openButton.setIcon(IconType.EXPAND);
|
||||||
|
openButton.setTitle("Open Details in New Dialog");
|
||||||
|
|
||||||
openButton.addClickHandler(new ClickHandler() {
|
openButton.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
Modal modal = new Modal(false);
|
||||||
|
modal.hide(false);
|
||||||
|
modal.setCloseVisible(true);
|
||||||
|
modal.setWidth(900);
|
||||||
|
modal.setTitle(concessioneDV.getNome());
|
||||||
|
modal.add(new ConcessioneView(geonaItemRef, concessioneDV));
|
||||||
|
ModalFooter modalFooter = new ModalFooter();
|
||||||
|
final Button buttClose = new Button("Close");
|
||||||
|
modalFooter.add(buttClose);
|
||||||
|
|
||||||
|
buttClose.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
modal.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.add(modalFooter);
|
||||||
|
modal.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// sharePanel.add(shareButton);
|
|
||||||
|
|
||||||
concessioniPanel.add(customTable);
|
concessioniPanel.add(customTable);
|
||||||
|
|
||||||
//concessioniPanel.add(new RecordView(concessioneDV));
|
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
||||||
addCentroidMap();
|
|
||||||
addRelazioneDiScavo();
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
myLogin = result;
|
||||||
|
addCentroidMap();
|
||||||
|
addRelazioneDiScavo();
|
||||||
|
addPosizionamentoAreaIndagine();
|
||||||
|
addPiantaFineScavo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
addUploadedImages();
|
addUploadedImages();
|
||||||
addPosizionamentoAreaIndagine();
|
|
||||||
addPiantaFineScavo();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPosizionamentoAreaIndagine() {
|
private void addPosizionamentoAreaIndagine() {
|
||||||
|
@ -212,22 +244,11 @@ public class ConcessioneView extends Composite {
|
||||||
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
||||||
}else {
|
}else {
|
||||||
//I need to be authenticated to show the fields according to POLICY
|
//I need to be authenticated to show the fields according to POLICY
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
if(myLogin!=null) {
|
||||||
|
posizionamentoAreaIndaginePanel.setVisible(true);
|
||||||
@Override
|
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
||||||
public void onSuccess(String result) {
|
}
|
||||||
|
|
||||||
//Authenticated user
|
|
||||||
if(result!=null) {
|
|
||||||
posizionamentoAreaIndaginePanel.setVisible(true);
|
|
||||||
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -247,22 +268,10 @@ public class ConcessioneView extends Composite {
|
||||||
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
||||||
}else {
|
}else {
|
||||||
//I need to be authenticated to show the fields according to POLICY
|
//I need to be authenticated to show the fields according to POLICY
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
if(myLogin!=null) {
|
||||||
|
piantaFineScavoPanel.setVisible(true);
|
||||||
@Override
|
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
||||||
public void onSuccess(String result) {
|
}
|
||||||
|
|
||||||
//Authenticated user
|
|
||||||
if(result!=null) {
|
|
||||||
piantaFineScavoPanel.setVisible(true);
|
|
||||||
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,22 +290,10 @@ public class ConcessioneView extends Composite {
|
||||||
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
||||||
}else {
|
}else {
|
||||||
//I need to be authenticated to show the fields according to POLICY
|
//I need to be authenticated to show the fields according to POLICY
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
if(myLogin!=null) {
|
||||||
|
relazioneScavoPanel.setVisible(true);
|
||||||
@Override
|
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
||||||
public void onSuccess(String result) {
|
}
|
||||||
|
|
||||||
//Authenticated user
|
|
||||||
if(result!=null) {
|
|
||||||
relazioneScavoPanel.setVisible(true);
|
|
||||||
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +302,8 @@ public class ConcessioneView extends Composite {
|
||||||
Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat());
|
Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat());
|
||||||
Coordinate transfCoord = MapUtils.transformCoordiante(coord, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
|
Coordinate transfCoord = MapUtils.transformCoordiante(coord, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
|
||||||
//Coordinate invertedCoordinate = MapUtils.reverseCoordinate(coord);
|
//Coordinate invertedCoordinate = MapUtils.reverseCoordinate(coord);
|
||||||
mapView.addMarker(transfCoord, true);
|
boolean authenticatedUser = myLogin!=null?true:false;
|
||||||
|
mapView.addMarker(transfCoord, authenticatedUser);
|
||||||
mapViewPanel.add(mapView);
|
mapViewPanel.add(mapView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,11 +89,16 @@ body {
|
||||||
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-view-details>h1 {
|
#page-view-details .page-header {
|
||||||
|
margin-bottom: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#page-view-details > h1 {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-view-details>p {
|
#page-view-details > p {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
Loading…
Reference in New Issue