/* * Copyright 2003-2004, Franz-Josef Elmer, All rights reserved * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details * (http://www.gnu.org/copyleft/lesser.html). * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package jcckit.plot; import jcckit.graphic.ClippingShape; import jcckit.graphic.GraphPoint; import jcckit.graphic.GraphicAttributes; import jcckit.graphic.GraphicalElement; import jcckit.graphic.Rectangle; import jcckit.util.ConfigParameters; /** * A factory of bars. The bars are {@link Rectangle Rectangles}. * Depending on the configuration parameters the bars can be * horizontal or vertical. Bars of several curves can be side by side or * stacked. The bar length is determined by the x or y value of the * curve point in device-independent coordinates. If the value is negative * the bar goes into the negative direction. For stacked bars the values * should always be positive. *
* When used inside a {@link SimpleCurve} soft clipping should always be * switched off (see * {@link SimpleCurve#SimpleCurve(ConfigParameters, int, int, ClippingShape, Legend)}). * * @author Franz-Josef Elmer */ public class BarFactory extends AbstractSymbolFactory { /** Configuration parameter key. */ public static final String STACKED_KEY = "stacked", HORIZONTAL_BARS_KEY = "horizontalBars"; private final boolean _stacked; private final boolean _horizontalBars; /** * Creates an instance from the specified configuration parameters. *
Key & Default Value | Type | Mandatory | *Description |
---|---|---|---|
horizontalBars = false | *boolean | no | *If true horizontal bars will be drawn. Otherwise * vertical bars are drawn. |
stacked = false | *boolean | no | *If true the bars of several curves will be * stacked. |