[PATCH 1 of 3] Remove indirections internally

Wald Commits scm-commit at wald.intevation.org
Thu Dec 10 14:42:47 CET 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1449754712 -3600
# Node ID d793caaf5b5e2d0eb7f4b72630cec85bfff808d1
# Parent  d199860fb087f042fdf1bb042c9cceadf5207e29
Remove indirections internally.

diff -r d199860fb087 -r d793caaf5b5e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java	Tue Dec 08 20:44:18 2015 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java	Thu Dec 10 14:38:32 2015 +0100
@@ -63,11 +63,11 @@
 
     private static final long serialVersionUID = -883142387908664588L;
 
-    public static final int DEFAULT_STEP_WIDTH = 100;
+    private static final int DEFAULT_STEP_WIDTH = 100;
 
-    public static final String FIELD_LOWER = "ld_from";
-    public static final String FIELD_UPPER = "ld_to";
-    public static final String FIELD_STEP  = "ld_step";
+    private static final String FIELD_LOWER = "ld_from";
+    private static final String FIELD_UPPER = "ld_to";
+    private static final String FIELD_STEP  = "ld_step";
 
 
     protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
@@ -149,9 +149,9 @@
     protected String getOldSelectionString(DataList dataList) {
         List<Data> items = dataList.getAll();
 
-        Data dFrom = getData(items, getLowerField());
-        Data dTo   = getData(items, getUpperField());
-        Data dStep = getData(items, getStepField());
+        Data dFrom = getData(items, FIELD_LOWER);
+        Data dTo   = getData(items, FIELD_UPPER);
+        Data dStep = getData(items, FIELD_STEP);
 
         DataItem[] from = dFrom.getItems();
         DataItem[] to   = dTo.getItems();
@@ -301,7 +301,7 @@
 
     protected Data getDataFrom() {
         String value = String.valueOf(distancePanel.getFrom());
-        String field = getLowerField();
+        String field = FIELD_LOWER;
 
         DataItem item = new DefaultDataItem(field, field, value);
         return new DefaultData(
@@ -311,7 +311,7 @@
 
     protected Data getDataTo() {
         String value = String.valueOf(distancePanel.getTo());
-        String field = getUpperField();
+        String field = FIELD_UPPER;
 
         DataItem item = new DefaultDataItem(field, field, value);
         return new DefaultData(
@@ -321,7 +321,7 @@
 
     protected Data getDataStep() {
         String value = String.valueOf(distancePanel.getStep());
-        String field = getStepField();
+        String field = FIELD_STEP;
 
         DataItem item = new DefaultDataItem(field, field, value);
         return new DefaultData(
@@ -336,8 +336,8 @@
 
 
     protected void initMinMaxValues(DataList data) {
-        Data f = getData(data.getAll(), getLowerField());
-        Data t = getData(data.getAll(), getUpperField());
+        Data f = getData(data.getAll(), FIELD_LOWER);
+        Data t = getData(data.getAll(), FIELD_UPPER);
 
         DataItem[] fItems = f.getItems();
         DataItem[] tItems = t.getItems();
@@ -361,7 +361,7 @@
 
 
     protected void initDefaultFrom(DataList data) {
-        Data f = getData(data.getAll(), getLowerField());
+        Data f = getData(data.getAll(), FIELD_LOWER);
 
         double from = getDefaultFrom();
 
@@ -382,7 +382,7 @@
 
 
     protected void initDefaultTo(DataList data) {
-        Data t = getData(data.getAll(), getUpperField());
+        Data t = getData(data.getAll(), FIELD_UPPER);
 
         double to = getDefaultTo();
 
@@ -403,9 +403,9 @@
 
 
     protected void initDefaultStep(DataList data) {
-        Data s = getData(data.getAll(), getStepField());
+        Data s = getData(data.getAll(), FIELD_STEP);
 
-        double step = getDefaultStep();
+        double step = DEFAULT_STEP_WIDTH;
 
         try {
             step = getDefaultValue(s);


More information about the Dive4Elements-commits mailing list