ingo@1115: /*
ingo@1115: * Copyright (c) 2010 by Intevation GmbH
ingo@1115: *
ingo@1115: * This program is free software under the LGPL (>=v2.1)
ingo@1115: * Read the file LGPL.txt coming with the software for details
ingo@1115: * or visit http://www.gnu.org/licenses/ if it does not exist.
ingo@1115: */
ingo@1115:
tim@335: package de.intevation.gnv.state;
tim@335:
tim@335: import java.util.ArrayList;
tim@335: import java.util.Collection;
tim@511: import java.util.HashMap;
tim@335: import java.util.Iterator;
ingo@470: import java.util.List;
tim@335:
tim@335: import org.apache.log4j.Logger;
tim@511: import org.w3c.dom.Element;
tim@511: import org.w3c.dom.Node;
tim@511: import org.w3c.dom.NodeList;
tim@335:
tim@823: import com.vividsolutions.jts.geom.Point;
tim@823:
sascha@1117: import de.intevation.artifacts.common.utils.Config;
tim@823: import de.intevation.gnv.geobackend.base.Result;
tim@823: import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData;
tim@823: import de.intevation.gnv.state.describedata.KeyValueDescibeData;
tim@823: import de.intevation.gnv.state.describedata.NamedArrayList;
tim@823: import de.intevation.gnv.state.describedata.NamedCollection;
tim@823: import de.intevation.gnv.utils.ArtifactXMLUtilities;
tim@823: import de.intevation.gnv.utils.InputValidator;
tim@823: import de.intevation.gnv.utils.WKTUtils;
tim@823: import de.intevation.gnv.utils.exception.ValidationException;
tim@823:
tim@335: /**
ingo@796: * This state handles coordinate input by the user. It searches database results
ingo@796: * for coordinates and turns them into a human readable form.
ingo@796: *
sascha@780: * @author Tim Englich
tim@335: *
tim@335: */
tim@335: public class CoordinateSelectionState extends StateBase {
tim@335:
tim@335: /**
tim@335: * the logger, used to log exceptions and additonaly information
tim@335: */
tim@335: private static Logger log = Logger.getLogger(CoordinateSelectionState.class);
sascha@778:
tim@335: /**
tim@335: * The UID of this Class
tim@335: */
tim@335: private static final long serialVersionUID = 6318923553625195063L;
sascha@778:
tim@511: /**
tim@511: * XPATH Expressions for the setup.
tim@511: */
sascha@778:
tim@511: private final static String MESH_WIDTH_XPATH = "mesh-width";
tim@511: private final static String XLINK_XPATH = "xlink:href";
tim@511: private final static String MESH_LIST_XPATH = "/mesh-widths/mesh";
tim@511: private final static String ID_XPATH = "id";
tim@511: private final static String WIDTH_VALUE_XPATH = "width";
sascha@778:
tim@511: /**
tim@511: * Holds all given Widths between two MeshPoints for different Meshes.
tim@511: */
tim@511: private HashMap meshWidths = null;
tim@335:
tim@335: /**
tim@335: * Constructor
tim@335: */
tim@335: public CoordinateSelectionState() {
tim@335: super();
tim@335: }
tim@335:
tim@335: @Override
ingo@607: protected List