# HG changeset patch # User Christian Lins # Date 1350631797 -7200 # Node ID 03de5c424f953c1d4233cbcfc657b8f6105edb4a # Parent 1755a1bfe5cedb98cd92cc68f006b3fc0c189c59 Fix warnings and minor TODOs in flys-client. diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Fri Oct 19 09:29:57 2012 +0200 @@ -477,7 +477,6 @@ public void onSuccess(Collection collection) { GWT.log("Successfully created a new collection."); final Collection col = collection; - final ProjectList plist = projectList; artifactService.createGaugeDischargeCurveArtifact( col, locale, riv, ref, new AsyncCallback() { diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -76,6 +76,7 @@ this.maxLower = maxLower; } + @Override public Canvas create(DataList data) { setDataName(data); @@ -118,9 +119,7 @@ @Override public Canvas createOld(DataList dataList) { GWT.log("create old date."); - Data data = dataList.get(0); - DataItem[] items = data.getItems(); - + Data data = dataList.get(0); HLayout layout = new HLayout(); Label label = new Label(dataList.getLabel()); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultipleLocationPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,37 +1,33 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; +import com.smartgwt.client.data.Record; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.form.fields.events.BlurEvent; import com.smartgwt.client.widgets.form.fields.events.BlurHandler; -import com.smartgwt.client.widgets.form.fields.events.BlurEvent; - +import com.smartgwt.client.widgets.grid.events.RecordClickEvent; +import com.smartgwt.client.widgets.grid.events.RecordClickHandler; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.grid.events.RecordClickHandler; -import com.smartgwt.client.widgets.grid.events.RecordClickEvent; - -import com.smartgwt.client.data.Record; - +import de.intevation.flys.client.client.Config; +import de.intevation.flys.client.client.services.DistanceInfoService; +import de.intevation.flys.client.client.services.DistanceInfoServiceAsync; +import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; +import de.intevation.flys.client.shared.DoubleUtils; import de.intevation.flys.client.shared.model.ArtifactDescription; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.DistanceInfoObject; -import de.intevation.flys.client.shared.DoubleUtils; import de.intevation.flys.client.shared.model.RangeData; -import de.intevation.flys.client.client.services.DistanceInfoService; -import de.intevation.flys.client.client.services.DistanceInfoServiceAsync; -import de.intevation.flys.client.client.Config; -import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; +import java.util.ArrayList; +import java.util.List; /** @@ -43,6 +39,8 @@ extends LocationPanel implements RecordClickHandler { + private static final long serialVersionUID = -3359966826794082718L; + /** The DistanceInfoService used to retrieve locations about rivers. */ protected DistanceInfoServiceAsync distanceInfoService = GWT.create(DistanceInfoService.class); @@ -113,6 +111,7 @@ * * @param list The DataList container that stores the Data objects. */ + @Override protected void initDefaults(DataList list) { Data data = list.get(0); @@ -163,6 +162,7 @@ } + @Override protected Canvas createWidget(DataList data) { VLayout layout = new VLayout(); inputLayout = new HLayout(); @@ -171,7 +171,8 @@ locationPanel = new DoubleArrayPanel( MSG.unitLocation(), getLocationValues(), - new BlurHandler(){public void onBlur(BlurEvent be) {validate();}}); + new BlurHandler(){@Override + public void onBlur(BlurEvent be) {validate();}}); picker.getLocationTable().setAutoFetchData(true); @@ -249,6 +250,7 @@ * * @return the selected/inserted data in feedable form. */ + @Override public Data[] getData() { saveLocationValues(locationPanel); double[] lValues = getLocationValues(); @@ -314,6 +316,7 @@ * Set the respective km-value in the location value field. * @param e event passed. */ + @Override public void onRecordClick (RecordClickEvent e) { Record record = e.getRecord(); double[] old = getLocationValues(); @@ -324,6 +327,7 @@ } catch(NumberFormatException nfe) { // Is there anything else to do here? + GWT.log(nfe.getMessage()); } // compare reference location and target location. diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/NoInputPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/NoInputPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/NoInputPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -9,6 +9,9 @@ public class NoInputPanel extends AbstractUIProvider { + private static final long serialVersionUID = -8789143404415288132L; + + @Override public Canvas create(DataList data) { return new Canvas(); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Fri Oct 19 09:29:57 2012 +0200 @@ -66,6 +66,8 @@ HasParameterChangeHandler, CollectionChangeHandler, OutputModesChangeHandler, AdvanceHandler { + private static final long serialVersionUID = 5204784727239299980L; + public static final String STYLENAME_OLD_PARAMETERS = "oldParameters"; /** The message class that provides i18n strings.*/ @@ -355,6 +357,8 @@ widget.setContainer(helperPanel); handler.addStepForwardHandler(new StepForwardHandler() { + private static final long serialVersionUID = -6210719844707004860L; + @Override public void onStepForward(StepForwardEvent event) { lockUI(); @@ -366,8 +370,8 @@ String module = moduleItems[0].getStringValue(); String river = riversItems[0].getStringValue(); - if (module == null) { - // TODO throw / show error! + if (module == null || river == null) { + GWT.log("ParameterList.renderNew(): module == null || river == null"); unlockUI(); return; } @@ -387,7 +391,7 @@ public void onFailure(Throwable caught) { unlockUI(); GWT.log("Could not create the new artifact."); - SC.warn(MSG.getString(caught.getMessage())); + SC.warn(FLYS.getExceptionString(MSG, caught)); } @Override diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrix.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrix.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrix.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,19 +1,12 @@ package de.intevation.flys.client.client.ui; -import java.io.Serializable; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.user.client.ui.ClickListener; -import com.smartgwt.client.types.Autofit; import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; @@ -26,6 +19,12 @@ import de.intevation.flys.client.shared.model.IntegerOptionsData; import de.intevation.flys.client.shared.model.StringOptionsData; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Some parameters take the form of on/off options that can also be seen @@ -40,6 +39,9 @@ protected ListGrid listGrid = null; public static class Column implements Serializable { + + private static final long serialVersionUID = -3493426383086860118L; + protected String name; protected Map values; @@ -233,10 +235,10 @@ /** Create Checkbox for column/value. */ protected Canvas createCheckBox(final String colName, final String value) { CheckBox box = new CheckBox(); - box.addClickListener(new ClickListener() { + box.addClickHandler(new ClickHandler() { + @Override - public void onClick(Widget sender) { - CheckBox box = (CheckBox) sender; + public void onClick(ClickEvent event) { Map> selection = getSelection(); List values = selection.get(colName); @@ -259,12 +261,11 @@ if (listGrid == null) { return selected; } - + ListGridRecord[] records = listGrid.getRecords(); for (ListGridRecord record: records) { for (int i = 0, n = columnNames.size(); i < n; i++) { String columnName = columnNames.get(i); - Column col = columns.get(columnName); List chosenItems = selected.get(columnName); if (Boolean.valueOf(record.getAttribute(columnName)) == true) { chosenItems.add(record.getAttribute(columnName + "-value")); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrixPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,12 +1,6 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - import com.google.gwt.core.client.GWT; - import com.google.gwt.user.client.ui.HTML; import com.smartgwt.client.widgets.Canvas; @@ -23,11 +17,18 @@ import de.intevation.flys.client.shared.model.IntegerOptionsData; import de.intevation.flys.client.shared.model.StringOptionsData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Ingo Weinzierl */ public class ParameterMatrixPanel extends AbstractUIProvider { + private static final long serialVersionUID = -5827445025768340371L; + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/PeriodPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/PeriodPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/PeriodPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,25 +1,17 @@ package de.intevation.flys.client.client.ui; import com.google.gwt.core.client.GWT; - -import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; - import com.google.gwt.i18n.client.DateTimeFormat; import com.smartgwt.client.util.SC; - import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; - import com.smartgwt.client.widgets.form.DynamicForm; - import com.smartgwt.client.widgets.form.fields.DateRangeItem; - import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; import de.intevation.flys.client.client.FLYSConstants; - import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DataList; @@ -38,6 +30,8 @@ public class PeriodPanel extends AbstractUIProvider { + private static final long serialVersionUID = -5249560815807538821L; + /** The message class that provides i18n strings. */ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); @@ -59,6 +53,7 @@ } + @Override public Canvas create(DataList list) { VLayout layout = new VLayout(); @@ -152,6 +147,7 @@ * * @return the selected/inserted data. */ + @Override public Data[] getData() { List data = new ArrayList(); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java Fri Oct 19 09:29:57 2012 +0200 @@ -4,6 +4,7 @@ import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.rpc.AsyncCallback; + import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.Autofit; import com.smartgwt.client.types.ListGridEditEvent; @@ -657,8 +658,6 @@ * @param search String to search for in collection names. */ protected void filterCollections(String search) { - int j = 0; - // Clear the collection list. filteredCollections.clear(); @@ -680,7 +679,6 @@ // matches. if (name.contains(search.toLowerCase())) { filteredCollections.add(collections.get(i)); - j++; } } updateGrid(); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,12 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -16,17 +9,22 @@ import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.RadioGroupItem; +import com.smartgwt.client.widgets.form.fields.events.BlurEvent; import com.smartgwt.client.widgets.form.fields.events.BlurHandler; -import com.smartgwt.client.widgets.form.fields.events.BlurEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; -import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet; -import com.smartgwt.client.widgets.tab.Tab; +import de.intevation.flys.client.client.Config; +import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.client.services.WQInfoService; +import de.intevation.flys.client.client.services.WQInfoServiceAsync; +import de.intevation.flys.client.client.ui.wq.QDTable; +import de.intevation.flys.client.client.ui.wq.WTable; +import de.intevation.flys.client.shared.model.ArtifactDescription; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DataList; @@ -35,15 +33,12 @@ import de.intevation.flys.client.shared.model.WQDataItem; import de.intevation.flys.client.shared.model.WQInfoObject; import de.intevation.flys.client.shared.model.WQInfoRecord; -import de.intevation.flys.client.shared.model.ArtifactDescription; - -import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.Config; -import de.intevation.flys.client.client.services.WQInfoService; -import de.intevation.flys.client.client.services.WQInfoServiceAsync; -import de.intevation.flys.client.client.ui.wq.WTable; -import de.intevation.flys.client.client.ui.wq.QDTable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; /** @@ -53,6 +48,9 @@ extends AbstractUIProvider implements ChangeHandler, BlurHandler { + + private static final long serialVersionUID = -8627825064071479905L; + public static final String FIELD_WQ_MODE = "wq_isq"; public static final String FIELD_WQ_Q = "Q"; @@ -98,6 +96,7 @@ /** Create main UI Canvas. */ + @Override public Canvas create(DataList data) { initHelperPanel(); @@ -140,6 +139,7 @@ /** Create display for passive mode. */ + @Override public Canvas createOld(DataList dataList) { List all = dataList.getAll(); Data wqData = getData(all, "ranges"); @@ -304,7 +304,6 @@ if (item instanceof WQDataItem) { WQDataItem wq = (WQDataItem) item; double[] mmQ = wq.getQRange(); - double[] mmW = wq.getWRange(); qranges.put(title, mmQ); } @@ -344,6 +343,7 @@ } + @Override public Data[] getData() { Data values = getWQValues(); @@ -397,11 +397,13 @@ } + @Override public void onChange(ChangeEvent event) { // TODO IMPLEMENT ME } + @Override public void onBlur(BlurEvent event) { DoubleArrayPanel dap = (DoubleArrayPanel) event.getForm(); dap.validateForm(event.getItem()); @@ -420,11 +422,13 @@ wqInfoService.getWQInfo(locale, river, mm[0], mm[0], new AsyncCallback() { + @Override public void onFailure(Throwable caught) { GWT.log("Could not recieve wq informations."); SC.warn(caught.getMessage()); } + @Override public void onSuccess(WQInfoObject[] wqi) { int num = wqi != null ? wqi.length :0; GWT.log("Recieved " + num + " wq informations."); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/RadioPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RadioPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RadioPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,8 +1,7 @@ package de.intevation.flys.client.client.ui; -import java.util.LinkedHashMap; +import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.form.DynamicForm; @@ -16,14 +15,17 @@ import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; +import java.util.LinkedHashMap; + public class RadioPanel extends AbstractUIProvider { + private static final long serialVersionUID = 3357071563224461043L; + protected String dataName; protected DynamicForm form; @Override public Canvas createOld(DataList dataList) { - // TODO Auto-generated method stub Data data = dataList.get(0); DataItem[] items = data.getItems(); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/RangePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RangePanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RangePanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,8 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.smartgwt.client.types.Alignment; @@ -16,11 +13,14 @@ import com.smartgwt.client.widgets.layout.VLayout; import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; +import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.RangeData; +import java.util.ArrayList; +import java.util.List; + /** * An UIProvider for inserting ranges. @@ -29,6 +29,8 @@ */ public abstract class RangePanel extends AbstractUIProvider { + private static final long serialVersionUID = -9213089589150335651L; + public static final String FIELD_LOWER = "field_lower"; public static final String FIELD_UPPER = "field_upper"; @@ -126,8 +128,6 @@ protected RangeData findRangeData(DataList dataList) { - RangeData data = null; - for (int i = 0, n = dataList.size(); i < n; i++) { Data tmp = dataList.get(i); @@ -135,7 +135,6 @@ return (RangeData) tmp; } } - return null; } diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/RangeTableFilter.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RangeTableFilter.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RangeTableFilter.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,9 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.form.DynamicForm; @@ -14,11 +10,15 @@ import com.smartgwt.client.widgets.form.fields.events.KeyUpHandler; import com.smartgwt.client.widgets.layout.HLayout; +import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.event.FilterHandler; import de.intevation.flys.client.client.event.RangeFilterEvent; -import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.utils.DoubleValidator; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * @author Raimund Renkert */ @@ -60,15 +60,17 @@ } + @Override public void onChanged(ChangedEvent event) { // This event handler is to slow... // fireFilterCriteriaChanged(getSearchString()); } + @Override public void onKeyUp(KeyUpEvent event) { DoubleValidator validator = new DoubleValidator(); - Map errors = filterForm.getErrors(); + Map errors = filterForm.getErrors(); if(event.getItem().getValue() != null && !validator.validate(event.getItem(), errors)) { filterForm.setErrors(errors, true); @@ -124,6 +126,7 @@ } + @Override public void clear() { fromField.clearValue(); toField.clearValue(); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,6 +1,7 @@ package de.intevation.flys.client.client.ui; import com.smartgwt.client.widgets.grid.ListGridRecord; + import de.intevation.flys.client.shared.model.Recommendation; @@ -30,6 +31,7 @@ /** Trivial, blocked constructor. */ + @SuppressWarnings("unused") private RecommendationPairRecord() { } diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,9 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; - import com.google.gwt.core.client.GWT; import com.smartgwt.client.types.VerticalAlignment; @@ -14,13 +10,16 @@ import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; +import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; -import de.intevation.flys.client.client.FLYSConstants; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; /** @@ -31,6 +30,8 @@ public class SelectProvider extends AbstractUIProvider { + private static final long serialVersionUID = 4696637534424070726L; + /** The message class that provides i18n strings.*/ protected FLYSConstants messages = GWT.create(FLYSConstants.class); @@ -47,6 +48,7 @@ * * @return a combobox. */ + @Override public Canvas create(DataList data) { VLayout v = new VLayout(); v.setMembersMargin(10); @@ -61,6 +63,7 @@ } + @Override public Canvas createOld(DataList dataList) { HLayout layout = new HLayout(); VLayout vLayout = new VLayout(); @@ -109,7 +112,7 @@ layout.setAlign(VerticalAlignment.TOP); layout.setHeight(25); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap initial = new LinkedHashMap(); form = new DynamicForm(); @@ -166,9 +169,10 @@ } + @Override protected Data[] getData() { - Map values = form.getValues(); - Iterator keys = values.keySet().iterator(); + Map values = form.getValues(); + Iterator keys = values.keySet().iterator(); Data[] list = new Data[values.size()]; int i = 0; diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -3,7 +3,6 @@ import com.google.gwt.i18n.client.NumberFormat; import com.smartgwt.client.data.Record; - import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import de.intevation.flys.client.shared.model.Data; @@ -17,6 +16,9 @@ public class SingleLocationPanel extends MultipleLocationPanel { + private static final long serialVersionUID = -300641333561787454L; + + /** * Creates a new SingleLocationPanel instance. */ @@ -78,6 +80,7 @@ * * @return the selected/inserted data. */ + @Override public Data[] getData() { saveLocationValues(locationPanel); double[] values = getLocationValues(); @@ -101,6 +104,7 @@ * Set the respective km-value in the location value field. * @param e event passed. */ + @Override public void onRecordClick (RecordClickEvent e) { Record record = e.getRecord(); double[] selected = new double[1]; @@ -115,6 +119,7 @@ } + @Override protected String getLabelString() { return MSG.single_location(); } diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,26 +1,24 @@ package de.intevation.flys.client.client.ui; -import java.util.List; - import com.google.gwt.core.client.GWT; +import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.i18n.client.NumberFormat; +import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.widgets.layout.VLayout; +import de.intevation.flys.client.client.Config; +import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.client.services.CSVExportService; +import de.intevation.flys.client.client.services.CSVExportServiceAsync; import de.intevation.flys.client.shared.model.DataList; -import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.Config; - -import de.intevation.flys.client.client.services.CSVExportService; -import de.intevation.flys.client.client.services.CSVExportServiceAsync; +import java.util.List; /** * This UIProvider creates a widget that displays calculated data in a table. @@ -72,11 +70,13 @@ exportService.getCSV(locale, uuid, name, new AsyncCallback>() { + @Override public void onFailure(Throwable caught) { GWT.log("Could not recieve csv."); SC.warn(caught.getMessage()); } + @Override public void onSuccess(List l) { GWT.log("Recieved csv with " + l.size() + " lines."); setData(l); @@ -110,11 +110,11 @@ /** - * This method sets the data to a dynmic table. + * This method sets the data to a dynamic table. * * @param list List if String[] containing the data. */ - public void setData(List list) { + public void setData(List list) { if (list == null || list.size() < 2) { dataTable.setEmptyMessage(MESSAGES.error_no_calc_result()); dataTable.redraw(); @@ -132,8 +132,8 @@ nf = NumberFormat.getFormat("#.##"); } - String[] header = (String[])list.get(0); - String[] firstValues = (String[])list.get(1); + String[] header = list.get(0); + String[] firstValues = list.get(1); ListGridField[] fields = new ListGridField[header.length]; @@ -154,7 +154,7 @@ dataTable.setFields(fields); for(int i = 1; i < list.size(); i++) { - String[] sItem = (String[])list.get(i); + String[] sItem = list.get(i); ListGridRecord r = new ListGridRecord(); for(int j = 0; j < sItem.length; j++) { r.setAttribute(String.valueOf(j), sItem[j]); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/TextProvider.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/TextProvider.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/TextProvider.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,8 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.smartgwt.client.data.DataSource; @@ -18,13 +15,15 @@ import com.smartgwt.client.widgets.form.validator.Validator; import com.smartgwt.client.widgets.layout.HLayout; +import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; -import de.intevation.flys.client.client.FLYSConstants; +import java.util.ArrayList; +import java.util.List; /** @@ -34,6 +33,7 @@ extends AbstractUIProvider implements ItemChangedHandler { + private static final long serialVersionUID = -6868303464989138497L; public static final String FIELD_NAME = "textprovider_inputfield"; public static final int FORM_WIDTH = 400; diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -1,13 +1,10 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.util.BooleanCallback; import com.smartgwt.client.util.SC; -import com.smartgwt.client.util.BooleanCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -20,13 +17,6 @@ import com.smartgwt.client.widgets.menu.events.ClickHandler; import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; -import de.intevation.flys.client.shared.model.Collection; -import de.intevation.flys.client.shared.model.CollectionItemAttribute; -import de.intevation.flys.client.shared.model.FacetRecord; -import de.intevation.flys.client.shared.model.OutputMode; -import de.intevation.flys.client.shared.model.Theme; -import de.intevation.flys.client.shared.model.ThemeList; - import de.intevation.flys.client.client.Config; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.event.HasOutputParameterChangeHandlers; @@ -35,13 +25,22 @@ import de.intevation.flys.client.client.event.OnMoveHandler; import de.intevation.flys.client.client.event.OutputParameterChangeEvent; import de.intevation.flys.client.client.event.OutputParameterChangeHandler; -import de.intevation.flys.client.client.event.RedrawRequestHandler; import de.intevation.flys.client.client.event.RedrawRequestEvent; import de.intevation.flys.client.client.event.RedrawRequestEvent.Type; +import de.intevation.flys.client.client.event.RedrawRequestHandler; import de.intevation.flys.client.client.services.CollectionAttributeService; import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync; import de.intevation.flys.client.client.services.CollectionItemAttributeService; import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync; +import de.intevation.flys.client.shared.model.Collection; +import de.intevation.flys.client.shared.model.CollectionItemAttribute; +import de.intevation.flys.client.shared.model.FacetRecord; +import de.intevation.flys.client.shared.model.OutputMode; +import de.intevation.flys.client.shared.model.Theme; +import de.intevation.flys.client.shared.model.ThemeList; + +import java.util.ArrayList; +import java.util.List; /** * ThemePanel on the left in CollectionView. @@ -93,8 +92,9 @@ this.list = createGrid(); this.view = view; list.addRowContextClickHandler(new RowContextClickHandler() { + @Override public void onRowContextClick(RowContextClickEvent event) { - ListGridRecord[] records = list.getSelection(); + ListGridRecord[] records = list.getSelectedRecords(); Menu menu = null; @@ -164,6 +164,7 @@ * * @param h The new handler. */ + @Override public void addOutputParameterChangeHandler(OutputParameterChangeHandler h){ if (h != null) { outHandlers.add(h); @@ -176,6 +177,7 @@ * * @param h The new handler. */ + @Override public void addRedrawRequestHandler(RedrawRequestHandler h){ if (h != null) { redrawRequestHandlers.add(h); @@ -298,6 +300,7 @@ disable(); updater.update(getCollection(), loc, new AsyncCallback() { + @Override public void onFailure(Throwable caught) { GWT.log("Could not update collection attributes."); SC.warn(MSG.getString(caught.getMessage())); @@ -306,6 +309,7 @@ } + @Override public void onSuccess(Collection collection) { setCollection(collection); @@ -386,6 +390,7 @@ MenuItem properties = new MenuItem(MSG.properties()); properties.addClickHandler(new ClickHandler() { + @Override public void onClick(MenuItemClickEvent evt) { GWT.log("clicked properties"); for (ListGridRecord record: records) { @@ -402,6 +407,7 @@ MenuItem activate = new MenuItem(MSG.activateTheme()); activate.addClickHandler(new ClickHandler() { + @Override public void onClick(MenuItemClickEvent evt) { for (ListGridRecord record: records) { FacetRecord facet = (FacetRecord) record; @@ -420,6 +426,7 @@ MenuItem deactivate = new MenuItem(MSG.deactivateTheme()); deactivate.addClickHandler(new ClickHandler() { + @Override public void onClick(MenuItemClickEvent evt) { for (ListGridRecord record: records) { FacetRecord facet = (FacetRecord) record; @@ -451,6 +458,7 @@ MenuItem remove = new MenuItem(MSG.removeTheme()); remove.addClickHandler(new ClickHandler() { + @Override public void onClick(MenuItemClickEvent evt) { SC.ask(MSG.askThemeRemove(), new BooleanCallback() { @Override @@ -497,7 +505,7 @@ * @param newIdx The index of the theme after it was moved. */ protected void fireThemeMoved(Theme theme, int oldIdx, int newIdx) { - // TODO Implement in subclasses + // Do nothing } @@ -507,7 +515,7 @@ GWT.log("ThemePanel.onMove: " + type); - ListGridRecord[] records = list.getSelection(); + ListGridRecord[] records = list.getSelectedRecords(); if (records == null || records.length == 0) { GWT.log("ThemePanel.onMove: No records selected."); @@ -626,9 +634,11 @@ artifact, locale, new AsyncCallback() { + @Override public void onFailure (Throwable caught) { SC.warn(MSG.getString(caught.getMessage())); } + @Override public void onSuccess(CollectionItemAttribute cia) { GWT.log("Successfully loaded collectionitem attributes."); showStyleEditor(cia, record); diff -r 1755a1bfe5ce -r 03de5c424f95 flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java Fri Oct 19 09:20:52 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java Fri Oct 19 09:29:57 2012 +0200 @@ -2,6 +2,8 @@ public class WaterlevelGroundPanel extends DistancePanel { + private static final long serialVersionUID = 6598703468619862469L; + public static final String FIELD_LOWER = "diff_from"; public static final String FIELD_UPPER = "diff_to"; public static final String FIELD_STEP = "diff_diff";