001: /***********************************************************************************************
002: * File Info: $Id: AxisValueRenderEvent.java,v 1.2 2004/05/31 16:28:44 nathaniel_auvil Exp $
003: * Copyright (C) 2002
004: * Author: Nathaniel G. Auvil
005: * Contributor(s): John Thomsen
006: *
007: * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved.
008: *
009: * Redistribution and use of this software and associated documentation ("Software"), with or
010: * without modification, are permitted provided that the following conditions are met:
011: *
012: * 1. Redistributions of source code must retain copyright statements and notices.
013: * Redistributions must also contain a copy of this document.
014: *
015: * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
016: * conditions and the following disclaimer in the documentation and/or other materials
017: * provided with the distribution.
018: *
019: * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote
020: * products derived from this Software without prior written permission of Nathaniel G.
021: * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net
022: *
023: * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear
024: * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a
025: * registered trademark of Nathaniel G. Auvil.
026: *
027: * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/).
028: *
029: * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY
030: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
031: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
032: * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
033: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
034: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
035: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT
036: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
037: * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
038: ************************************************************************************************/package org.krysalis.jcharts.axisChart.customRenderers.axisValue;
039:
040: import org.krysalis.jcharts.axisChart.AxisChart;
041: import org.krysalis.jcharts.chartData.interfaces.IAxisPlotDataSet;
042:
043: import java.util.EventObject;
044: import java.awt.*;
045: import java.awt.geom.Rectangle2D;
046: import java.awt.font.FontRenderContext;
047:
048: public class AxisValueRenderEvent extends EventObject {
049:
050: private Graphics2D graphics2D;
051: private FontRenderContext fontRenderContext;
052:
053: private IAxisPlotDataSet iAxisPlotDataSet;
054:
055: //---the total axis area the scale item occupies
056: private Rectangle2D.Float totalItemAxisArea;
057:
058: private float zeroLineCoordinate;
059: private float valueX;
060: private float valueY;
061:
062: private int dataSetIndex;
063: private int valueIndex;
064:
065: /************************************************************************************
066: *
067: * @param axisChart
068: * @param graphics2D
069: * @param totalItemAxisArea
070: ***********************************************************************************/
071: public AxisValueRenderEvent(AxisChart axisChart,
072: IAxisPlotDataSet iAxisPlotDataSet, Graphics2D graphics2D,
073: Rectangle2D.Float totalItemAxisArea,
074: float zeroLineCoordinate) {
075: super (axisChart);
076:
077: this .iAxisPlotDataSet = iAxisPlotDataSet;
078: this .graphics2D = graphics2D;
079: this .fontRenderContext = graphics2D.getFontRenderContext();
080: this .totalItemAxisArea = totalItemAxisArea;
081: this .zeroLineCoordinate = zeroLineCoordinate;
082: }
083:
084: /***********************************************************************************
085: *
086: * @return Graphics2D
087: **********************************************************************************/
088: public Graphics2D getGraphics2D() {
089: return graphics2D;
090: }
091:
092: /***********************************************************************************
093: *
094: * @return FontRenderContext
095: **********************************************************************************/
096: public FontRenderContext getFontRenderContext() {
097: return fontRenderContext;
098: }
099:
100: /*************************************************************************************
101: * Returns the bounding box of the total axis plot area alotted to the current scale
102: * item.
103: *
104: * @return Rectangle2D.Float
105: *************************************************************************************/
106: public Rectangle2D.Float getTotalItemAxisArea() {
107: return totalItemAxisArea;
108: }
109:
110: public IAxisPlotDataSet getiAxisPlotDataSet() {
111: return iAxisPlotDataSet;
112: }
113:
114: /**************************************************************************************
115: *
116: * @return float
117: *************************************************************************************/
118: public float getValueX() {
119: return valueX;
120: }
121:
122: public void setValueX(float valueX) {
123: this .valueX = valueX;
124: }
125:
126: public float getValueY() {
127: return valueY;
128: }
129:
130: public void setValueY(float valueY) {
131: this .valueY = valueY;
132: }
133:
134: public int getDataSetIndex() {
135: return dataSetIndex;
136: }
137:
138: public void setDataSetIndex(int dataSetIndex) {
139: this .dataSetIndex = dataSetIndex;
140: }
141:
142: public int getValueIndex() {
143: return valueIndex;
144: }
145:
146: public void setValueIndex(int valueIndex) {
147: this .valueIndex = valueIndex;
148: }
149:
150: public float getZeroLineCoordinate() {
151: return zeroLineCoordinate;
152: }
153: }
|