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.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.ShowDetailsEvent;
|
||||
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.ui.GeonaDataViewMainPanel;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||
|
@ -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.QueryDataEventHandler;
|
||||
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.util.StringUtil;
|
||||
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) {
|
||||
if(fRow==null)
|
||||
return null;
|
||||
|
@ -468,7 +485,6 @@ public class LayerManager {
|
|||
return layerItem;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if is layer visible.
|
||||
*
|
||||
|
@ -479,7 +495,6 @@ public class LayerManager {
|
|||
return olMap.isLayerVisible(layerItem.getName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the ol map.
|
||||
*
|
||||
|
@ -489,6 +504,11 @@ public class LayerManager {
|
|||
this.olMap = olMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer manager bus.
|
||||
*
|
||||
* @return the layer manager bus
|
||||
*/
|
||||
public HandlerManager getLayerManagerBus() {
|
||||
return layerManagerBus;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client;
|
||||
|
||||
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.MapUtils;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||
|
@ -15,6 +16,13 @@ import ol.MapBrowserEvent;
|
|||
import ol.MapEvent;
|
||||
import ol.OLFactory;
|
||||
|
||||
/**
|
||||
* The Class OLMapManager.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 19, 2020
|
||||
*/
|
||||
public class OLMapManager {
|
||||
|
||||
private String targetId;
|
||||
|
@ -26,12 +34,21 @@ public class OLMapManager {
|
|||
private ol.Extent dragEndExtent = null;
|
||||
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) {
|
||||
this.targetId = targetId;
|
||||
this.layerManagerBus = layerManagerBus;
|
||||
instanceOLMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Instance OL map.
|
||||
*/
|
||||
public void instanceOLMap() {
|
||||
|
||||
olMap = new OpenLayerOSM(targetId, layerManagerBus) {
|
||||
|
@ -145,10 +162,18 @@ public class OLMapManager {
|
|||
return select;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the OLOSM map.
|
||||
*
|
||||
* @return the OLOSM map
|
||||
*/
|
||||
public OpenLayerOSM getOLOSMMap() {
|
||||
return olMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check select query.
|
||||
*/
|
||||
private void checkSelectQuery() {
|
||||
|
||||
GWT.log("Zoom is:" + olMap.getCurrentZoomLevel());
|
||||
|
@ -171,13 +196,16 @@ public class OLMapManager {
|
|||
}
|
||||
else if(zoomStart!=null && zoomEnd!=null) {
|
||||
|
||||
if(zoomEnd<QUERY_MIN_ZOOM_LEVEL && !olMap.isQueryPointActive()) {
|
||||
olMap.hidePopup();
|
||||
if(zoomEnd<QUERY_MIN_ZOOM_LEVEL) {
|
||||
layerManagerBus.fireEvent(new ZoomOutOverMinimumEvent(zoomStart, zoomEnd, QUERY_MIN_ZOOM_LEVEL));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the drag start.
|
||||
*/
|
||||
private void setDragStart() {
|
||||
if (olMap.getCurrentZoomLevel() > QUERY_MIN_ZOOM_LEVEL) {
|
||||
dragStartExtent = olMap.getExtent();
|
||||
|
@ -188,7 +216,7 @@ public class OLMapManager {
|
|||
/**
|
||||
* To data point query.
|
||||
*
|
||||
* @param coordinate the coordinate
|
||||
* @param extent the extent
|
||||
* @return the geo query
|
||||
*/
|
||||
private GeoQuery toDataBoxQuery(ol.Extent extent) {
|
||||
|
@ -197,4 +225,21 @@ public class OLMapManager {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
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.shared.GeoNaItemRef;
|
||||
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.event.dom.client.ClickEvent;
|
||||
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.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
|
@ -32,12 +34,15 @@ public class DetailsPanel extends Composite {
|
|||
|
||||
private RecordDV displayedRecord = null;
|
||||
|
||||
private HandlerManager applicationBus;
|
||||
|
||||
interface DetailsPanelUiBinder extends UiBinder<Widget, DetailsPanel> {
|
||||
}
|
||||
|
||||
|
||||
public DetailsPanel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
closeButton.setType(ButtonType.LINK);
|
||||
closeButton.setIcon(IconType.REMOVE_SIGN);
|
||||
|
||||
|
@ -46,9 +51,13 @@ public class DetailsPanel extends Composite {
|
|||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
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.Widget;
|
||||
|
||||
/**
|
||||
* The Class GeonaDataViewMainPanel.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 19, 2020
|
||||
*/
|
||||
public class GeonaDataViewMainPanel extends Composite {
|
||||
|
||||
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> {
|
||||
}
|
||||
|
||||
|
@ -51,13 +65,21 @@ public class GeonaDataViewMainPanel extends Composite {
|
|||
|
||||
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));
|
||||
this.eventBus = eventBus;
|
||||
this.applicationBus = applicationBus;
|
||||
mapPanel = new MapPanel(mapHeight+"px");
|
||||
detailsPanel.setHeight(mapHeight+"px");
|
||||
detailsPanel.setApplicationBus(applicationBus);
|
||||
mainContainerPanel.add(mapPanel);
|
||||
bindHandlers();
|
||||
dataPointSelection.setIcon(IconType.SCREENSHOT);
|
||||
|
@ -66,20 +88,38 @@ public class GeonaDataViewMainPanel extends Composite {
|
|||
removeQuery.setIcon(IconType.REMOVE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the panels height.
|
||||
*
|
||||
* @param height the new panels height
|
||||
*/
|
||||
public void setPanelsHeight(int height) {
|
||||
String toH = height + "px";
|
||||
mapPanel.setMapHeight(height);
|
||||
detailsPanel.setHeight(toH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the map panel.
|
||||
*
|
||||
* @return the map panel
|
||||
*/
|
||||
public MapPanel getMapPanel() {
|
||||
return mapPanel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the map.
|
||||
*
|
||||
* @param map the new map
|
||||
*/
|
||||
public void setMap(OpenLayerOSM map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind handlers.
|
||||
*/
|
||||
public void bindHandlers() {
|
||||
|
||||
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) {
|
||||
detailsPanel.showDetailsFor(concessioneDV, geonaItemRef);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide panel details.
|
||||
*/
|
||||
public void hidePanelDetails() {
|
||||
detailsPanel.hidePanelDetails();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the displyed record.
|
||||
*
|
||||
* @return the displyed record
|
||||
*/
|
||||
public RecordDV getDisplyedRecord() {
|
||||
return detailsPanel.getDisplayedRecord();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
</ui:style>
|
||||
<g:HTMLPanel ui:field="mainHTMLPanel">
|
||||
<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:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
|
||||
<b:NavLink ui:field="dataPointSelection"
|
||||
|
|
|
@ -154,7 +154,28 @@ public class DialogShareableLink extends Composite {
|
|||
// fieldSetPrivate.setVisible(false);
|
||||
// fieldPrivateSharing.setVisible(false);
|
||||
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);
|
||||
|
||||
//alertFilePublicLink.setVisible(true);
|
||||
|
|
|
@ -60,6 +60,7 @@ public class ImageView extends Composite {
|
|||
|
||||
expandImage.setType(ButtonType.LINK);
|
||||
expandImage.setIcon(IconType.RESIZE_FULL);
|
||||
expandImage.setTitle("Open Image in New Browser Window");
|
||||
|
||||
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 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.Paragraph;
|
||||
import com.github.gwtbootstrap.client.ui.Thumbnails;
|
||||
|
@ -86,14 +88,16 @@ public class ConcessioneView extends Composite {
|
|||
|
||||
private GeoNaItemRef geonaItemRef;
|
||||
|
||||
private String myLogin;
|
||||
|
||||
private ConcessioneView() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
pageViewDetails.getElement().setId("page-view-details");
|
||||
}
|
||||
|
||||
public ConcessioneView(GeoNaItemRef item, ConcessioneDV concessioneDV) {
|
||||
public ConcessioneView(GeoNaItemRef item, ConcessioneDV concDV) {
|
||||
this();
|
||||
this.concessioneDV = concessioneDV;
|
||||
this.concessioneDV = concDV;
|
||||
this.geonaItemRef = item;
|
||||
|
||||
titolo.setText(concessioneDV.getNome());
|
||||
|
@ -165,6 +169,7 @@ public class ConcessioneView extends Composite {
|
|||
|
||||
shareButton.setType(ButtonType.LINK);
|
||||
shareButton.setIcon(IconType.SHARE);
|
||||
shareButton.setTitle("Get a link to share with...");
|
||||
|
||||
shareButton.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
@ -177,27 +182,54 @@ public class ConcessioneView extends Composite {
|
|||
|
||||
openButton.setType(ButtonType.LINK);
|
||||
openButton.setIcon(IconType.EXPAND);
|
||||
openButton.setTitle("Open Details in New Dialog");
|
||||
|
||||
openButton.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
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(new RecordView(concessioneDV));
|
||||
addCentroidMap();
|
||||
addRelazioneDiScavo();
|
||||
addUploadedImages();
|
||||
addPosizionamentoAreaIndagine();
|
||||
addPiantaFineScavo();
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
myLogin = result;
|
||||
addCentroidMap();
|
||||
addRelazioneDiScavo();
|
||||
addPosizionamentoAreaIndagine();
|
||||
addPiantaFineScavo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
});
|
||||
|
||||
addUploadedImages();
|
||||
|
||||
}
|
||||
|
||||
|
@ -212,22 +244,11 @@ public class ConcessioneView extends Composite {
|
|||
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
||||
}else {
|
||||
//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);
|
||||
posizionamentoAreaIndaginePanel.add(new LayerConcessioneView(layer));
|
||||
}
|
||||
|
||||
@Override
|
||||
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));
|
||||
}else {
|
||||
//I need to be authenticated to show the fields according to POLICY
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
|
||||
//Authenticated user
|
||||
if(result!=null) {
|
||||
piantaFineScavoPanel.setVisible(true);
|
||||
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
});
|
||||
if(myLogin!=null) {
|
||||
piantaFineScavoPanel.setVisible(true);
|
||||
piantaFineScavoPanel.add(new LayerConcessioneView(layer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -281,22 +290,10 @@ public class ConcessioneView extends Composite {
|
|||
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
||||
}else {
|
||||
//I need to be authenticated to show the fields according to POLICY
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
|
||||
//Authenticated user
|
||||
if(result!=null) {
|
||||
relazioneScavoPanel.setVisible(true);
|
||||
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
});
|
||||
if(myLogin!=null) {
|
||||
relazioneScavoPanel.setVisible(true);
|
||||
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,7 +302,8 @@ public class ConcessioneView extends Composite {
|
|||
Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat());
|
||||
Coordinate transfCoord = MapUtils.transformCoordiante(coord, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
|
||||
//Coordinate invertedCoordinate = MapUtils.reverseCoordinate(coord);
|
||||
mapView.addMarker(transfCoord, true);
|
||||
boolean authenticatedUser = myLogin!=null?true:false;
|
||||
mapView.addMarker(transfCoord, authenticatedUser);
|
||||
mapViewPanel.add(mapView);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,11 +89,16 @@ body {
|
|||
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;
|
||||
}
|
||||
|
||||
#page-view-details>p {
|
||||
#page-view-details > p {
|
||||
font-size: 24px;
|
||||
padding: 10px;
|
||||
color: #999;
|
||||
|
|
Loading…
Reference in New Issue