Mercurial > dive4elements > river
view gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistanceOnlyPartPanel.java @ 9661:9b8ba3b83a15
Importer (s/u-info) vegetation zones: new database column in vegetation_type table for german type name,
localized vegetation type names by querying the database instead of translating by resource property,
detecting and cancelling the import of a second vegetation zone file for a river,
detecting, logging, cancelling in case of wrong column titles,
detecting, logging and ignoring lines with missing (color) values,
comparing vegetation zone name and class with the database and logging+ignoring in case of inconsistencies,
starting the most elevated zone with 0 instead of -1 overflow days
author | mschaefer |
---|---|
date | Mon, 23 Mar 2020 16:38:12 +0100 |
parents | 34dc0163ad2d |
children |
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde * Software engineering by Intevation GmbH * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.client.client.ui; import org.dive4elements.river.client.client.artifacthelper.ArtifactHelper; import org.dive4elements.river.client.shared.model.Data; import org.dive4elements.river.client.shared.model.DataItem; import org.dive4elements.river.client.shared.model.DataList; import com.smartgwt.client.widgets.Label; public class DistanceOnlyPartPanel extends DistanceOnlyPanel { private static final long serialVersionUID = -5794138573892656947L; public DistanceOnlyPartPanel() { super(); } @Override protected Label getLabel(final DataList data) { final Data item = data.get(0); return new Label(item.getDescription());// // TODO: migrate distance_part_state to server // item.getDescription()); // holt das Label vom Server (funktoniert schon sehr oft so!) } @Override protected String getLowerField() { return "ld_from_part"; } @Override protected String getUpperField() { return "ld_to_part"; } @Override protected void initMinMaxValues(final DataList data) { final ArtifactHelper helper = new ArtifactHelper(super.artifact); final Data f = helper.getOldDataByKey("ld_from"); final Data t = helper.getOldDataByKey("ld_to"); try { final DataItem[] fItems = f.getItems(); final DataItem[] tItems = t.getItems(); this.min = Double.valueOf(fItems[0].getStringValue()); this.max = Double.valueOf(tItems[0].getStringValue()); } catch (final NumberFormatException nfe) { this.min = -Double.MAX_VALUE; this.max = Double.MAX_VALUE; } } }