view gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartStyle.java @ 193:34f233123a6f

Adding empty Series into Chart to prevent NPE issue 19 gnv-artifacts/trunk@243 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 19 Oct 2009 12:06:48 +0000
parents 7fb9441dd8af
children
line wrap: on
line source
/* Copyright (C) 2007 con terra GmbH (http://www.conterra.de)
 * All rights reserved
 *
 * $Id: ChartStyle.java,v 1.2 2007/12/21 12:31:15 blume Exp $
 *
 * created by:      drewnak
 * created at :     10.12.2007
 * created at :     13:07:44
 *
 * modified by:     $Author: blume $
 * modified at:     $Date: 2007/12/21 12:31:15 $
 */
package de.intevation.gnv.chart;

import java.awt.Color;
import java.awt.Dimension;

/**
 * @author drewnak
 */
public class ChartStyle {

    private Color mCanvasColor;
    private Color mPlotBackgroundColor;
    private Color mDomainGridlineColor;
    private Color mRangeGridlineColor;
    private boolean mDomainCrosshairVisible;
    private boolean mRangeCrosshairVisible;
    private Insets mAxisOffset;
    private boolean mOverrideDefaultChartWidth = false;
    private Dimension mChartSize;

    private boolean mUseUpperDataLevel = false;
    private boolean mUseLowerDataLevel = false;
    private int mUpperLevel;
    private int mLowerLevel;

    /**
     * @param pCanvasColor
     * @param pPlotBackgroundColor
     * @param pDomainGridlineColor
     * @param pRangeGridlineColor
     * @param pDomainCrosshairVisible
     * @param pRangeCrosshairVisible
     * @param pAxisOffset
     */
    public ChartStyle(Color pCanvasColor, Color pPlotBackgroundColor,
                      Color pDomainGridlineColor, Color pRangeGridlineColor,
                      boolean pDomainCrosshairVisible,
                      boolean pRangeCrosshairVisible, Insets pAxisOffset,
                      Dimension pChartSize) {
        super();
        mCanvasColor = pCanvasColor;
        mPlotBackgroundColor = pPlotBackgroundColor;
        mDomainGridlineColor = pDomainGridlineColor;
        mRangeGridlineColor = pRangeGridlineColor;
        mDomainCrosshairVisible = pDomainCrosshairVisible;
        mRangeCrosshairVisible = pRangeCrosshairVisible;
        mAxisOffset = pAxisOffset;
        mChartSize = pChartSize;
    }

    public Color getCanvasColor() {
        return mCanvasColor;
    }

    public void setCanvasColor(Color pCanvasColor) {
        mCanvasColor = pCanvasColor;
    }

    public Color getDomainGridlineColor() {
        return mDomainGridlineColor;
    }

    public void setDomainGridlineColor(Color pDomainGridlineColor) {
        mDomainGridlineColor = pDomainGridlineColor;
    }

    public Color getRangeGridlineColor() {
        return mRangeGridlineColor;
    }

    public void setRangeGridlineColor(Color pRangeGridlineColor) {
        mRangeGridlineColor = pRangeGridlineColor;
    }

    public boolean isDomainCrosshairVisible() {
        return mDomainCrosshairVisible;
    }

    public void setDomainCrosshairVisible(boolean pDomainCrosshairVisible) {
        mDomainCrosshairVisible = pDomainCrosshairVisible;
    }

    public boolean isRangeCrosshairVisible() {
        return mRangeCrosshairVisible;
    }

    public void setRangeCrosshairVisible(boolean pRangeCrosshairVisible) {
        mRangeCrosshairVisible = pRangeCrosshairVisible;
    }

    public Insets getAxisOffset() {
        return mAxisOffset;
    }

    public void setAxisOffset(Insets pAxisOffset) {
        mAxisOffset = pAxisOffset;
    }

    public Color getPlotBackgroundColor() {
        return mPlotBackgroundColor;
    }

    public void setPlotBackgroundColor(Color pPlotBackgroundColor) {
        mPlotBackgroundColor = pPlotBackgroundColor;
    }

    public Dimension getChartSize() {
        return mChartSize;
    }

    public void setChartSize(Dimension pChartSize) {
        mChartSize = pChartSize;
    }

    public boolean isOverrideDefaultChartWidth() {
        return mOverrideDefaultChartWidth;
    }

    public void setOverrideDefaultChartWidth(boolean pOverrideDefaultChartWidth) {
        mOverrideDefaultChartWidth = pOverrideDefaultChartWidth;
    }

    public void setNewChartWidth(int pNewChartWidth) {
        mChartSize.setSize(pNewChartWidth, mChartSize.getHeight());
    }

    public boolean isUseUpperDataLevel() {
        return mUseUpperDataLevel;
    }

    public void setUseUpperDataLevel(boolean pUseUpperDataLevel) {
        mUseUpperDataLevel = pUseUpperDataLevel;
    }

    public boolean isUseLowerDataLevel() {
        return mUseLowerDataLevel;
    }

    public void setUseLowerDataLevel(boolean pUseLowerDataLevel) {
        mUseLowerDataLevel = pUseLowerDataLevel;
    }

    public int getUpperLevel() {
        return mUpperLevel;
    }

    public void setUpperLevel(int pUpperLevel) {
        mUpperLevel = pUpperLevel;
    }

    public int getLowerLevel() {
        return mLowerLevel;
    }

    public void setLowerLevel(int pLowerLevel) {
        mLowerLevel = pLowerLevel;
    }
}

http://dive4elements.wald.intevation.org