001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.charts.design;
029:
030: import net.sf.jasperreports.charts.JRDataRange;
031: import net.sf.jasperreports.charts.JRValueDisplay;
032: import net.sf.jasperreports.charts.base.JRBaseThermometerPlot;
033: import net.sf.jasperreports.engine.JRChart;
034: import net.sf.jasperreports.engine.JRChartPlot;
035: import net.sf.jasperreports.engine.JRConstants;
036:
037: import java.awt.Color;
038:
039: /**
040: * The layout options of a thermometer chart.
041: *
042: * @author Barry Klawans (bklawans@users.sourceforge.net)
043: * @version $Id: JRDesignThermometerPlot.java 1794 2007-07-30 09:07:50Z teodord $
044: */
045: public class JRDesignThermometerPlot extends JRBaseThermometerPlot {
046:
047: /**
048: *
049: */
050: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
051:
052: /**
053: * Constructs a new plot that is a copy of an existing one.
054: *
055: * @param thermoPlot the plot to copy
056: */
057: public JRDesignThermometerPlot(JRChartPlot thermoPlot, JRChart chart) {
058: super (thermoPlot, chart);
059: }
060:
061: /**
062: * Sets the range of values that can be displayed by this thermometer.
063: * Specifies the upper and lower bounds of the display area of the meter.
064: *
065: * @param dataRange the range of values to display
066: */
067: public void setDataRange(JRDataRange dataRange) {
068: this .dataRange = dataRange;
069: }
070:
071: /**
072: * Sets the formatting option for the textual display of the
073: * value.
074: *
075: * @param valueDisplay the value display formatting options
076: */
077: public void setValueDisplay(JRValueDisplay valueDisplay) {
078: this .valueDisplay = valueDisplay;
079: }
080:
081: /**
082: * Turns the display of value lines on and off.
083: *
084: * @param showValueLines <code>true</code> to turn value lines on,
085: * <code>false</code> to disable them
086: */
087: public void setShowValueLines(boolean showValueLines) {
088: this .showValueLines = showValueLines;
089: }
090:
091: /**
092: * Sets where to show the textual display of the value.
093: *
094: * @param valueLocation where to show the textual display of the value
095: */
096: public void setValueLocation(byte valueLocation) {
097: this .valueLocation = valueLocation;
098: }
099:
100: /**
101: * Sets the default color of the mercury in the thermometer. This color
102: * will be used when the value is not in a specified range.
103: *
104: * @param mercuryColor the default color of the mercury
105: */
106: public void setMercuryColor(Color mercuryColor) {
107: this .mercuryColor = mercuryColor;
108: }
109:
110: /**
111: * Specifies the low range of the thermometer.
112: *
113: * @param lowRange the low range of the thermometer
114: */
115: public void setLowRange(JRDataRange lowRange) {
116: this .lowRange = lowRange;
117: }
118:
119: /**
120: * Specifies the medium range of the thermometer.
121: *
122: * @param mediumRange the medium range of the thermometer
123: */
124: public void setMediumRange(JRDataRange mediumRange) {
125: this .mediumRange = mediumRange;
126: }
127:
128: /**
129: * Specifies the high range of the thermometer.
130: *
131: * @param highRange the high range of the thermometer
132: */
133: public void setHighRange(JRDataRange highRange) {
134: this.highRange = highRange;
135: }
136: }
|