Mercurial > dive4elements > river
changeset 4131:360e22afb98b
Cosmetics, warnings and minor TODOs.
line wrap: on
line diff
--- a/flys-client/ChangeLog Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/ChangeLog Mon Oct 15 00:04:35 2012 +0200 @@ -1,3 +1,37 @@ +2012-10-15 Christian Lins <christian.lins@intevation.de> + + * flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java, + flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties, + flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + flys-client/src/main/java/de/intevation/flys/client/client/event/StepBackEvent.java, + flys-client/src/main/java/de/intevation/flys/client/client/event/StepForwardEvent.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/BooleanPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/ContinuePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DistanceOnlyPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleRangePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/IntegerRangePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/LoadingPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java, + flys-client/src/main/java/de/intevation/flys/client/client/ui/MultiPeriodPanel.java: + Squash warnings and TODOs. + 2012-10-14 Christian Lins <christian.lins@intevation.de> * flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Oct 15 00:04:35 2012 +0200 @@ -60,6 +60,8 @@ String warning_no_wsp_selected(); + String warning_cannot_parse_date(); + String no_projects(); String load_projects();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Oct 15 00:04:35 2012 +0200 @@ -330,7 +330,6 @@ error_no_feature_selected = No object selected. error_no_map_config = No Map configuration found. error_no_map_output_type = No Map output found. -warning_use_first_feature = You have more that one object selected. The first one is used. error_no_valid_gfi_url = No valid GetFeatureInfo response found. error_gfi_req_failed = GetFeatureInfo request failed. error_gfi_parsing_failed = Failed to read GetFeatureInfo response. @@ -349,7 +348,9 @@ error_values_needed = You must provide values. error_no_module_found = No modules found +warning_use_first_feature = You have more that one object selected. The first one is used. warning_no_wsp_selected = No waterlevel selected! +warning_cannot_parse_date = Invalid date! ## map related strings digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Oct 15 00:04:35 2012 +0200 @@ -329,7 +329,6 @@ error_no_feature_selected = Kein Objekt ausgew\u00e4hlt. error_no_map_config = Es konnte keine Kartenkonfiguration gefunden werden. error_no_map_output_type = Es konnte kein Ausgabemodus f\u00fcr Karten gefunden werden. -warning_use_first_feature = Sie haben mehr als ein Objekt ausgew\u00e4hlt. Das erste Objekt wird benutzt. error_no_valid_gfi_url = Ung\u00fcltige GetFeatureInfo URL. error_gfi_req_failed = Die GetFeatureInfo Anfrage ist fehlgeschlagen. error_gfi_parsing_failed = Fehler beim Lesen der GetFeatureInfo Antwort. @@ -342,13 +341,15 @@ error_bad_dgm_river = Das gew\u00e4hlte DGM passt nicht zum gew\u00e4hlten Fluss. error_dialog_not_valid = Eine oder mehrere Daten sind nicht korrekt. error_invalid_date = Das eingegebene Datum ist nicht korrekt. -error_same_location = Der gewählte Ort ist der Bezugsort. +error_same_location = Der gew\u00e4hlte Ort ist der Bezugsort. error_contains_same_location = Zielorte beinhalten den Bezugsort. error_update_collection_attribute = Fehler beim Aktualisieren des Collection-Attributs. error_values_needed = Es muss mindestens ein Wert selektiert sein. error_no_module_found = Keine nutzbaren Module gefunden. +warning_use_first_feature = Sie haben mehr als ein Objekt ausgew\u00e4hlt. Das erste Objekt wird benutzt. warning_no_wsp_selected = Kein Wasserstand ausgew\u00e4hlt! +warning_cannot_parse_date = Datum ist ung\u00fcltig! ## map related strings digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Oct 15 00:04:35 2012 +0200 @@ -330,7 +330,6 @@ error_no_feature_selected = No object selected. error_no_map_config = No Map configuration found. error_no_map_output_type = No Map output found. -warning_use_first_feature = You have more that one object selected. The first one is used. error_no_valid_gfi_url = No valid GetFeatureInfo response found. error_gfi_req_failed = GetFeatureInfo request failed. error_gfi_parsing_failed = Failed to read GetFeatureInfo response. @@ -349,7 +348,9 @@ error_values_needed = You must provide values. error_no_module_found = No modules found +warning_use_first_feature = You have more that one object selected. The first one is used. warning_no_wsp_selected = No waterlevel selected! +warning_cannot_parse_date = Date is invalid! ## map related strings digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/event/StepBackEvent.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/event/StepBackEvent.java Mon Oct 15 00:04:35 2012 +0200 @@ -8,6 +8,8 @@ */ public class StepBackEvent implements Serializable { + private static final long serialVersionUID = 7895180143662002198L; + /** The identifier of the target state.*/ protected String target;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/event/StepForwardEvent.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/event/StepForwardEvent.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,15 +1,17 @@ package de.intevation.flys.client.client.event; +import de.intevation.flys.client.shared.model.Data; + import java.io.Serializable; -import de.intevation.flys.client.shared.model.Data; - /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class StepForwardEvent implements Serializable { + private static final long serialVersionUID = -5527511690213770954L; + /** The selected data.*/ protected Data[] data;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,6 +1,7 @@ package de.intevation.flys.client.client.ui; import com.google.gwt.core.client.GWT; + import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Canvas; @@ -38,6 +39,8 @@ implements UIProvider, HasStepForwardHandlers, ClickHandler, HasStepBackHandlers { + private static final long serialVersionUID = -1610874613377494184L; + /** The message class that provides i18n strings.*/ protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AutoIntegerPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -4,21 +4,22 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.form.validator.CustomValidator; import com.smartgwt.client.widgets.form.validator.Validator; -import com.smartgwt.client.widgets.form.validator.CustomValidator; 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.DataList; -import de.intevation.flys.client.client.FLYSConstants; - /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class AutoIntegerPanel extends TextProvider { + private static final long serialVersionUID = -6525461829035465820L; + public static final String FIELD_NAME = "integer_field"; public static final String FIELD_DEFAULT_VALUE = "auto"; @@ -106,8 +107,7 @@ } try { - Integer anInt = Integer.parseInt(v); - + Integer.parseInt(v); return true; } catch (NumberFormatException nfe) {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/BooleanPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/BooleanPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -14,6 +14,8 @@ */ public class BooleanPanel extends TextProvider { + private static final long serialVersionUID = -8448442865635399232L; + public static final String FIELD_NAME = "boolean_field"; public static final int TITLE_WIDTH = 0;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ContinuePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ContinuePanel.java Mon Oct 15 00:04:35 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.widgets.Canvas; @@ -11,12 +8,14 @@ import com.smartgwt.client.widgets.form.fields.events.ClickEvent; import com.smartgwt.client.widgets.form.fields.events.ClickHandler; +import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.client.event.AdvanceHandler; import de.intevation.flys.client.shared.model.ArtifactDescription; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataList; -import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.event.AdvanceHandler; +import java.util.ArrayList; +import java.util.List; /** @@ -24,6 +23,8 @@ */ public class ContinuePanel extends AbstractUIProvider { + private static final long serialVersionUID = -5882814816875137397L; + protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); protected List<AdvanceHandler> advHandlers; @@ -43,6 +44,7 @@ final String[] reachable = desc.getReachableStates(); next.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent e) { fireOnAdvance(reachable[0]); }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,8 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.VLayout; @@ -11,12 +8,17 @@ import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.User; +import java.util.ArrayList; +import java.util.List; + /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public abstract class DatacagePanel extends TextProvider { + private static final long serialVersionUID = 6937994648371673222L; + protected String dataName; protected User user;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -46,6 +46,8 @@ public class DatacageTwinPanel extends TextProvider { + private static final long serialVersionUID = 8906629596491827857L; + protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); protected String dataName;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,48 +1,35 @@ package de.intevation.flys.client.client.ui; -import de.intevation.flys.client.client.event.DatacageHandler; -import de.intevation.flys.client.client.event.DatacageDoubleClickHandler; - import com.google.gwt.core.client.GWT; - import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.types.TreeModelType; import com.smartgwt.client.util.SC; - import com.smartgwt.client.widgets.Button; - +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.grid.HoverCustomizer; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; +import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tree.Tree; import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeNode; -import com.smartgwt.client.types.SelectionStyle; -import com.smartgwt.client.types.TreeModelType; - -import com.smartgwt.client.widgets.layout.VLayout; - -import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.events.ClickEvent; - -import com.smartgwt.client.widgets.grid.ListGridRecord; - -import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; -import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; - -import com.smartgwt.client.widgets.grid.HoverCustomizer; - -import de.intevation.flys.client.shared.model.Artifact; -import de.intevation.flys.client.shared.model.User; -import de.intevation.flys.client.shared.model.ToLoad; - +import de.intevation.flys.client.client.Config; import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.Config; - +import de.intevation.flys.client.client.event.DatacageDoubleClickHandler; +import de.intevation.flys.client.client.event.DatacageHandler; import de.intevation.flys.client.client.services.MetaDataService; import de.intevation.flys.client.client.services.MetaDataServiceAsync; - +import de.intevation.flys.client.shared.model.Artifact; +import de.intevation.flys.client.shared.model.AttrList; +import de.intevation.flys.client.shared.model.DataCageNode; import de.intevation.flys.client.shared.model.DataCageTree; -import de.intevation.flys.client.shared.model.DataCageNode; -import de.intevation.flys.client.shared.model.AttrList; +import de.intevation.flys.client.shared.model.ToLoad; +import de.intevation.flys.client.shared.model.User; import java.util.ArrayList; import java.util.List; @@ -259,7 +246,7 @@ return toLoad; } - ListGridRecord [] selection = treeGrid.getSelection(); + ListGridRecord [] selection = treeGrid.getSelectedRecords(); if (selection != null) { for (ListGridRecord record: selection) { @@ -281,7 +268,7 @@ return new String[] {}; } - ListGridRecord [] selection = treeGrid.getSelection(); + ListGridRecord [] selection = treeGrid.getSelectedRecords(); if (selection == null) { return new String[] {}; @@ -401,11 +388,13 @@ outs, parameters, new AsyncCallback<DataCageTree>() { + @Override public void onFailure(Throwable caught) { GWT.log("Could not load meta data."); SC.warn(caught.getMessage()); } + @Override public void onSuccess(DataCageTree dcTree) { GWT.log("Successfully loaded meta data."); IdGenerator idGenerator = new IdGenerator();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,8 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; - import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; import de.intevation.flys.client.shared.model.DefaultData; @@ -11,9 +8,14 @@ import de.intevation.flys.client.shared.model.ToLoad; import de.intevation.flys.client.shared.model.User; +import java.util.ArrayList; +import java.util.List; + public class DemDatacagePanel extends DatacagePanel { + private static final long serialVersionUID = -2301633938080411687L; + public static final String OUT = "floodmap"; public static final String PARAMETERS = "dem:true";
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -50,6 +50,8 @@ extends SelectProvider implements TabSelectedHandler, VisibilityChangedHandler { + private static final long serialVersionUID = 3529775660871273314L; + protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class); protected FloodMap floodMap; @@ -132,7 +134,7 @@ layout.setAlign(VerticalAlignment.TOP); layout.setHeight(25); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap<String, String> initial = new LinkedHashMap<String, String>(); form = new DynamicForm(); @@ -286,7 +288,6 @@ params.setIsTransparent(!x); WMSOptions opts = new WMSOptions(); - opts.setTransitionEffect("null"); opts.setProjection(proj); opts.setSingleTile(true); opts.setRatio(1);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistanceOnlyPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistanceOnlyPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,14 +1,17 @@ package de.intevation.flys.client.client.ui; -import java.util.List; - 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 java.util.List; + public class DistanceOnlyPanel extends DistancePanel { + private static final long serialVersionUID = -5794138573892656947L; + + public DistanceOnlyPanel() { this("right"); }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,39 +1,42 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.List; -import java.util.LinkedHashMap; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; +import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Criterion; -import com.smartgwt.client.data.AdvancedCriteria; +import com.smartgwt.client.data.Record; +import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.OperatorId; - -import com.smartgwt.client.data.Record; import com.smartgwt.client.util.SC; -import com.smartgwt.client.types.Alignment; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; -import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +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.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import com.smartgwt.client.widgets.grid.events.RecordClickHandler; -import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.tab.TabSet; import com.smartgwt.client.widgets.tab.Tab; +import com.smartgwt.client.widgets.tab.TabSet; +import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; -import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; +import de.intevation.flys.client.client.Config; +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.event.StringFilterEvent; +import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; +import de.intevation.flys.client.client.ui.range.LocationsTable; +import de.intevation.flys.client.client.ui.range.RangeTable; import de.intevation.flys.client.shared.model.ArtifactDescription; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataItem; @@ -41,19 +44,16 @@ import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; -import de.intevation.flys.client.client.Config; -import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; -import de.intevation.flys.client.client.ui.range.RangeTable; -import de.intevation.flys.client.client.ui.range.LocationsTable; -import de.intevation.flys.client.client.event.FilterHandler; -import de.intevation.flys.client.client.event.StringFilterEvent; -import de.intevation.flys.client.client.event.RangeFilterEvent; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; public class DistancePanel extends AbstractUIProvider implements BlurHandler, FilterHandler { + private static final long serialVersionUID = -883142387908664588L; + public static final int DEFAULT_STEP_WIDTH = 100; public static final String FIELD_LOWER = "ld_from"; @@ -93,8 +93,6 @@ @Override public Canvas create(DataList data) { - Data d = data.get(0); - VLayout layout = new VLayout(); layout.setMembersMargin(10); @@ -412,7 +410,7 @@ protected double getDefaultStep() { - return (double) DEFAULT_STEP_WIDTH; + return DEFAULT_STEP_WIDTH; } @@ -442,6 +440,7 @@ url, river, "locations")); distancesTable.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); @@ -459,6 +458,7 @@ }); locationsTable.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); int field = e.getFieldNum(); @@ -511,6 +511,7 @@ filterCriteria.setShowTitle(false); filterCriteria.setWidth(100); filterCriteria.addChangedHandler(new ChangedHandler() { + @Override public void onChanged(ChangedEvent e) { if(e.getValue().toString().equals("range")) { filterRange.setVisible(true); @@ -544,6 +545,7 @@ filterLayout.addMember(filterRange); filterLayout.setHeight(30); tabs.addTabSelectedHandler(new TabSelectedHandler() { + @Override public void onTabSelected(TabSelectedEvent evt) { filterDescription.clear(); filterRange.clear(); @@ -562,6 +564,7 @@ } + @Override public void onFilterCriteriaChanged(StringFilterEvent event) { String search = event.getFilter(); @@ -579,6 +582,7 @@ } + @Override public void onFilterCriteriaChanged(RangeFilterEvent event) { Float from = event.getFrom() - 0.001f; Float to = event.getTo() + 0.001f;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.Map; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; @@ -14,6 +12,8 @@ import de.intevation.flys.client.client.FLYSConstants; +import java.util.Map; + public class DoubleArrayPanel extends DynamicForm { @@ -156,6 +156,7 @@ * * @param item The FormItem. */ + @SuppressWarnings("unchecked") protected boolean validateForm(FormItem item) { if (item instanceof StaticTextItem) { return true; @@ -174,8 +175,9 @@ return valid; } - NumberFormat f = NumberFormat.getDecimalFormat(); - Map errors = getErrors(); + NumberFormat nf = NumberFormat.getDecimalFormat(); + @SuppressWarnings("rawtypes") + Map errors = getErrors(); try { for (String part: parts) { @@ -184,7 +186,7 @@ continue; } - double location = f.parse(part); + nf.parse(part); } errors.remove(item.getFieldName());
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,10 +1,8 @@ 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.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; @@ -20,6 +18,9 @@ import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; +import java.util.ArrayList; +import java.util.List; + /** * This UIProvider creates a panel for location or distance input. * @@ -28,6 +29,9 @@ public class DoubleInputPanel extends AbstractUIProvider { + + private static final long serialVersionUID = 2006773072352563622L; + /** The message class that provides i18n strings. */ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); @@ -40,6 +44,7 @@ } + @Override public Canvas create(DataList list) { VLayout layout = new VLayout(); @@ -120,6 +125,7 @@ * * @return the selected/inserted data. */ + @Override public Data[] getData() { List<Data> data = new ArrayList<Data>();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleRangePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleRangePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.Map; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; @@ -14,6 +12,7 @@ import de.intevation.flys.client.client.FLYSConstants; +import java.util.Map; /** @@ -166,6 +165,7 @@ * * @param item The FormItem. */ + @SuppressWarnings("unchecked") protected boolean validateForm(FormItem item) { if (item instanceof StaticTextItem) { return true; @@ -176,6 +176,7 @@ String v = (String) item.getValue(); NumberFormat f = NumberFormat.getDecimalFormat(); + @SuppressWarnings("rawtypes") Map errors = getErrors(); try { @@ -183,7 +184,7 @@ throw new NumberFormatException("empty"); } - double value = f.parse(v); + f.parse(v); errors.remove(item.getFieldName()); }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -21,7 +21,7 @@ import de.intevation.flys.client.shared.model.RiverInfo; /** - * The GaugePanel is intendet to be used within a SectionStackSection + * The GaugePanel is intended to be used within a SectionStackSection * It extends the VLayout by two methods to show and hide the * section stack section. * @@ -38,8 +38,6 @@ /** The message class that provides i18n strings.*/ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); - private FLYS flys; - protected GaugeOverviewInfoServiceAsync gaugeOverviewInfoService = GWT.create(GaugeOverviewInfoService.class); @@ -86,10 +84,12 @@ */ public void refresh() { gaugeOverviewInfoService.getRiverInfo(this.river, new AsyncCallback<RiverInfo>() { + @Override public void onFailure(Throwable e) { GWT.log("Could not load the river info." + e); } + @Override public void onSuccess(RiverInfo riverinfo) { GWT.log("Loaded river info"); renderGaugeOverviewInfo(riverinfo); @@ -128,6 +128,7 @@ /** * Hide the section stack section. */ + @Override public void hide() { GWT.log("GaugePanel - hide"); this.sectionStack.setHidden(true); @@ -136,6 +137,7 @@ /** * Show the section stack section. */ + @Override public void show() { GWT.log("GaugePanel - show"); this.sectionStack.setHidden(false);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,13 +1,11 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; + import com.smartgwt.client.data.Record; import com.smartgwt.client.types.ListGridFieldType; +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; @@ -31,11 +29,17 @@ import de.intevation.flys.client.shared.model.LongRangeData; import de.intevation.flys.client.shared.model.RangeData; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + /** * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class GaugeTimeRangePanel extends RangePanel { + private static final long serialVersionUID = -157571967010594739L; + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -50,6 +54,7 @@ yearTable.setShowHeaderContextMenu(false); } + @Override public Canvas create(DataList data) { setDataName(data); @@ -89,8 +94,7 @@ public Canvas createOld(DataList dataList) { GWT.log("create old date."); Data data = dataList.get(0); - DataItem[] items = data.getItems(); -GWT.log(data.getClass().toString()); + HLayout layout = new HLayout(); Label label = new Label(dataList.getLabel()); @@ -99,6 +103,8 @@ Date dl = new Date((Long)((LongRangeData)data).getLower()); Date du = new Date((Long)((LongRangeData)data).getUpper()); + + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); Label value = new Label(dtf.format(dl) + " - " + dtf.format(du)); value.setHeight(20); @@ -170,7 +176,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse lower date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -183,7 +189,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse upper date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -195,6 +201,7 @@ long value = Long.valueOf(raw); Date date = new Date(value); + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); return dtf.format(date); @@ -212,6 +219,7 @@ yearTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -238,6 +246,7 @@ addstart.setWidth (20); addstart.setCellIcon(baseUrl + MESSAGES.markerGreen()); addstart.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("start").equals("-1")) { @@ -254,6 +263,7 @@ addend.setWidth (20); addend.setCellIcon(baseUrl + MESSAGES.markerRed()); addend.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("end").equals("-1")) {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/IntegerRangePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/IntegerRangePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -12,6 +12,8 @@ public class IntegerRangePanel extends RangePanel { + private static final long serialVersionUID = -7471199535764887461L; + protected Integer maxLower; protected Integer maxUpper;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java Mon Oct 15 00:04:35 2012 +0200 @@ -30,6 +30,9 @@ public class LinkSelection extends MapSelection { + + private static final long serialVersionUID = -7138270638349711024L; + /** The message class that provides i18n strings.*/ protected FLYSConstants messages = GWT.create(FLYSConstants.class);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LoadingPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LoadingPanel.java Mon Oct 15 00:04:35 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.google.gwt.user.client.Timer; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -30,9 +27,14 @@ import de.intevation.flys.client.shared.model.CalculationMessage; import de.intevation.flys.client.shared.model.DataList; +import java.util.ArrayList; +import java.util.List; + public class LoadingPanel extends Canvas implements HasStepBackHandlers { + private static final long serialVersionUID = -7806425431408987601L; + public static final int UPDATE_INTERVAL = 1000 * 3; public static final DescribeArtifactServiceAsync describe = @@ -197,12 +199,14 @@ final String locale = config.getLocale(); describe.describe(locale, artifact, new AsyncCallback<Artifact>() { + @Override public void onFailure(Throwable t) { GWT.log("Error while DESCRIBE artifact: " + t.getMessage()); startTimer(); } + @Override public void onSuccess(Artifact artifact) { GWT.log("Successfully DESCRIBE artifact.");
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,67 +1,62 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; +import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Criterion; -import com.smartgwt.client.data.AdvancedCriteria; +import com.smartgwt.client.data.Record; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.OperatorId; - 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.events.BlurHandler; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.RadioGroupItem; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; 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.ChangeEvent; import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; -import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; - -import com.smartgwt.client.widgets.form.fields.FormItem; -import com.smartgwt.client.widgets.form.fields.SelectItem; -import com.smartgwt.client.widgets.form.fields.RadioGroupItem; -import com.smartgwt.client.widgets.form.fields.StaticTextItem; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; +import com.smartgwt.client.widgets.grid.CellFormatter; 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.widgets.grid.CellFormatter; -import com.smartgwt.client.widgets.grid.events.RecordClickHandler; +import com.smartgwt.client.widgets.grid.events.CellClickEvent; +import com.smartgwt.client.widgets.grid.events.CellClickHandler; import com.smartgwt.client.widgets.grid.events.RecordClickEvent; -import com.smartgwt.client.widgets.grid.events.CellClickHandler; -import com.smartgwt.client.widgets.grid.events.CellClickEvent; -import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; +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.tab.Tab; +import com.smartgwt.client.widgets.tab.TabSet; import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; +import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; -import com.smartgwt.client.widgets.tab.TabSet; -import com.smartgwt.client.widgets.tab.Tab; -import com.smartgwt.client.data.Record; - -import com.smartgwt.client.types.ListGridFieldType; -import com.smartgwt.client.types.Alignment; - +import de.intevation.flys.client.client.Config; +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.event.StringFilterEvent; +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.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.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; import de.intevation.flys.client.shared.model.DistanceInfoObject; -import de.intevation.flys.client.shared.model.ArtifactDescription; -import de.intevation.flys.client.client.services.DistanceInfoService; -import de.intevation.flys.client.client.services.DistanceInfoServiceAsync; -import de.intevation.flys.client.client.FLYSConstants; -import de.intevation.flys.client.client.Config; -import de.intevation.flys.client.client.event.FilterHandler; -import de.intevation.flys.client.client.event.StringFilterEvent; -import de.intevation.flys.client.client.event.RangeFilterEvent; -import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; /** @@ -73,6 +68,8 @@ extends AbstractUIProvider implements ChangeHandler, BlurHandler, FilterHandler { + private static final long serialVersionUID = -10820092176039372L; + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -183,6 +180,7 @@ * * @return a panel. */ + @Override public Canvas create(DataList data) { VLayout layout = new VLayout(); layout.setMembersMargin(10); @@ -224,6 +222,7 @@ distanceTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -245,6 +244,7 @@ addDistance.setType (ListGridFieldType.ICON); addDistance.setWidth (20); addDistance.addRecordClickHandler (new RecordClickHandler () { + @Override public void onRecordClick (RecordClickEvent e) { if (!isLocationMode ()) { Record r = e.getRecord(); @@ -339,6 +339,7 @@ locationsTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -363,6 +364,7 @@ addLocation.setWidth (20); addLocation.addRecordClickHandler (new RecordClickHandler () { + @Override public void onRecordClick (RecordClickEvent e) { Record record = e.getRecord(); double[] selected; @@ -435,6 +437,7 @@ locationDistanceTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -463,6 +466,7 @@ addto2.setCellIcon(baseUrl + MESSAGES.markerRed()); locationDistanceTable.addCellClickHandler (new CellClickHandler () { + @Override public void onCellClick (CellClickEvent e) { if (e.getColNum() == 0) { Record r = e.getRecord (); @@ -521,6 +525,7 @@ } + @Override public Canvas createOld(DataList dataList) { List<Data> items = dataList.getAll(); @@ -705,6 +710,7 @@ inputTables = new TabSet(); inputTables.addTabSelectedHandler(new TabSelectedHandler() { + @Override public void onTabSelected(TabSelectedEvent evt) { filterDescription.clear(); filterRange.clear(); @@ -746,6 +752,7 @@ filterCriteria.setShowTitle(false); filterCriteria.setWidth(100); filterCriteria.addChangedHandler(new ChangedHandler() { + @Override public void onChanged(ChangedEvent e) { if(e.getValue().toString().equals("range")) { filterRange.setVisible(true); @@ -795,6 +802,7 @@ } + @Override public void onFilterCriteriaChanged(StringFilterEvent event) { String search = event.getFilter(); @@ -815,6 +823,7 @@ } + @Override public void onFilterCriteriaChanged(RangeFilterEvent event) { Float from = event.getFrom() - 0.001f; Float to = event.getTo() + 0.001f; @@ -974,10 +983,11 @@ * * @return the selected/inserted data. */ + @Override public Data[] getData() { List<Data> data = new ArrayList<Data>(); - // XXX If we have entered a value and click right afterwards on the + // If we have entered a value and click right afterwards on the // 'next' button, the BlurEvent is not fired, and the values are not // saved. So, we gonna save those values explicitly. if (isLocationMode()) { @@ -1158,6 +1168,7 @@ * * @param event The click event fired by a RadioButtonGroupItem. */ + @Override public void onChange(ChangeEvent event) { String value = (String) event.getValue(); @@ -1211,6 +1222,7 @@ * @param event The BlurEvent that gives information about the FormItem that * has been modified and its value. */ + @Override public void onBlur(BlurEvent event) { FormItem item = event.getItem(); String field = item.getFieldName(); @@ -1305,11 +1317,11 @@ radio.setVertical(false); radio.setWrap(false); - LinkedHashMap values = new LinkedHashMap(); + LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(); values.put(FIELD_VALUE_LOCATION, MESSAGES.location()); values.put(FIELD_VALUE_DISTANCE, MESSAGES.distance()); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap<String, String> initial = new LinkedHashMap<String, String>(); initial.put(FIELD_MODE, FIELD_VALUE_DISTANCE); radio.setValueMap(values); @@ -1325,7 +1337,6 @@ protected void createDistanceInputPanel() { Config config = Config.getInstance(); String url = config.getServerUrl(); - String locale = config.getLocale (); String river = ""; ArtifactDescription adescr = artifact.getArtifactDescription(); @@ -1355,21 +1366,6 @@ } -/* protected void updateDistanceInfo(DistanceInfoObject[] di) { - int i = 0; - for (DistanceInfoObject dio: di) { - if (dio.getTo() != null) { - distanceTable.addData(new DistanceInfoRecord(dio)); - } - else { - locationsTable.addData(new DistanceInfoRecord(dio)); - locationDistanceTable.addData(new DistanceInfoRecord(dio)); - } - } - return; - }*/ - - protected double getFrom() { return from; }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,34 +1,34 @@ 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.BlurHandler; +import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.events.BlurEvent; -import com.smartgwt.client.widgets.form.fields.FormItem; - +import com.smartgwt.client.widgets.form.fields.events.BlurHandler; +import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.grid.events.RecordClickEvent; - -import com.smartgwt.client.data.Record; - 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 java.util.ArrayList; +import java.util.List; + /** * This UIProvider serves as base for UI Providers to enter a single location (km). */ public abstract class LocationPanel extends AbstractUIProvider { + private static final long serialVersionUID = -5306604428440015046L; + /** A container that will contain the location or the distance panel. */ protected HLayout inputLayout; @@ -106,6 +106,7 @@ * This method creates a Canvas element showing the old Data objects in the * DataList <i>data</i>. */ + @Override public Canvas createOld(DataList dataList) { findDataItemName(dataList); @@ -142,40 +143,18 @@ protected void initDefaults(DataList list) { Data data = list.get(0); - /* - // Compatibility with MinMax- DataItems: - RangeData rangeData = null; - - for (int i = 0, n = list.size(); i < n; i++) { - Data tmp = list.get(i); + DataItem[] items = data.getItems(); + DataItem iMin = getDataItem(items, "min"); + DataItem iMax = getDataItem(items, "max"); - if (tmp instanceof RangeData) { - rangeData = (RangeData) tmp; - } - } - - if (rangeData != null) { - min = Double.parseDouble(rangeData.getDefaultLower().toString()); - max = Double.parseDouble(rangeData.getDefaultUpper().toString()); - // catch ..? + try { + min = Double.parseDouble(iMin.getStringValue()); + max = Double.parseDouble(iMax.getStringValue()); } - */ - - if (false) {} - else { - DataItem[] items = data.getItems(); - DataItem iMin = getDataItem(items, "min"); - DataItem iMax = getDataItem(items, "max"); - - try { - min = Double.parseDouble(iMin.getStringValue()); - max = Double.parseDouble(iMax.getStringValue()); - } - catch (NumberFormatException nfe) { - SC.warn(MSG.error_read_minmax_values()); - min = -Double.MAX_VALUE; - max = Double.MAX_VALUE; - } + catch (NumberFormatException nfe) { + SC.warn(MSG.error_read_minmax_values()); + min = -Double.MAX_VALUE; + max = Double.MAX_VALUE; } DataItem def = data.getDefault(); @@ -186,7 +165,8 @@ setLocationValues(new double[] { d } ); } catch (NumberFormatException nfe) { - // could not parse, dont know what to do else + // could not parse, don't know what else to do + GWT.log("LocationPanel", nfe); } } @@ -220,7 +200,8 @@ locationPanel = new DoubleArrayPanel( MSG.unitLocation(), getLocationValues(), - new BlurHandler(){public void onBlur(BlurEvent be) {}}); + new BlurHandler(){@Override + public void onBlur(BlurEvent be) {}}); // TODO Remove picker references, refactor such that subclasses can // easily use their picker if they want. @@ -284,29 +265,6 @@ } - - /** - * This method returns the selected data. - * - * @return the selected/inserted data. - // TODO we are abstract because of this. Refactor to use DATA_NAME and - // similar fields for ld_mode . - public Data[] getData() { - saveLocationValues(locationPanel); - double[] values = getLocationValues(); - Data[] data = new Data[values.length+1]; - - for (int i = 0; i < values.length; i++) { - data[i] = createDataArray(DATA_ITEM_NAME, - Double.valueOf(values[i]).toString()); - } - data[values.length] = createDataArray("ld_mode", "locations"); - - return data; - } - */ - - /** * Validates and stores all values entered in the location mode. * @@ -362,7 +320,7 @@ Double.parseDouble(record.getAttribute("from")); } catch(NumberFormatException nfe) { - // Is there anything else to do here? + GWT.log("onRecordClick", nfe); } setLocationValues(selected); }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java Mon Oct 15 00:04:35 2012 +0200 @@ -6,7 +6,6 @@ import com.smartgwt.client.widgets.Canvas; 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.DataList; @@ -22,9 +21,6 @@ private static final long serialVersionUID = 1261822454641198692L; - /** The interface that provides the image resources. */ - private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); - protected ModuleSelection moduleSelection; public MapSelection() {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.client.client.ui; -import java.util.LinkedHashMap; - import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -14,6 +12,8 @@ import com.smartgwt.client.widgets.layout.HLayout; 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.ModuleService; import de.intevation.flys.client.client.services.ModuleServiceAsync; import de.intevation.flys.client.shared.model.Data; @@ -23,8 +23,7 @@ import de.intevation.flys.client.shared.model.DefaultDataItem; import de.intevation.flys.client.shared.model.Module; -import de.intevation.flys.client.client.Config; -import de.intevation.flys.client.client.FLYSConstants; +import java.util.LinkedHashMap; /** * The ModuleSelection combines the river selection and the module selection in @@ -36,6 +35,8 @@ */ public class ModuleSelection extends MapSelection { + private static final long serialVersionUID = -5634831815175543328L; + /** The message class that provides i18n strings.*/ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -65,6 +66,7 @@ * * @return the module selection combined with the river selection. */ + @Override public Canvas create(DataList data) { GWT.log("ModuleSelection - create()"); VLayout newLayout = new VLayout(); @@ -100,7 +102,7 @@ } private void setModules() { - LinkedHashMap values = new LinkedHashMap(); + LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(); if (this.modules!= null) { for(Module module : this.modules) { @@ -158,6 +160,7 @@ * * @return the Data that was chosen in this widget. */ + @Override protected Data[] getData() { String module = radio.getValueAsString();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultiPeriodPanel.java Sun Oct 14 14:44:28 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MultiPeriodPanel.java Mon Oct 15 00:04:35 2012 +0200 @@ -1,38 +1,32 @@ package de.intevation.flys.client.client.ui; -import java.util.List; -import java.util.ArrayList; -import java.util.Date; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; -import com.smartgwt.client.data.Record; - +import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; - 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.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.types.ListGridFieldType; - -import com.smartgwt.client.widgets.grid.events.RecordClickEvent; -import com.smartgwt.client.widgets.grid.events.RecordClickHandler; - 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 java.util.ArrayList; +import java.util.Date; +import java.util.List; + /** * This UIProvider creates a panel for location or distance input. * @@ -42,6 +36,8 @@ extends PeriodPanel { + private static final long serialVersionUID = 1811025931934462457L; + protected ListGrid elements; protected String values; @@ -54,6 +50,7 @@ super(startName, endName); } + @Override public Canvas createWidget(DataList data) { HLayout input = new HLayout(); VLayout root = new VLayout(); @@ -63,6 +60,7 @@ elements = new ListGrid(); add.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent ce) { Date f = inputPanel.getFromDate(); Date t = inputPanel.getToDate(); @@ -101,6 +99,7 @@ }}; elements.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks if(!event.getField().getName().equals(removeField.getName())) { @@ -121,6 +120,7 @@ return root; } + @SuppressWarnings("deprecation") @Override public Canvas createOld(DataList dataList) { GWT.log("old............................"); @@ -166,6 +166,7 @@ * * @return the selected/inserted data. */ + @Override public Data[] getData() { List<Data> data = new ArrayList<Data>(); @@ -182,6 +183,7 @@ } + @Override protected boolean saveDateValues() { ListGridRecord[] lgr = elements.getRecords(); if (lgr.length == 0) { @@ -210,6 +212,7 @@ setTo(to); } + @SuppressWarnings("deprecation") public void setFrom(Date from) { this.from = from; setAttribute( @@ -218,6 +221,7 @@ } + @SuppressWarnings("deprecation") public void setTo(Date to) { this.to = to; setAttribute(