Mercurial > dive4elements > river
changeset 793:4497d19c22fd
Finished the panel to enter waterlevel/ground information (from, to, diff).
flys-client/trunk@2301 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 07 Jul 2011 14:12:21 +0000 |
parents | 696e3404e991 |
children | 40269a176cd2 |
files | flys-client/ChangeLog 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/ui/DistancePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java |
diffstat | 7 files changed, 172 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/ChangeLog Thu Jul 07 14:12:21 2011 +0000 @@ -1,3 +1,20 @@ +2011-07-07 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java: + Refactored getting labels out to own methods which enables subclasses to + changed them. + + * src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java: + Override methods of DistancePanel to support own labels for this panel. + In addition, this panel has no distance/locations table as the + DistancePanel has. + + * src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + 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.java: Added + new strings for the distance panel and the waterlevel/ground panel. + 2011-07-07 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/ui/BooleanPanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Thu Jul 07 14:12:21 2011 +0000 @@ -118,6 +118,30 @@ String unitTo(); + String dpLabelFrom(); + + String dpUnitFrom(); + + String dpLabelTo(); + + String dpUnitTo(); + + String dpLabelStep(); + + String dpUnitStep(); + + String wgLabelFrom(); + + String wgUnitFrom(); + + String wgLabelTo(); + + String wgUnitTo(); + + String wgLabelStep(); + + String wgUnitStep(); + String unitWidth(); String unitFromInM();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Thu Jul 07 14:12:21 2011 +0000 @@ -43,6 +43,21 @@ unitFrom = km unitTo = km a unitWidth = m + +dpLabelFrom = From +dpUnitFrom = km +dpLabelTo = To +dpUnitTo = km +dpLabelStep = a +dpUnitStep = m + +wgLabelFrom = From +wgUnitFrom = m +wgLabelTo = To +wgUnitTo = m +wgLabelStep = a +wgUnitStep = m + unitFromInM = From [m]: unitToInM = To [m]: unitDiffInM = Diff [m]:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Thu Jul 07 14:12:21 2011 +0000 @@ -43,6 +43,21 @@ unitFrom = km - unitTo = km a unitWidth = m + +dpLabelFrom = Von +dpUnitFrom = km +dpLabelTo = Bis +dpUnitTo = km +dpLabelStep = a +dpUnitStep = m + +wgLabelFrom = Von +wgUnitFrom = m +wgLabelTo = Bis +wgUnitTo = m +wgLabelStep = a +wgUnitStep = m + unitFromInM = Von [m]: unitToInM = Bis [m]: unitDiffInM = Diff [m]:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Thu Jul 07 14:12:21 2011 +0000 @@ -43,6 +43,21 @@ unitFrom = km unitTo = km a unitWidth = m + +dpLabelFrom = From +dpUnitFrom = km +dpLabelTo = To +dpUnitTo = km +dpLabelStep = a +dpUnitStep = m + +wgLabelFrom = From +wgUnitFrom = m +wgLabelTo = To +wgUnitTo = m +wgLabelStep = a +wgUnitStep = m + unitLocation = km wrongFormat = Wrong format description = Description
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java Thu Jul 07 14:12:21 2011 +0000 @@ -61,10 +61,8 @@ public DistancePanel(String labelOrientation) { - distancesTable = new RangeTable(); - locationsTable = new LocationsTable(); distancePanel = new DoubleRangePanel( - getLabelFrom(), getLabelTo(), getLabelStep(), + labelFrom(), labelTo(), labelStep(), 0d, 0d, 0d, 250, this, labelOrientation); } @@ -130,28 +128,58 @@ StringBuilder sb = new StringBuilder(); sb.append(from[0].getLabel()); - sb.append(" " + getLabelFrom() + " "); + sb.append(" " + getUnitFrom() + " - "); sb.append(to[0].getLabel()); - sb.append(" " + getLabelTo() + " "); + sb.append(" " + getUnitTo() + " - "); sb.append(step[0].getLabel()); - sb.append(" " + getLabelStep()); + sb.append(" " + getUnitStep()); return sb.toString(); } + protected String labelFrom() { + return getLabelFrom() + " [" + getUnitFrom() + "]"; + } + + protected String getLabelFrom() { - return MSG.unitFrom(); + return MSG.dpLabelFrom(); + } + + + protected String getUnitFrom() { + return MSG.dpUnitFrom(); + } + + + protected String labelTo() { + return getLabelTo() + " [" + getUnitTo() + "]"; } protected String getLabelTo() { - return MSG.unitTo(); + return MSG.dpLabelTo(); + } + + + protected String getUnitTo() { + return MSG.dpUnitTo(); + } + + + protected String labelStep() { + return getLabelStep() + " [" + getUnitStep() + "]"; } protected String getLabelStep() { - return MSG.unitWidth(); + return MSG.dpLabelStep(); + } + + + protected String getUnitStep() { + return MSG.dpUnitStep(); } @@ -366,6 +394,9 @@ protected void initHelperPanel() { + distancesTable = new RangeTable(); + locationsTable = new LocationsTable(); + Config config = Config.getInstance(); String url = config.getServerUrl(); String river = getRiverName();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java Thu Jul 07 12:10:50 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WaterlevelGroundPanel.java Thu Jul 07 14:12:21 2011 +0000 @@ -31,20 +31,56 @@ @Override + protected String labelFrom() { + return getLabelFrom() + " [" + getUnitFrom() + "]"; + } + + + @Override protected String getLabelFrom() { - return MSG.unitFromInM(); + return MSG.wgLabelFrom(); + } + + + @Override + protected String getUnitFrom() { + return MSG.wgUnitFrom(); + } + + + @Override + protected String labelTo() { + return getLabelTo() + " [" + getUnitTo() + "]"; } @Override protected String getLabelTo() { - return MSG.unitToInM(); + return MSG.wgLabelTo(); + } + + + @Override + protected String getUnitTo() { + return MSG.wgUnitTo(); + } + + + @Override + protected String labelStep() { + return getLabelStep() + " [" + getUnitStep() + "]"; } @Override protected String getLabelStep() { - return MSG.unitDiffInM(); + return MSG.wgLabelStep(); + } + + + @Override + protected String getUnitStep() { + return MSG.wgUnitStep(); } @@ -64,5 +100,12 @@ protected double getDefaultStep() { return 0; } + + + @Override + protected void initHelperPanel() { + // We don't need a helper panel here. But we have to override this + // method to avoid the table creation in the parent class. + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :