view gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java @ 364:2413273f1c13

Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly. gnv-artifacts/trunk@439 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 16 Dec 2009 11:58:44 +0000
parents e964a3d8f7bc
children a6a33ef35809
line wrap: on
line source
/**
 *
 */
package de.intevation.gnv.state.describedata;

/**
 * @author Tim Englich <tim.englich@intevation.de>
 * 
 */
public class DefaultMinMaxDescribeData implements MinMaxDescribeData {

    /**
     *
     */
    private static final long serialVersionUID = -2917176219029052295L;

    private Object minValue = null;

    private Object maxValue = null;
    
    private String name = null; 

    private final static String minName = "minvalue";

    private final static String maxName = "maxvalue";

    /**
     * Constructor
     */
    public DefaultMinMaxDescribeData(String name, Object minValue, Object maxValue) {
        super();
        this.name = name;
        this.minValue = minValue;
        this.maxValue = maxValue;
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxValue()
     */
    public Object getMaxValue() {
        return this.maxValue;
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMinValue()
     */
    public Object getMinValue() {
        return this.minValue;
    }

    /**
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "MIN: " + this.minValue.toString() + " ; MAX: "
               + this.maxValue.toString();
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getName()
     */
    public String getMinName() {
        return minName;
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxName()
     */
    public String getMaxName() {
        return maxName;
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMaxValue(java.lang.Object)
     */
    public void setMaxValue(Object maxValue) {
        this.maxValue = maxValue;
    }

    /**
     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMinValue(java.lang.Object)
     */
    public void setMinValue(Object minValue) {
        this.minValue = minValue;
    }

    public String getName() {
       return this.name;
    }

}

http://dive4elements.wald.intevation.org