view flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java @ 4221:480de0dbca8e

Extended location input helper. The locationpicker has now an attribute whether the input is distance or location to display one or two clickable columns. Replaced the record click handler with cell click handler.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 23 Oct 2012 13:17:20 +0200
parents bbc49d9450c8
children 8f9f80db46f3
line wrap: on
line source
package de.intevation.flys.client.client.ui;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

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

import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;

import de.intevation.flys.client.shared.model.Data;
import de.intevation.flys.client.shared.model.DataItem;
import de.intevation.flys.client.shared.model.DataList;
import de.intevation.flys.client.shared.model.DefaultData;
import de.intevation.flys.client.shared.model.DefaultDataItem;

import de.intevation.flys.client.client.FLYSConstants;


/**
 * This UIProvider displays the old DataItems of GaugeDischargeCurveArtifact
 *
 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
 */
public class GaugeDischargeCurvePanel
extends      AbstractUIProvider
{
    /** The message class that provides i18n strings.*/
    protected FLYSConstants messages = GWT.create(FLYSConstants.class);

    /** The combobox.*/
    protected DynamicForm form;

    @Override
    public Canvas create(DataList data) {
        VLayout layout   = new VLayout();
        return layout;
    }

    @Override
    public Canvas createOld(DataList dataList) {
        HLayout layout  = new HLayout();
        VLayout vLayout = new VLayout();
        vLayout.setWidth("400px");

        int size = dataList.size();
        for (int i = 0; i < size; i++) {
            Data data        = dataList.get(i);
            DataItem[] items = data.getItems();

            for (DataItem item: items) {
                HLayout hLayout = new HLayout();

                hLayout.addMember(new Label(item.getLabel()));
                hLayout.addMember(new Label(item.getStringValue()));

                vLayout.addMember(hLayout);
                vLayout.setWidth("130px");
            }
        }

        return vLayout;
    }

    @Override
    protected Data[] getData() {
        return null;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org