Fixed Downscale
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@113533 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
373842e983
commit
a31f629556
|
@ -1,50 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.geospatial;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.geospatial.CSquareDownscaleResolution;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author giancarlo
|
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DownscaleCSquare {
|
|
||||||
private int id;
|
|
||||||
private CSquareDownscaleResolution value;
|
|
||||||
|
|
||||||
public DownscaleCSquare() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public DownscaleCSquare(int id, CSquareDownscaleResolution value) {
|
|
||||||
super();
|
|
||||||
this.id = id;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CSquareDownscaleResolution getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(CSquareDownscaleResolution value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel(){
|
|
||||||
return value.getLabel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "DownscaleCSquare [id=" + id + ", value=" + value + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -66,8 +66,8 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
private ComboBox<ColumnData> comboCSquareColumn;
|
private ComboBox<ColumnData> comboCSquareColumn;
|
||||||
private ListStore<ColumnData> storeComboCSquare;
|
private ListStore<ColumnData> storeComboCSquare;
|
||||||
|
|
||||||
private ComboBox<DownscaleCSquare> comboDownscale;
|
private ComboBox<Resolution> comboDownscale;
|
||||||
private ListStore<DownscaleCSquare> storeComboDownscale;
|
private ListStore<Resolution> storeComboDownscale;
|
||||||
private String columnLocalId;
|
private String columnLocalId;
|
||||||
|
|
||||||
public DownscaleCSquarePanel(TRId trId, String columnLocalId,
|
public DownscaleCSquarePanel(TRId trId, String columnLocalId,
|
||||||
|
@ -101,7 +101,7 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
|
|
||||||
|
|
||||||
storeComboDownscale.clear();
|
storeComboDownscale.clear();
|
||||||
storeComboDownscale.addAll(DownscaleCSquareStore.getStoreDownscaleCSquare());
|
storeComboDownscale.addAll(ResolutionStore.getStoreCSquareResolution());
|
||||||
storeComboDownscale.commitChanges();
|
storeComboDownscale.commitChanges();
|
||||||
comboDownscale.reset();
|
comboDownscale.reset();
|
||||||
comboDownscale.clear();
|
comboDownscale.clear();
|
||||||
|
@ -141,18 +141,18 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
comboCSquareColumn.setTriggerAction(TriggerAction.ALL);
|
comboCSquareColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
// Downscale combo
|
// Downscale combo
|
||||||
DownscaleCSquarePropertiesCombo propsDownscale = GWT
|
ResolutionPropertiesCombo propsDownscale = GWT
|
||||||
.create(DownscaleCSquarePropertiesCombo.class);
|
.create(ResolutionPropertiesCombo.class);
|
||||||
|
|
||||||
|
|
||||||
storeComboDownscale = new ListStore<DownscaleCSquare>(propsDownscale.id());
|
storeComboDownscale = new ListStore<Resolution>(propsDownscale.id());
|
||||||
storeComboDownscale.addAll(DownscaleCSquareStore.getStoreDownscaleCSquare());
|
storeComboDownscale.addAll(ResolutionStore.getStoreCSquareResolution());
|
||||||
|
|
||||||
comboDownscale = new ComboBox<DownscaleCSquare>(storeComboDownscale,
|
comboDownscale = new ComboBox<Resolution>(storeComboDownscale,
|
||||||
propsDownscale.label());
|
propsDownscale.value());
|
||||||
Log.trace("Combo Downscale created");
|
Log.trace("Combo Downscale created");
|
||||||
|
|
||||||
addHandlersForComboDownscale(propsDownscale.label());
|
addHandlersForComboDownscale(propsDownscale.value());
|
||||||
|
|
||||||
comboDownscale.setEmptyText("Select a resolution...");
|
comboDownscale.setEmptyText("Select a resolution...");
|
||||||
comboDownscale.setWidth(191);
|
comboDownscale.setWidth(191);
|
||||||
|
@ -249,11 +249,11 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addHandlersForComboDownscale(
|
private void addHandlersForComboDownscale(
|
||||||
final LabelProvider<DownscaleCSquare> labelProvider) {
|
final LabelProvider<Resolution> labelProvider) {
|
||||||
comboDownscale.addSelectionHandler(new SelectionHandler<DownscaleCSquare>() {
|
comboDownscale.addSelectionHandler(new SelectionHandler<Resolution>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<DownscaleCSquare> event) {
|
public void onSelection(SelectionEvent<Resolution> event) {
|
||||||
Info.display(
|
Info.display(
|
||||||
"Resolution Selected",
|
"Resolution Selected",
|
||||||
"You selected "
|
"You selected "
|
||||||
|
@ -261,7 +261,7 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
: labelProvider.getLabel(event
|
: labelProvider.getLabel(event
|
||||||
.getSelectedItem()) + "!"));
|
.getSelectedItem()) + "!"));
|
||||||
Log.debug("Resolution selected: " + event.getSelectedItem());
|
Log.debug("Resolution selected: " + event.getSelectedItem());
|
||||||
DownscaleCSquare resolution = event.getSelectedItem();
|
Resolution resolution = event.getSelectedItem();
|
||||||
updatedResolution(resolution);
|
updatedResolution(resolution);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updatedResolution(DownscaleCSquare resolution) {
|
protected void updatedResolution(Resolution resolution) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -278,10 +278,10 @@ public class DownscaleCSquarePanel extends FramedPanel implements
|
||||||
protected void onGeometryCreatePoint() {
|
protected void onGeometryCreatePoint() {
|
||||||
ColumnData csquareColumn = comboCSquareColumn.getCurrentValue();
|
ColumnData csquareColumn = comboCSquareColumn.getCurrentValue();
|
||||||
if (csquareColumn != null) {
|
if (csquareColumn != null) {
|
||||||
DownscaleCSquare downscale = comboDownscale.getCurrentValue();
|
Resolution downscale = comboDownscale.getCurrentValue();
|
||||||
if (downscale != null) {
|
if (downscale != null) {
|
||||||
GeospatialDownscaleCSquareSession geospatialDownscaleCSquareSession = new GeospatialDownscaleCSquareSession (
|
GeospatialDownscaleCSquareSession geospatialDownscaleCSquareSession = new GeospatialDownscaleCSquareSession (
|
||||||
trId, csquareColumn, downscale.getValue());
|
trId, csquareColumn, downscale.getStringValue());
|
||||||
callGeospatialDownscaleCSquare(geospatialDownscaleCSquareSession);
|
callGeospatialDownscaleCSquare(geospatialDownscaleCSquareSession);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.geospatial;
|
|
||||||
|
|
||||||
import com.google.gwt.editor.client.Editor.Path;
|
|
||||||
import com.sencha.gxt.data.shared.LabelProvider;
|
|
||||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
|
||||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author giancarlo
|
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface DownscaleCSquarePropertiesCombo extends PropertyAccess<DownscaleCSquare> {
|
|
||||||
|
|
||||||
@Path("id")
|
|
||||||
ModelKeyProvider<DownscaleCSquare> id();
|
|
||||||
|
|
||||||
LabelProvider<DownscaleCSquare> label();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.geospatial;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.geospatial.CSquareDownscaleResolution;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author giancarlo
|
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DownscaleCSquareStore implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 6520001942214730827L;
|
|
||||||
|
|
||||||
private static ArrayList<DownscaleCSquare> storeDownscaleCSquare;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DownscaleCSquare> getStoreDownscaleCSquare() {
|
|
||||||
storeDownscaleCSquare=new ArrayList<DownscaleCSquare>();
|
|
||||||
|
|
||||||
int i=1;
|
|
||||||
for(CSquareDownscaleResolution resolution:CSquareDownscaleResolution.getList()){
|
|
||||||
DownscaleCSquare downscale=new DownscaleCSquare(i, resolution);
|
|
||||||
storeDownscaleCSquare.add(downscale);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return storeDownscaleCSquare;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -9,14 +9,16 @@ package org.gcube.portlets.user.td.tablewidget.client.geospatial;
|
||||||
public class Resolution {
|
public class Resolution {
|
||||||
private int id;
|
private int id;
|
||||||
private Double value;
|
private Double value;
|
||||||
|
private String stringValue;
|
||||||
|
|
||||||
public Resolution() {
|
public Resolution() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resolution(int id, Double value) {
|
public Resolution(int id, Double value, String stringValue) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.stringValue=stringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -34,10 +36,21 @@ public class Resolution {
|
||||||
public void setValue(Double value) {
|
public void setValue(Double value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStringValue() {
|
||||||
|
return stringValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStringValue(String stringValue) {
|
||||||
|
this.stringValue = stringValue;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Resolution [id=" + id + ", value=" + value + "]";
|
return "Resolution [id=" + id + ", value=" + value + ", stringValue="
|
||||||
|
+ stringValue + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,15 +19,15 @@ public class ResolutionStore implements Serializable {
|
||||||
private static ArrayList<Resolution> storeCSquareResolution;
|
private static ArrayList<Resolution> storeCSquareResolution;
|
||||||
private static ArrayList<Resolution> storeOcenaAreaResolution;
|
private static ArrayList<Resolution> storeOcenaAreaResolution;
|
||||||
|
|
||||||
private static Resolution resolutionCSquare1=new Resolution(1, 0.1d);
|
private static Resolution resolutionCSquare1=new Resolution(1, 0.1d,"0.1");
|
||||||
private static Resolution resolutionCSquare2=new Resolution(2, 0.5d);
|
private static Resolution resolutionCSquare2=new Resolution(2, 0.5d,"0.5");
|
||||||
private static Resolution resolutionCSquare3=new Resolution(3, 1.0d);
|
private static Resolution resolutionCSquare3=new Resolution(3, 1.0d,"1");
|
||||||
private static Resolution resolutionCSquare4=new Resolution(4, 5.0d);
|
private static Resolution resolutionCSquare4=new Resolution(4, 5.0d,"5");
|
||||||
private static Resolution resolutionCSquare5=new Resolution(5, 10.0d);
|
private static Resolution resolutionCSquare5=new Resolution(5, 10.0d,"10");
|
||||||
|
|
||||||
private static Resolution resolutionOceanArea1=new Resolution(1, 1.0d);
|
private static Resolution resolutionOceanArea1=new Resolution(1, 1.0d,"1");
|
||||||
private static Resolution resolutionOceanArea2=new Resolution(2, 5.0d);
|
private static Resolution resolutionOceanArea2=new Resolution(2, 5.0d,"5");
|
||||||
private static Resolution resolutionOceanArea3=new Resolution(3, 10.0d);
|
private static Resolution resolutionOceanArea3=new Resolution(3, 10.0d,"10");
|
||||||
|
|
||||||
public static ArrayList<Resolution> getStoreCSquareResolution() {
|
public static ArrayList<Resolution> getStoreCSquareResolution() {
|
||||||
storeCSquareResolution=new ArrayList<Resolution>();
|
storeCSquareResolution=new ArrayList<Resolution>();
|
||||||
|
|
Loading…
Reference in New Issue