Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@112035 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c2abe7dcae
commit
ed7ec5b114
|
@ -21,6 +21,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredTy
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -115,8 +116,7 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
setHeaderVisible(false);
|
||||
setBodyBorder(false);
|
||||
|
||||
Log.debug("Create GeometryPointPanel(): ["
|
||||
+ trId.toString() + "]");
|
||||
Log.debug("Create GeometryPointPanel(): [" + trId.toString() + "]");
|
||||
|
||||
// Column Propierties
|
||||
ColumnDataPropertiesCombo propsColumnData = GWT
|
||||
|
@ -154,15 +154,14 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
comboLongitude.setEditable(false);
|
||||
comboLongitude.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
//Column Label
|
||||
// Column Label
|
||||
columnLabelField = new TextField();
|
||||
columnLabelField.setValue("Points");
|
||||
FieldLabel columnLab= new FieldLabel(columnLabelField, "Column Label");
|
||||
FieldLabel columnLab = new FieldLabel(columnLabelField, "Column Label");
|
||||
|
||||
// Create
|
||||
createPointButton = new TextButton("Create");
|
||||
createPointButton.setIcon(ResourceBundle.INSTANCE
|
||||
.geometryPoint());
|
||||
createPointButton.setIcon(ResourceBundle.INSTANCE.geometryPoint());
|
||||
createPointButton.setIconAlign(IconAlign.RIGHT);
|
||||
createPointButton.setTitle("Create Point");
|
||||
|
||||
|
@ -184,12 +183,10 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
vl.add(new FieldLabel(comboLongitude, "Longitude"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
|
||||
vl.add(columnLab,
|
||||
new VerticalLayoutData(1, -1));
|
||||
vl.add(columnLab, new VerticalLayoutData(1, -1));
|
||||
|
||||
|
||||
vl.add(createPointButton, new VerticalLayoutData(-1, -1,
|
||||
new Margins(10, 0, 10, 0)));
|
||||
vl.add(createPointButton, new VerticalLayoutData(-1, -1, new Margins(
|
||||
10, 0, 10, 0)));
|
||||
|
||||
add(vl);
|
||||
|
||||
|
@ -250,17 +247,13 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void onGeometryCreatePoint() {
|
||||
ColumnData latitude = comboLatitude.getCurrentValue();
|
||||
if (latitude != null) {
|
||||
ColumnData longitude = comboLongitude.getCurrentValue();
|
||||
if (longitude != null) {
|
||||
String columnLab=columnLabelField.getCurrentValue();
|
||||
if(columnLab!=null && !columnLab.isEmpty()){
|
||||
String columnLab = columnLabelField.getCurrentValue();
|
||||
if (columnLab != null && !columnLab.isEmpty()) {
|
||||
GeometryCreatePointSession geoCreatePointSession = new GeometryCreatePointSession(
|
||||
trId, latitude, longitude, columnLab);
|
||||
callGeometryCreatePoint(geoCreatePointSession);
|
||||
|
@ -350,6 +343,13 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
columns = new ArrayList<ColumnData>();
|
||||
|
||||
for (ColumnData column : result) {
|
||||
ColumnTypeCode columnTypeCode = ColumnTypeCode
|
||||
.getColumnTypeCodeFromId(column
|
||||
.getTypeCode());
|
||||
if (columnTypeCode
|
||||
.compareTo(ColumnTypeCode.ATTRIBUTE) == 0
|
||||
|| columnTypeCode
|
||||
.compareTo(ColumnTypeCode.MEASURE) == 0) {
|
||||
ColumnDataType columnDataType = ColumnDataType
|
||||
.getColumnDataTypeFromId(column
|
||||
.getDataTypeName());
|
||||
|
@ -358,6 +358,9 @@ public class GeometryCreatePointPanel extends FramedPanel implements
|
|||
|| columnDataType
|
||||
.compareTo(ColumnDataType.Numeric) == 0) {
|
||||
columns.add(column);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.RequestPropertiesPara
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.geospatial.GeospatialCoordinatesType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -134,12 +135,8 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
|
||||
updateForCoordinatesType();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void create() {
|
||||
|
||||
setWidth(WIDTH);
|
||||
|
@ -209,12 +206,11 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
comboGsCoordinatesType.setEditable(false);
|
||||
comboGsCoordinatesType.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
|
||||
//Resolution
|
||||
// Resolution
|
||||
resolutionField = new TextField();
|
||||
resolutionField.setValue("0.1");
|
||||
FieldLabel resolutionLabel= new FieldLabel(resolutionField, "Resolution");
|
||||
|
||||
FieldLabel resolutionLabel = new FieldLabel(resolutionField,
|
||||
"Resolution");
|
||||
|
||||
// Has Quadrant
|
||||
hasQuadrantTrue = new Radio();
|
||||
|
@ -236,7 +232,8 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
ValueChangeEvent<HasValue<Boolean>> event) {
|
||||
try {
|
||||
if (hasQuadrantTrue.getValue()) {
|
||||
if(quadrantColumns==null|| quadrantColumns.size()<1){
|
||||
if (quadrantColumns == null
|
||||
|| quadrantColumns.size() < 1) {
|
||||
Log.debug("Attention no Integer column is present in the tabular resource");
|
||||
UtilsGXT3
|
||||
.alert("Attention",
|
||||
|
@ -245,7 +242,6 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
}
|
||||
comboQuadrantLabel.setVisible(true);
|
||||
|
||||
|
||||
} else {
|
||||
comboQuadrantLabel.setVisible(false);
|
||||
}
|
||||
|
@ -314,7 +310,7 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
vl.add(new FieldLabel(comboGsCoordinatesType, "Type"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
|
||||
vl.add(resolutionLabel, new VerticalLayoutData(1,-1));
|
||||
vl.add(resolutionLabel, new VerticalLayoutData(1, -1));
|
||||
|
||||
vl.add(hasQuadrantLabel, new VerticalLayoutData(-1, -1));
|
||||
|
||||
|
@ -327,7 +323,6 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
|
||||
updateForCoordinatesType();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void addHandlersForComboColumnLatitude(
|
||||
|
@ -411,7 +406,7 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
protected void updatedComboGsCoordinatesType(GeospatialCoordinatesType type) {
|
||||
gsCoordinatesType=type;
|
||||
gsCoordinatesType = type;
|
||||
updateForCoordinatesType();
|
||||
|
||||
}
|
||||
|
@ -428,7 +423,7 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
|
||||
break;
|
||||
case OCEAN_AREA:
|
||||
if(quadrantColumns==null|| quadrantColumns.size()<1){
|
||||
if (quadrantColumns == null || quadrantColumns.size() < 1) {
|
||||
hasQuadrantTrue.setValue(false);
|
||||
hasQuadrantFalse.setValue(true);
|
||||
comboQuadrantLabel.setVisible(false);
|
||||
|
@ -457,7 +452,6 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
forceLayout();
|
||||
}
|
||||
|
||||
|
||||
private void addHandlersForComboQuadrant(
|
||||
final LabelProvider<ColumnData> labelProvider) {
|
||||
comboQuadrant.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||
|
@ -498,13 +492,12 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
if (latitude != null) {
|
||||
ColumnData longitude = comboLongitude.getCurrentValue();
|
||||
if (longitude != null) {
|
||||
String resol=resolutionField.getCurrentValue();
|
||||
Double resolution=null;
|
||||
String resol = resolutionField.getCurrentValue();
|
||||
Double resolution = null;
|
||||
try {
|
||||
resolution= new Double(resol);
|
||||
} catch(NumberFormatException e){
|
||||
UtilsGXT3.alert("Attention",
|
||||
"Insert a valid resolution!");
|
||||
resolution = new Double(resol);
|
||||
} catch (NumberFormatException e) {
|
||||
UtilsGXT3.alert("Attention", "Insert a valid resolution!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -512,18 +505,21 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
.getCurrentValue();
|
||||
if (type != null) {
|
||||
GeospatialCreateCoordinatesSession gsCreateCoordinatesSession;
|
||||
switch(type){
|
||||
switch (type) {
|
||||
case C_SQUARE:
|
||||
gsCreateCoordinatesSession = new GeospatialCreateCoordinatesSession(
|
||||
trId, latitude, longitude, type, false, null, resolution);
|
||||
trId, latitude, longitude, type, false, null,
|
||||
resolution);
|
||||
callGeospatialCreateCoordinates(gsCreateCoordinatesSession);
|
||||
break;
|
||||
case OCEAN_AREA:
|
||||
if(hasQuadrant()){
|
||||
ColumnData quadrant = comboQuadrant.getCurrentValue();
|
||||
if(quadrant!=null){
|
||||
if (hasQuadrant()) {
|
||||
ColumnData quadrant = comboQuadrant
|
||||
.getCurrentValue();
|
||||
if (quadrant != null) {
|
||||
gsCreateCoordinatesSession = new GeospatialCreateCoordinatesSession(
|
||||
trId, latitude, longitude, type, true, quadrant,resolution);
|
||||
trId, latitude, longitude, type, true,
|
||||
quadrant, resolution);
|
||||
callGeospatialCreateCoordinates(gsCreateCoordinatesSession);
|
||||
} else {
|
||||
UtilsGXT3.alert("Attention",
|
||||
|
@ -533,11 +529,11 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
|
||||
} else {
|
||||
gsCreateCoordinatesSession = new GeospatialCreateCoordinatesSession(
|
||||
trId, latitude, longitude, type, false, null, resolution);
|
||||
trId, latitude, longitude, type, false,
|
||||
null, resolution);
|
||||
callGeospatialCreateCoordinates(gsCreateCoordinatesSession);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
UtilsGXT3.alert("Attention",
|
||||
|
@ -635,6 +631,14 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
quadrantColumns = new ArrayList<ColumnData>();
|
||||
|
||||
for (ColumnData column : result) {
|
||||
ColumnTypeCode columnTypeCode = ColumnTypeCode
|
||||
.getColumnTypeCodeFromId(column
|
||||
.getTypeCode());
|
||||
if (columnTypeCode
|
||||
.compareTo(ColumnTypeCode.ATTRIBUTE) == 0
|
||||
|| columnTypeCode
|
||||
.compareTo(ColumnTypeCode.MEASURE) == 0) {
|
||||
|
||||
ColumnDataType columnDataType = ColumnDataType
|
||||
.getColumnDataTypeFromId(column
|
||||
.getDataTypeName());
|
||||
|
@ -648,6 +652,7 @@ public class GeospatialCreateCoordinatesPanel extends FramedPanel implements
|
|||
quadrantColumns.add(column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (columns.size() < 1) {
|
||||
|
|
Loading…
Reference in New Issue