" - + wktParameter.getDescription() + "
"); + "" + wktParameter.getDescription() + "
"); descr.addStyleName("workflow-fieldDescription"); } @@ -120,6 +120,16 @@ public class WKTFld extends AbstractFld { } } + private Coordinates getCoordinates() { + Coordinates coordinates = null; + if (wktParameter != null && wktParameter.getCoordinates() != null) { + coordinates = new Coordinates(wktParameter.getCoordinates().getProjection(), + wktParameter.getCoordinates().getX(), wktParameter.getCoordinates().getY(), + wktParameter.getCoordinates().getZoom()); + } + return coordinates; + } + private void drawAGeometry() { SelectAreaDialogEventHandler handler = new SelectAreaDialogEventHandler() { @@ -136,8 +146,7 @@ public class WKTFld extends AbstractFld { showFieldWithSelection(); break; case Failed: - Log.error("Error during area selection: " - + event.getException()); + Log.error("Error during area selection: " + event.getException()); UtilsGXT3.alert("Error", event.getErrorMessage()); break; default: @@ -147,7 +156,9 @@ public class WKTFld extends AbstractFld { } }; - areaSelectionDialog = new AreaSelectionDialog(getGeometryType()); + GeometryType geometryType = getGeometryType(); + Coordinates coordinates = getCoordinates(); + areaSelectionDialog = new AreaSelectionDialog(geometryType, coordinates); areaSelectionDialog.setZIndex(XDOM.getTopZIndex()); areaSelectionDialog.addSelectAreaDialogEventHandler(handler); areaSelectionDialog.show(); @@ -155,8 +166,7 @@ public class WKTFld extends AbstractFld { } private void init() { - selectButton = new TextButton("Draw a " - + wktParameter.getWktGeometryType().getLabel()); + selectButton = new TextButton("Draw a " + wktParameter.getWktGeometryType().getLabel()); selectButton.setIcon(DataMinerManagerPanel.resources.drawGeometry()); selectButton.addSelectHandler(new SelectEvent.SelectHandler() { @@ -166,8 +176,8 @@ public class WKTFld extends AbstractFld { } }); - //selectButton.setToolTip("Draw a " - // + wktParameter.getWktGeometryType().getLabel()); + // selectButton.setToolTip("Draw a " + // + wktParameter.getWktGeometryType().getLabel()); selectButton2 = new TextButton(""); selectButton2.setIcon(DataMinerManagerPanel.resources.folderExplore()); @@ -178,8 +188,8 @@ public class WKTFld extends AbstractFld { drawAGeometry(); } }); - //selectButton2.setToolTip("Select Another " - // + wktParameter.getWktGeometryType().getLabel()); + // selectButton2.setToolTip("Select Another " + // + wktParameter.getWktGeometryType().getLabel()); cancelButton = new TextButton(""); cancelButton.setIcon(DataMinerManagerPanel.resources.cancel());