001: package org.krysalis.jcharts.properties;
002:
003: /***********************************************************************************************
004: * File Info: $Id: AreaProperties.java,v 1.2 2003/08/08 08:51:27 nicolaken Exp $
005: * Copyright (C) 2002
006: * Author: Nathaniel G. Auvil
007: * Contributor(s):
008: *
009: * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved.
010: *
011: * Redistribution and use of this software and associated documentation ("Software"), with or
012: * without modification, are permitted provided that the following conditions are met:
013: *
014: * 1. Redistributions of source code must retain copyright statements and notices.
015: * Redistributions must also contain a copy of this document.
016: *
017: * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
018: * conditions and the following disclaimer in the documentation and/or other materials
019: * provided with the distribution.
020: *
021: * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote
022: * products derived from this Software without prior written permission of Nathaniel G.
023: * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net
024: *
025: * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear
026: * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a
027: * registered trademark of Nathaniel G. Auvil.
028: *
029: * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/).
030: *
031: * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY
032: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
033: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
034: * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
035: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
036: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
037: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT
038: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
039: * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
040: ************************************************************************************************/
041:
042: import org.krysalis.jcharts.properties.util.ChartStroke;
043: import org.krysalis.jcharts.test.HTMLGenerator;
044: import org.krysalis.jcharts.test.HTMLTestable;
045:
046: public class AreaProperties extends Properties implements HTMLTestable {
047: //---padding on all edges of image
048: private float edgePadding = 5;
049:
050: private ChartStroke borderStroke = null;
051:
052: /*********************************************************************************************
053: *
054: *
055: **********************************************************************************************/
056: public AreaProperties() {
057: super ();
058: }
059:
060: /*********************************************************************************************
061: * Returns the number of pixels to pad the edges of the image
062: *
063: * @return float
064: **********************************************************************************************/
065: public float getEdgePadding() {
066: return this .edgePadding;
067: }
068:
069: /*********************************************************************************************
070: * Sets the number of pixels to pad the edges of the image
071: *
072: * @param edgePadding
073: **********************************************************************************************/
074: public void setEdgePadding(float edgePadding) {
075: this .edgePadding = edgePadding;
076: }
077:
078: /*********************************************************************************************
079: * Sets the border Stroke. If NULL is passed, there will be no border.
080: *
081: * @param chartStroke
082: **********************************************************************************************/
083: public void setBorderStroke(ChartStroke chartStroke) {
084: this .borderStroke = chartStroke;
085: }
086:
087: /*********************************************************************************************
088: * Returns the border Stroke
089: *
090: * @return ChartStroke
091: **********************************************************************************************/
092: public ChartStroke getBorderStroke() {
093: return this .borderStroke;
094: }
095:
096: /*********************************************************************************************
097: * Enables the testing routines to display the contents of this Object.
098: *
099: * @param htmlGenerator
100: **********************************************************************************************/
101: public void toHTML(HTMLGenerator htmlGenerator) {
102: super .toHTML(htmlGenerator);
103: htmlGenerator.addTableRow("AreaProperties->Edge Padding", Float
104: .toString(this .getEdgePadding()));
105: htmlGenerator.addTableRow("AreaProperties->Border Stroke",
106: this.borderStroke);
107: }
108:
109: }
|