view flys-client/src/main/java/de/intevation/flys/client/client/ui/range/DistanceInfoDataSource.java @ 4198:1cdbd8a0c994

Added two new tables ClickableQDTable and ClickableWTable and made Ws and Qs clickable in historical discharge calculation. The new tables define listener interfaces (clicked lower or upper icon) to listen to user clicks. In addition to this, there is an enum ClickMode with NONE, SINGLE and RANGE options, which allows to specifiy, which icons are displayed in the tables. NONE means no icon for user clicks, SINGLE has 1 icon, RANGE 2 icons for lower and upper.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 22 Oct 2012 13:31:25 +0200
parents 4a7ece57f44c
children
line wrap: on
line source
package de.intevation.flys.client.client.ui.range;

import com.google.gwt.core.client.GWT;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.FieldType;


public class DistanceInfoDataSource extends DataSource {

    public static final String XPATH_DISTANCE_DEFAULT = "/distances/distance";


    public DistanceInfoDataSource(String url, String river, String filter) {
        setDataFormat(DSDataFormat.XML);
        setRecordXPath(XPATH_DISTANCE_DEFAULT);

        DataSourceField desc = new DataSourceField(
            "description", FieldType.TEXT, "description");

        DataSourceField from = new DataSourceField(
            "from", FieldType.TEXT, "from");

        DataSourceField to = new DataSourceField(
            "to", FieldType.TEXT, "to");

        DataSourceField side = new DataSourceField(
            "riverside", FieldType.TEXT, "riverside");

        DataSourceField top = new DataSourceField(
            "top", FieldType.TEXT, "top");

        DataSourceField bottom = new DataSourceField(
            "bottom", FieldType.TEXT, "bottom");

        setFields(desc, from, to, side, top, bottom);
        setDataURL(getServiceURL(url, river, filter));
    }


    protected String getServiceURL(String server, String river, String filter) {
        String url = GWT.getModuleBaseURL();
        url += "distanceinfoxml";
        url += "?server=" + server;
        url += "&river=" + river;
        url += "&filter=" + filter;

        return url;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org