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