view flys-client/src/main/java/de/intevation/flys/client/shared/model/ChartInfo.java @ 3847:f3b821735e39

Calculate the info url via i18n Don't fetch the info url from the artifact service and use i18n to calculate the url by using the official gauge and river number. flys-client/trunk@5582 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Mon, 24 Sep 2012 08:39:22 +0000
parents b63e6fdd8cd0
children
line wrap: on
line source
package de.intevation.flys.client.shared.model;

import java.io.Serializable;

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

import de.intevation.flys.client.shared.Transform2D;


/**
 * Give information about chart dimension and transform of chart<->pixel
 * space.
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class ChartInfo implements Serializable {

    protected Axis[] xAxes;
    protected Axis[] yAxes;

    protected Transform2D[] transformer;


    public ChartInfo() {
    }


    public ChartInfo(Axis[] xAxes, Axis[] yAxes, Transform2D[] transformer) {
        this.xAxes       = xAxes;
        this.yAxes       = yAxes;
        this.transformer = transformer;
    }


    public Transform2D getTransformer(int pos) {
        if (pos >= 0 && pos < transformer.length) {
            return transformer[pos];
        }

        return null;
    }


    public int getTransformerCount() {
        return transformer.length;
    }


    public int getXAxisCount() {
        return xAxes.length;
    }


    public int getYAxisCount() {
        return yAxes.length;
    }


    public Axis getXAxis(int pos) {
        if (pos >= 0 && pos < xAxes.length) {
            return xAxes[pos];
        }

        return null;
    }


    public Axis getYAxis(int pos) {
        if (pos >= 0 && pos < yAxes.length) {
            return yAxes[pos];
        }

        return null;
    }


    public void dumpGWT() {
        StringBuilder sb = new StringBuilder();

        Axis x = getXAxis(0);

        GWT.log("X axis:");
        GWT.log("... from " + x.getFrom() + " to " + x.getTo());
        GWT.log("... min " + x.getMin() + " max " + x.getMax());

        for (int i = 0, count = getYAxisCount(); i < count; i++) {
            Axis y = getYAxis(i);

            GWT.log("Y axis " + i + ":");
            GWT.log("... from " + y.getFrom() + " to " + y.getTo());
            GWT.log("... min " + y.getMin() + " max " + y.getMax());
        }

        for (Transform2D t: transformer) {
            t.dumpGWT();
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org