teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5863: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.states.fixation; raimund@2651: raimund@2651: import org.apache.log4j.Logger; raimund@2651: teichmann@5831: import org.dive4elements.artifacts.Artifact; raimund@2651: teichmann@5865: import org.dive4elements.river.utils.RiverUtils; raimund@2651: teichmann@5831: import org.dive4elements.river.artifacts.FLYSArtifact; teichmann@5831: import org.dive4elements.river.artifacts.states.RangeState; raimund@2651: raimund@2651: raimund@2651: /** raimund@2651: * @author Raimund Renkert raimund@2651: */ raimund@2651: public class LocationSelect extends RangeState { raimund@2651: raimund@2651: /** The logger used in this class. */ raimund@2651: private static Logger logger = Logger.getLogger(LocationSelect.class); raimund@2651: rrenkert@4866: private static final String LOWER = "ld_from"; rrenkert@4866: rrenkert@4866: private static final String UPPER = "ld_to"; rrenkert@4866: rrenkert@4866: private static final String STEP = "ld_step"; rrenkert@4866: rrenkert@4866: raimund@2651: /** raimund@2651: * The default constructor that initializes an empty State object. raimund@2651: */ raimund@2651: public LocationSelect() { raimund@2651: } raimund@2651: raimund@2651: @Override raimund@2651: protected String getUIProvider() { raimund@2651: return "fix.location_panel"; raimund@2651: } raimund@2651: raimund@2651: @Override raimund@2651: protected double[] getMinMax(Artifact artifact) { raimund@2651: FLYSArtifact flysArtifact = (FLYSArtifact) artifact; teichmann@5865: return RiverUtils.getRiverMinMax(flysArtifact); raimund@2651: } raimund@2651: felix@3447: felix@3447: /** Misuse to set location mode. */ felix@3447: @Override felix@3447: public boolean validate(Artifact artifact) felix@3447: throws IllegalArgumentException felix@3447: { felix@3447: ((FLYSArtifact) artifact).addStringData("ld_mode", "distance"); felix@3447: return super.validate(artifact); felix@3447: } raimund@2651: } raimund@2651: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :