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.
*
* @param title the title
* @param toAdd the to add
* @param toReturn the to return
* @param width the width
* @param maxHeight the max height
*/
public ModalWindow(String title) {
public ModalWindow(String title, int width, int maxHeight) {
modal = new Modal(false);
modal.hide(false);
modal.setTitle(title);
modal.setCloseVisible(true);
modal.setWidth(900);
modal.setMaxHeigth(600+"px");
modal.setWidth(width);
modal.setMaxHeigth(maxHeight+"px");
ModalFooter modalFooter = new ModalFooter();
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) {
initWidget(uiBinder.createAndBindUi(this));
heading.setText(imageDV.getTitolo());
if(imageDV.getTitolo()!=null && !imageDV.getTitolo().isEmpty()) {
heading.setText(imageDV.getTitolo());
}
paragraph1.setText(imageDV.getDidascalia());
paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT);
@ -103,7 +105,7 @@ public class ImageView extends Composite {
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.setCaller(ImageView.this);
//mw.setWidth(900);

View File

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

View File

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

View File

@ -3,8 +3,7 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.internalMap {
width: 60%;
height: 260px;
height: 280px;
display: inline-block;
margin: 0 auto;
/*float: right;*/
@ -12,6 +11,7 @@
.map-style {
width: 100%;
text-align:center;
margin-top: 10px;
margin-bottom: 20px;
}
</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.uibinder.client.UiBinder;
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.ui.Composite;
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);
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.setCaller(ConcessioneView.this);
//mw.setWidth(900);
@ -300,7 +303,7 @@ public class ConcessioneView extends Composite {
private void addCentroidMap() {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
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) {
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) {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
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);
String mapServerHost = layerDV.getWmsLink().contains("?")? layerDV.getWmsLink().substring(0,layerDV.getWmsLink().indexOf("?")):layerDV.getWmsLink();

View File

@ -7,13 +7,11 @@
.important {
font-weight: bold;
}
</ui:style>
<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="mapViewPanel">
</g:HTMLPanel>
</g:HorizontalPanel>
</g:VerticalPanel>
</g:HTMLPanel>
</ui:UiBinder>