KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > krysalis > jcharts > properties > AreaProperties


1
2 package org.krysalis.jcharts.properties;
3
4
5 /***********************************************************************************************
6  * File Info: $Id: AreaProperties.java,v 1.2 2003/08/08 08:51:27 nicolaken Exp $
7  * Copyright (C) 2002
8  * Author: Nathaniel G. Auvil
9  * Contributor(s):
10  *
11  * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved.
12  *
13  * Redistribution and use of this software and associated documentation ("Software"), with or
14  * without modification, are permitted provided that the following conditions are met:
15  *
16  * 1. Redistributions of source code must retain copyright statements and notices.
17  * Redistributions must also contain a copy of this document.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
20  * conditions and the following disclaimer in the documentation and/or other materials
21  * provided with the distribution.
22  *
23  * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote
24  * products derived from this Software without prior written permission of Nathaniel G.
25  * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net
26  *
27  * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear
28  * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a
29  * registered trademark of Nathaniel G. Auvil.
30  *
31  * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/).
32  *
33  * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY
34  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
35  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
36  * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
37  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT
40  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
41  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
42  ************************************************************************************************/

43
44
45 import org.krysalis.jcharts.properties.util.ChartStroke;
46 import org.krysalis.jcharts.test.HTMLGenerator;
47 import org.krysalis.jcharts.test.HTMLTestable;
48
49
50 public class AreaProperties extends Properties implements HTMLTestable
51 {
52     //---padding on all edges of image
53
private float edgePadding = 5;
54
55     private ChartStroke borderStroke = null;
56
57
58     /*********************************************************************************************
59      *
60      *
61      **********************************************************************************************/

62     public AreaProperties()
63     {
64         super();
65     }
66
67
68     /*********************************************************************************************
69      * Returns the number of pixels to pad the edges of the image
70      *
71      * @return float
72      **********************************************************************************************/

73     public float getEdgePadding()
74     {
75         return this.edgePadding;
76     }
77
78
79     /*********************************************************************************************
80      * Sets the number of pixels to pad the edges of the image
81      *
82      * @param edgePadding
83      **********************************************************************************************/

84     public void setEdgePadding( float edgePadding )
85     {
86         this.edgePadding = edgePadding;
87     }
88
89
90     /*********************************************************************************************
91      * Sets the border Stroke. If NULL is passed, there will be no border.
92      *
93      * @param chartStroke
94      **********************************************************************************************/

95     public void setBorderStroke( ChartStroke chartStroke )
96     {
97         this.borderStroke = chartStroke;
98     }
99
100
101     /*********************************************************************************************
102      * Returns the border Stroke
103      *
104      * @return ChartStroke
105      **********************************************************************************************/

106     public ChartStroke getBorderStroke()
107     {
108         return this.borderStroke;
109     }
110
111
112     /*********************************************************************************************
113      * Enables the testing routines to display the contents of this Object.
114      *
115      * @param htmlGenerator
116      **********************************************************************************************/

117     public void toHTML( HTMLGenerator htmlGenerator )
118     {
119         super.toHTML( htmlGenerator );
120         htmlGenerator.addTableRow( "AreaProperties->Edge Padding", Float.toString( this.getEdgePadding() ) );
121         htmlGenerator.addTableRow( "AreaProperties->Border Stroke", this.borderStroke );
122     }
123
124 }
125
Popular Tags