KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > krysalis > jcharts > axisChart > customRenderers > axisValue > AxisValueRenderEvent


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

39
40 package org.krysalis.jcharts.axisChart.customRenderers.axisValue;
41
42
43 import org.krysalis.jcharts.axisChart.AxisChart;
44 import org.krysalis.jcharts.chartData.interfaces.IAxisPlotDataSet;
45
46 import java.util.EventObject JavaDoc;
47 import java.awt.*;
48 import java.awt.geom.Rectangle2D JavaDoc;
49 import java.awt.font.FontRenderContext JavaDoc;
50
51
52 public class AxisValueRenderEvent extends EventObject JavaDoc {
53
54     private Graphics2D graphics2D;
55     private FontRenderContext JavaDoc fontRenderContext;
56
57
58     private IAxisPlotDataSet iAxisPlotDataSet;
59
60     //---the total axis area the scale item occupies
61
private Rectangle2D.Float JavaDoc totalItemAxisArea;
62
63     private float zeroLineCoordinate;
64     private float valueX;
65     private float valueY;
66
67     private int dataSetIndex;
68     private int valueIndex;
69
70
71     /************************************************************************************
72      *
73      * @param axisChart
74      * @param graphics2D
75      * @param totalItemAxisArea
76      ***********************************************************************************/

77     public AxisValueRenderEvent( AxisChart axisChart,
78                                           IAxisPlotDataSet iAxisPlotDataSet,
79                                           Graphics2D graphics2D,
80                                           Rectangle2D.Float JavaDoc totalItemAxisArea,
81                                           float zeroLineCoordinate ) {
82         super( axisChart );
83
84       this.iAxisPlotDataSet= iAxisPlotDataSet;
85         this.graphics2D = graphics2D;
86         this.fontRenderContext = graphics2D.getFontRenderContext();
87         this.totalItemAxisArea = totalItemAxisArea;
88         this.zeroLineCoordinate= zeroLineCoordinate;
89     }
90
91
92     /***********************************************************************************
93      *
94      * @return Graphics2D
95      **********************************************************************************/

96     public Graphics2D getGraphics2D() {
97         return graphics2D;
98     }
99
100
101     /***********************************************************************************
102      *
103      * @return FontRenderContext
104      **********************************************************************************/

105     public FontRenderContext JavaDoc getFontRenderContext() {
106         return fontRenderContext;
107     }
108
109
110     /*************************************************************************************
111      * Returns the bounding box of the total axis plot area alotted to the current scale
112      * item.
113      *
114      * @return Rectangle2D.Float
115      *************************************************************************************/

116     public Rectangle2D.Float JavaDoc getTotalItemAxisArea() {
117         return totalItemAxisArea;
118     }
119
120
121
122     public IAxisPlotDataSet getiAxisPlotDataSet() {
123         return iAxisPlotDataSet;
124     }
125
126
127     /**************************************************************************************
128      *
129      * @return float
130      *************************************************************************************/

131     public float getValueX() {
132         return valueX;
133     }
134
135
136     public void setValueX( float valueX ) {
137         this.valueX = valueX;
138     }
139
140
141     public float getValueY() {
142         return valueY;
143     }
144
145
146     public void setValueY( float valueY ) {
147         this.valueY = valueY;
148     }
149
150
151     public int getDataSetIndex() {
152         return dataSetIndex;
153     }
154
155
156     public void setDataSetIndex( int dataSetIndex ) {
157         this.dataSetIndex = dataSetIndex;
158     }
159
160
161     public int getValueIndex() {
162         return valueIndex;
163     }
164
165
166     public void setValueIndex( int valueIndex ) {
167         this.valueIndex = valueIndex;
168     }
169
170
171     public float getZeroLineCoordinate() {
172         return zeroLineCoordinate;
173     }
174 }
175
Popular Tags