implemented the requirements reported in the task #20357

This commit is contained in:
Francesco Mangiacrapa 2020-12-28 17:55:06 +01:00
parent fd4309b516
commit 536e557e19
8 changed files with 29 additions and 20 deletions

View File

@ -24,17 +24,17 @@ public class ModalWindow {
* Instantiates a new modal window. * Instantiates a new modal window.
* *
* @param title the title * @param title the title
* @param toAdd the to add * @param width the width
* @param toReturn the to return * @param maxHeight the max height
*/ */
public ModalWindow(String title) { public ModalWindow(String title, int width, int maxHeight) {
modal = new Modal(false); modal = new Modal(false);
modal.hide(false); modal.hide(false);
modal.setTitle(title); modal.setTitle(title);
modal.setCloseVisible(true); modal.setCloseVisible(true);
modal.setWidth(900); modal.setWidth(width);
modal.setMaxHeigth(600+"px"); modal.setMaxHeigth(maxHeight+"px");
ModalFooter modalFooter = new ModalFooter(); ModalFooter modalFooter = new ModalFooter();
final Button buttClose = new Button("Close"); final Button buttClose = new Button("Close");

View File

@ -56,7 +56,9 @@ public class ImageView extends Composite {
public ImageView(UploadedImageDV imageDV, final boolean showView, final boolean showOpen) { public ImageView(UploadedImageDV imageDV, final boolean showView, final boolean showOpen) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
heading.setText(imageDV.getTitolo()); if(imageDV.getTitolo()!=null && !imageDV.getTitolo().isEmpty()) {
heading.setText(imageDV.getTitolo());
}
paragraph1.setText(imageDV.getDidascalia()); paragraph1.setText(imageDV.getDidascalia());
paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT); paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT);
@ -103,7 +105,7 @@ public class ImageView extends Composite {
if(latest!=null) { if(latest!=null) {
ModalWindow mw = new ModalWindow(StringUtil.ellipsize(imageDV.getTitolo(), 20)); ModalWindow mw = new ModalWindow(StringUtil.ellipsize(imageDV.getDidascalia(), 50), 900, 600);
mw.add(new ImageView(imageDV, false, true)); mw.add(new ImageView(imageDV, false, true));
mw.setCaller(ImageView.this); mw.setCaller(ImageView.this);
//mw.setWidth(900); //mw.setWidth(900);

View File

@ -10,6 +10,10 @@
.float-right { .float-right {
float: right; float: right;
} }
.margin-top-10 {
margin-top: 10px;
}
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<!-- <b:Thumbnail size="4" addStyleNames="{style.max-width-400}" ui:field="thumbnailCont"> --> <!-- <b:Thumbnail size="4" addStyleNames="{style.max-width-400}" ui:field="thumbnailCont"> -->
@ -17,8 +21,8 @@
<b:Button ui:field="openImage" <b:Button ui:field="openImage"
addStyleNames="{style.float-right}" visible="false">Open</b:Button> addStyleNames="{style.float-right}" visible="false">Open</b:Button>
<b:Image ui:field="imageURL" visible="false" /> <b:Image ui:field="imageURL" visible="false" />
<b:Caption> <b:Caption addStyleNames="{style.margin-top-10}">
<b:Heading size="4" ui:field="heading"></b:Heading> <b:Heading size="4" ui:field="heading" visible="false"></b:Heading>
<b:Paragraph ui:field="paragraph1"> <b:Paragraph ui:field="paragraph1">
</b:Paragraph> </b:Paragraph>
<b:Paragraph ui:field="paragraph2" visible="false"> <b:Paragraph ui:field="paragraph2" visible="false">

View File

@ -55,10 +55,12 @@ import ol.OLFactory;
* @param centerTo the center to * @param centerTo the center to
* @param zoom the zoom * @param zoom the zoom
*/ */
public MapView(Coordinate centerTo, int zoom) { public MapView(Coordinate centerTo, int zoom, String internalMapWidth, String internalMapHeight) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
String theMapId = "map"+Random.nextInt(); String theMapId = "map"+Random.nextInt();
theMap.getElement().setId(theMapId); theMap.getElement().setId(theMapId);
theMap.setWidth(internalMapWidth);
theMap.setHeight(internalMapHeight);
Scheduler.get().scheduleDeferred(new ScheduledCommand() { Scheduler.get().scheduleDeferred(new ScheduledCommand() {

View File

@ -3,8 +3,7 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui"> xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style> <ui:style>
.internalMap { .internalMap {
width: 60%; height: 280px;
height: 260px;
display: inline-block; display: inline-block;
margin: 0 auto; margin: 0 auto;
/*float: right;*/ /*float: right;*/
@ -12,6 +11,7 @@
.map-style { .map-style {
width: 100%; width: 100%;
text-align:center; text-align:center;
margin-top: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }
</ui:style> </ui:style>

View File

@ -27,6 +27,7 @@ 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.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.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
@ -202,7 +203,9 @@ public class ConcessioneView extends Composite {
ConcessioneView cv = new ConcessioneView(geonaItemRef, concessioneDV, false, openImageButtonVisible); ConcessioneView cv = new ConcessioneView(geonaItemRef, concessioneDV, false, openImageButtonVisible);
cv.setViewDetailsButtonVisible(false); cv.setViewDetailsButtonVisible(false);
ModalWindow mw = new ModalWindow(concessioneDV.getNome()); int width = Window.getClientWidth()*75/100;
int height = Window.getClientHeight()*70/100;
ModalWindow mw = new ModalWindow(concessioneDV.getNome(), width, height);
mw.add(cv); mw.add(cv);
mw.setCaller(ConcessioneView.this); mw.setCaller(ConcessioneView.this);
//mw.setWidth(900); //mw.setWidth(900);
@ -300,7 +303,7 @@ public class ConcessioneView extends Composite {
private void addCentroidMap() { private void addCentroidMap() {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT); Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857); Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON); MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
if(concessioneDV!=null && concessioneDV.getCentroidLat()!=null && concessioneDV.getCentroidLong()!=null) { if(concessioneDV!=null && concessioneDV.getCentroidLat()!=null && concessioneDV.getCentroidLong()!=null) {
Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat()); Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat());

View File

@ -46,7 +46,7 @@ public class LayerConcessioneView extends Composite {
if(layerDV.getLayerName()!=null && layerDV.getWmsLink()!=null) { if(layerDV.getLayerName()!=null && layerDV.getWmsLink()!=null) {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT); Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857); Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON); MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
mapViewPanel.add(mapView); mapViewPanel.add(mapView);
String mapServerHost = layerDV.getWmsLink().contains("?")? layerDV.getWmsLink().substring(0,layerDV.getWmsLink().indexOf("?")):layerDV.getWmsLink(); String mapServerHost = layerDV.getWmsLink().contains("?")? layerDV.getWmsLink().substring(0,layerDV.getWmsLink().indexOf("?")):layerDV.getWmsLink();

View File

@ -7,13 +7,11 @@
.important { .important {
font-weight: bold; font-weight: bold;
} }
</ui:style> </ui:style>
<g:HTMLPanel addStyleNames="style-layer"> <g:HTMLPanel addStyleNames="style-layer">
<g:HorizontalPanel> <g:VerticalPanel>
<g:HTMLPanel ui:field="mapViewPanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="layerConcessionePanel"></g:HTMLPanel> <g:HTMLPanel ui:field="layerConcessionePanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="mapViewPanel"> </g:VerticalPanel>
</g:HTMLPanel>
</g:HorizontalPanel>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>