# HG changeset patch # User Sascha L. Teichmann # Date 1327333520 0 # Node ID 03e82be2aabc74f1fd665ee5605097309b0e129a # Parent 98123d34529b796258c422ceac27fd180e938b60 Added UI for "Bezugslinienverfahren" ("W auf freier Strecke"). flys-client/trunk@3751 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 98123d34529b -r 03e82be2aabc flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/ChangeLog Mon Jan 23 15:45:20 2012 +0000 @@ -1,3 +1,14 @@ +2012-01-23 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/client/client/FLYSConstants.java, + src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java: + Added UI for the simple case of the "Bezugslinienverfahren" ("W auf freier Strecke"). + + * src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.properties: + Adjusted i18n. + 2012-01-23 Raimund Renkert Added UI parts and event for filtering distances and locations. diff -r 98123d34529b -r 03e82be2aabc 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 Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Jan 23 15:45:20 2012 +0000 @@ -228,6 +228,8 @@ String unitWNN(); + String wqWFree(); + String wqW(); String wqQ(); diff -r 98123d34529b -r 03e82be2aabc flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Jan 23 15:45:20 2012 +0000 @@ -134,6 +134,7 @@ helperPanelTitle = Input Support wqW = W at Gauge [cm] wqQ = Q [m\u00b3/s] +wqWFree = W free position [m+NHN] wqQGauge = Discharge at Gauge wqSingle = Single values wqRange = Range diff -r 98123d34529b -r 03e82be2aabc flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Jan 23 15:45:20 2012 +0000 @@ -134,6 +134,7 @@ helperPanelTitle = Eingabeunterst\u00fctzung wqW = W am Pegel [cm] wqQ = Q [m\u00b3/s] +wqWFree = W auf freier Strecke [m+NHN] wqQGauge = Kennzeichnender Abfluss am Pegel wqSingle = Einzelwerte wqRange = Wertebereich diff -r 98123d34529b -r 03e82be2aabc flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Jan 23 15:45:20 2012 +0000 @@ -134,6 +134,7 @@ helperPanelTitle = Input Support wqW = W at Gauge [cm] wqQ = Q [m\u00b3/s] +wqWFree = W at free position [m+NHN] wqQGauge = Discharge at Gauge wqSingle = Single values wqRange = Range diff -r 98123d34529b -r 03e82be2aabc flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java Mon Jan 23 11:07:38 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java Mon Jan 23 15:45:20 2012 +0000 @@ -60,6 +60,9 @@ GWT.create(WQInfoService.class); /** The constant field name for choosing w or q mode.*/ + public static final String FIELD_WQ_W_FREE = "WFREE"; + + /** The constant field name for choosing w or q mode.*/ public static final String FIELD_WQ = "wq"; /** The constant field value for W input mode.*/ @@ -421,13 +424,14 @@ return; } - boolean isW = theMode.equals(FIELD_WQ_W); - boolean isFree = Boolean.valueOf(theFree); + boolean isW = theMode.equals(FIELD_WQ_W); + boolean isFree = Boolean.valueOf(theFree); + boolean isWFree = theMode.equals(FIELD_WQ_W_FREE); initUserSingleValues(list, theMode); initUserRangeValues(list, theMode); - if (isW) { + if (isW || isWFree) { modes.setValue(FIELD_WQ, theMode); } else { @@ -643,7 +647,7 @@ protected Canvas createModePanel() { RadioGroupItem wq = new RadioGroupItem(FIELD_WQ); wq.setShowTitle(false); - wq.setVertical(false); + wq.setVertical(true); wq.setWidth(WIDTH_LEFT_UPPER); wq.setWrap(false); @@ -654,6 +658,7 @@ LinkedHashMap wqValues = new LinkedHashMap(); wqValues.put(FIELD_WQ_W, MESSAGE.wqW()); + wqValues.put(FIELD_WQ_W_FREE, MESSAGE.wqWFree()); wqValues.put(FIELD_WQ_Q, MESSAGE.wqQ()); wqValues.put(FIELD_WQ_Q_GAUGE, MESSAGE.wqQGauge()); @@ -699,12 +704,14 @@ else if (isQFree()) { return validateRange(qFreeRangePanel, minQFree, maxQFree); } + else if (isWFree()) { + return validateRange(wRangePanel, minW, maxW); + } else { return validateRange(qRangePanel, minQ, maxQ); } } - protected List validateSingleValues() { if (isWMode()) { return validateSingle(wArrayPanel, minW, maxW); @@ -712,6 +719,9 @@ else if (isQFree()) { return validateSingle(qFreeArrayPanel, minQFree, maxQFree); } + else if (isWFree()) { + return validateSingle(wArrayPanel, minW, maxW); + } else { return validateSingle(qArrayPanel, minQ, maxQ); } @@ -1185,6 +1195,11 @@ return wqMode.equals(FIELD_WQ_Q); } + protected boolean isWFree() { + String wqMode = modes.getValueAsString(FIELD_WQ); + return wqMode.equals(FIELD_WQ_W_FREE); + } + /** * This method changes the lower panel with the input fields depending on @@ -1222,7 +1237,7 @@ protected void updatePanels(String wqMode, String inputMode) { container.removeMembers(container.getMembers()); - if (wqMode.equals(FIELD_WQ_W)) { + if (wqMode.equals(FIELD_WQ_W) || wqMode.equals(FIELD_WQ_W_FREE)) { if (inputMode.equals(FIELD_MODE_SINGLE)) { // Single W mode double[] values = getSingleW();