Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9229:0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
author | mschaefer |
---|---|
date | Thu, 05 Jul 2018 16:49:42 +0200 |
parents | 3dae6b78e1da |
children | 6c88ad449c83 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java Thu Jul 05 13:46:36 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java Thu Jul 05 16:49:42 2018 +0200 @@ -17,6 +17,7 @@ import org.dive4elements.river.artifacts.common.I18NStrings; import org.dive4elements.river.artifacts.resources.Resources; import org.dive4elements.river.artifacts.sinfo.tkhcalculation.SoilKind; +import org.dive4elements.river.model.Attribute.AttributeKey; import org.dive4elements.river.utils.Formatter; import org.dive4elements.river.utils.RiverUtils; @@ -328,7 +329,7 @@ @Override public String exportValue(final CallContext context, final Object value) { - return exportStringValue(value); + return localizeRiverside(context, (AttributeKey) value); } @Override @@ -337,6 +338,19 @@ } }; + /** + * Returns the localized text of a riverside + * FIXME: Find a better place for this common method + */ + public static final String localizeRiverside(final CallContext context, final AttributeKey riverside) { + if (riverside == AttributeKey.LEFT) + return Resources.getMsg(context.getMeta(), "riverside.left"); + else if (riverside == AttributeKey.RIGHT) + return Resources.getMsg(context.getMeta(), "riverside.right"); + else + return "?"; + } + public static final SInfoResultType gaugeLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_GAUGE_HEADER) { private static final long serialVersionUID = 1L;