0001: /*
0002: * Copyright 2006 Pentaho Corporation. All rights reserved.
0003: * This software was developed by Pentaho Corporation and is provided under the terms
0004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
0005: * this file except in compliance with the license. If you need a copy of the license,
0006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
0007: * BI Platform. The Initial Developer is Pentaho Corporation.
0008: *
0009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
0010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
0011: * the license for the specific language governing your rights and limitations.
0012: *
0013: * Created Jun 19, 2006
0014: * @author rtroyer
0015: */
0016:
0017: package org.pentaho.plugin.jfreechart;
0018:
0019: import java.awt.Color;
0020: import java.awt.Font;
0021: import java.awt.Image;
0022: import java.awt.Paint;
0023: import java.text.DecimalFormat;
0024: import java.text.NumberFormat;
0025: import java.util.ArrayList;
0026: import java.util.Iterator;
0027: import java.util.List;
0028:
0029: import org.apache.commons.logging.Log;
0030: import org.apache.commons.logging.LogFactory;
0031: import org.dom4j.Node;
0032: import org.jfree.chart.axis.ValueAxis;
0033: import org.jfree.chart.plot.PlotOrientation;
0034: import org.jfree.chart.title.TextTitle;
0035: import org.jfree.data.xy.XYSeriesCollection;
0036: import org.jfree.data.xy.XYSeries;
0037: import org.jfree.ui.RectangleEdge;
0038: import org.pentaho.commons.connection.IPentahoResultSet;
0039: import org.pentaho.core.session.IPentahoSession;
0040: import org.pentaho.messages.Messages;
0041:
0042: public class XYSeriesCollectionChartDefinition extends
0043: XYSeriesCollection implements XYChartDefinition {
0044: private static final long serialVersionUID = 1717509132920946530L;
0045:
0046: private int chartType = JFreeChartEngine.UNDEFINED_CHART_TYPE;
0047:
0048: private String noDataMessage = null;
0049:
0050: // JFreeChart Customizations
0051: private String title = ""; //$NON-NLS-1$
0052:
0053: private RectangleEdge titlePosition = RectangleEdge.TOP;
0054:
0055: private Font titleFont = TextTitle.DEFAULT_FONT;
0056:
0057: private List subTitles = new ArrayList();
0058:
0059: private Paint chartBackgroundPaint = Color.WHITE;
0060:
0061: private Image chartBackgroundImage = null;
0062:
0063: private boolean borderVisible = false;
0064:
0065: private Paint borderPaint = Color.BLACK;
0066:
0067: private int width = 200;
0068:
0069: private int height = 200;
0070:
0071: private int dotWidth = 5;
0072:
0073: private int dotHeight = 5;
0074:
0075: // Plot Customizations
0076: private PlotOrientation orientation = PlotOrientation.VERTICAL;
0077:
0078: private Paint plotBackgroundPaint = Color.WHITE;
0079:
0080: private Image plotBackgroundImage = null;
0081:
0082: private boolean legendIncluded = true;
0083:
0084: private boolean threeD = false;
0085:
0086: private boolean stacked = false;
0087:
0088: private boolean domainVerticalTickLabels = false;
0089:
0090: private boolean domainIncludesZero = true;
0091:
0092: private boolean domainStickyZero = true;
0093:
0094: private boolean rangeIncludesZero = true;
0095:
0096: private boolean rangeStickyZero = true;
0097:
0098: private Paint[] paintSequence = null;
0099:
0100: private String domainTitle = null;
0101:
0102: private Font domainTitleFont = TextTitle.DEFAULT_FONT;
0103:
0104: private Font domainTickFont = null;
0105:
0106: private NumberFormat domainTickFormat = null;
0107:
0108: private double domainMinimum = ValueAxis.DEFAULT_LOWER_BOUND;
0109:
0110: private double domainMaximum = ValueAxis.DEFAULT_UPPER_BOUND;
0111:
0112: private String rangeTitle = null;
0113:
0114: private Font rangeTitleFont = TextTitle.DEFAULT_FONT;
0115:
0116: private Font rangeTickFont = null;
0117:
0118: private NumberFormat rangeTickFormat = null;
0119:
0120: private double rangeMinimum = ValueAxis.DEFAULT_LOWER_BOUND;
0121:
0122: private double rangeMaximum = ValueAxis.DEFAULT_UPPER_BOUND;
0123:
0124: private Font legendFont = null;
0125:
0126: private boolean legendBorderVisible = true;
0127:
0128: private String lineStyle = ChartDefinition.LINE_STYLE_SOLID_STR;
0129:
0130: private float lineWidth = 1.0f;
0131:
0132: private boolean markersVisible = false;
0133:
0134: // in JFreeChart, the tokens stand for:
0135: // {0} - the series name
0136: // {1} - the preformatted x-value
0137: // {2} - the preformatted y-value
0138: private String tooltipContent = "{1}, {2}"; //$NON-NLS-1$
0139:
0140: private String tooltipYFormat = "0"; //$NON-NLS-1$
0141:
0142: private String tooltipXFormat = "0"; //$NON-NLS-1$
0143:
0144: // Other stuff
0145: private IPentahoSession session;
0146:
0147: public XYSeriesCollectionChartDefinition(IPentahoSession session) {
0148: super ();
0149: this .session = session;
0150: }
0151:
0152: public XYSeriesCollectionChartDefinition(int chartType,
0153: IPentahoResultSet data, boolean byRow,
0154: IPentahoSession session) {
0155: this (session);
0156: this .chartType = chartType;
0157: if (byRow) {
0158: setDataByRow(data);
0159: } else {
0160: setDataByColumn(data);
0161: }
0162: }
0163:
0164: public XYSeriesCollectionChartDefinition(IPentahoResultSet data,
0165: boolean byRow, Node chartAttributes, IPentahoSession session) {
0166: this (JFreeChartEngine.UNDEFINED_CHART_TYPE, data, byRow,
0167: session);
0168: setChartAttributes(chartAttributes);
0169: }
0170:
0171: public static Log getLogger() {
0172: return LogFactory
0173: .getLog(XYSeriesCollectionChartDefinition.class);
0174: }
0175:
0176: private void setChartAttributes(Node chartAttributes) {
0177: if (chartAttributes == null) {
0178: return;
0179: }
0180: // get the chart type from the chart node -- this overrides the current
0181: // chart type
0182: setChartType(chartAttributes.selectSingleNode(TYPE_NODE_NAME));
0183:
0184: // set the chart background
0185: setChartBackground(chartAttributes
0186: .selectSingleNode(CHART_BACKGROUND_NODE_NAME));
0187:
0188: // set the plot background
0189: setPlotBackground(chartAttributes
0190: .selectSingleNode(PLOT_BACKGROUND_NODE_NAME));
0191:
0192: // set the orientation
0193: setOrientation(chartAttributes
0194: .selectSingleNode(ORIENTATION_NODE_NAME));
0195:
0196: // do we want a legend
0197: setLegendIncluded(chartAttributes
0198: .selectSingleNode(INCLUDE_LEGEND_NODE_NAME));
0199:
0200: // get the chart title
0201: setTitle(chartAttributes.selectSingleNode(TITLE_NODE_NAME));
0202:
0203: // get the chart subtitles
0204:
0205: // A list of <subtitle> nodes should not be allowed to exist as a child of the main XML element (for XML schema to
0206: // be well constructed and validate the XML .
0207: // We have deprecated <subtitle> as a child of the main node , and now require a <subtitles> parent node
0208: // under which <subtitle> can exist.
0209:
0210: List subtitles = chartAttributes
0211: .selectNodes(SUBTITLE_NODE_NAME);
0212:
0213: if ((subtitles == null) || (subtitles.isEmpty())) {
0214: Node subTitlesNode = chartAttributes
0215: .selectSingleNode(SUBTITLES_NODE_NAME);
0216: if (subTitlesNode != null) {
0217: subtitles = subTitlesNode
0218: .selectNodes(SUBTITLE_NODE_NAME);
0219: }
0220: } else {
0221: // log a deprecation warning for this property...
0222: getLogger()
0223: .warn(
0224: Messages
0225: .getString(
0226: "CHART.WARN_DEPRECATED_CHILD", SUBTITLE_NODE_NAME, SUBTITLES_NODE_NAME));//$NON-NLS-1$
0227: getLogger()
0228: .warn(
0229: Messages
0230: .getString(
0231: "CHART.WARN_PROPERTY_WILL_NOT_VALIDATE", SUBTITLE_NODE_NAME));//$NON-NLS-1$
0232: }
0233:
0234: if (subtitles != null) {
0235: addSubTitles(subtitles);
0236: }
0237:
0238: // get the paint sequence
0239: setPaintSequence(chartAttributes
0240: .selectSingleNode(PALETTE_NODE_NAME));
0241:
0242: // get the stacked value
0243: setStacked(chartAttributes.selectSingleNode(STACKED_NODE_NAME));
0244:
0245: // get the 3D value
0246: setThreeD(chartAttributes.selectSingleNode(THREED_NODE_NAME));
0247:
0248: // set the width
0249: setWidth(chartAttributes.selectSingleNode(WIDTH_NODE_NAME));
0250:
0251: // set the height
0252: setHeight(chartAttributes.selectSingleNode(HEIGHT_NODE_NAME));
0253:
0254: // set the dot width
0255: setDotWidth(chartAttributes
0256: .selectSingleNode(DOT_WIDTH_NODE_NAME));
0257:
0258: // set the dot height
0259: setDotHeight(chartAttributes
0260: .selectSingleNode(DOT_HEIGHT_NODE_NAME));
0261:
0262: // set vertical tick labels flag
0263: setDomainVerticalTickLabels(chartAttributes
0264: .selectSingleNode(DOMAIN_VERTICAL_TICK_LABELS_NODE_NAME));
0265:
0266: // set the border on or off
0267: setBorderVisible(chartAttributes
0268: .selectSingleNode(CHART_BORDER_VISIBLE_NODE_NAME));
0269:
0270: // set the border Paint
0271: setBorderPaint(JFreeChartEngine.getPaint(chartAttributes
0272: .selectSingleNode(CHART_BORDER_PAINT_NODE_NAME)));
0273:
0274: // set the title location
0275: setTitlePosition(chartAttributes
0276: .selectSingleNode(TITLE_POSITION_NODE_NAME));
0277:
0278: // set the title font
0279: setTitleFont(chartAttributes
0280: .selectSingleNode(TITLE_FONT_NODE_NAME));
0281:
0282: // set the domain title
0283: setDomainTitle(chartAttributes
0284: .selectSingleNode(DOMAIN_TITLE_NODE_NAME));
0285:
0286: //set the domain title font
0287: setDomainTitleFont(chartAttributes
0288: .selectSingleNode(DOMAIN_TITLE_FONT_NODE_NAME));
0289:
0290: //set the domain tick font
0291: setDomainTickFont(chartAttributes
0292: .selectSingleNode(DOMAIN_TICK_FONT_NODE_NAME));
0293:
0294: //the the domain tick label number format
0295: setDomainTickFormat(chartAttributes
0296: .selectSingleNode(DOMAIN_TICK_FORMAT_NODE_NAME));
0297:
0298: // set the range title
0299: setRangeTitle(chartAttributes
0300: .selectSingleNode(RANGE_TITLE_NODE_NAME));
0301:
0302: // the the range title font
0303: setRangeTitleFont(chartAttributes
0304: .selectSingleNode(RANGE_TITLE_FONT_NODE_NAME));
0305:
0306: //the the range tick font
0307: setRangeTickFont(chartAttributes
0308: .selectSingleNode(RANGE_TICK_FONT_NODE_NAME));
0309:
0310: //the the range tick label number format
0311: setRangeTickFormat(chartAttributes
0312: .selectSingleNode(RANGE_TICK_FORMAT_NODE_NAME));
0313:
0314: // set the domain minimum
0315: setDomainMinimum(chartAttributes
0316: .selectSingleNode(DOMAIN_MINIMUM_NODE_NAME));
0317:
0318: //set the domain minimum
0319: setDomainMaximum(chartAttributes
0320: .selectSingleNode(DOMAIN_MAXIMUM_NODE_NAME));
0321:
0322: //set the range minimum
0323: setRangeMinimum(chartAttributes
0324: .selectSingleNode(RANGE_MINIMUM_NODE_NAME));
0325:
0326: //set the range minimum
0327: setRangeMaximum(chartAttributes
0328: .selectSingleNode(RANGE_MAXIMUM_NODE_NAME));
0329:
0330: // set we want domain to include zero
0331: setDomainIncludesZero(chartAttributes
0332: .selectSingleNode(DOMAIN_INCLUDES_ZERO_NODE_NAME));
0333:
0334: // set we want domain to force zero
0335: setDomainStickyZero(chartAttributes
0336: .selectSingleNode(DOMAIN_STICKY_ZERO_NODE_NAME));
0337:
0338: // set we want domain to include zero
0339: setRangeIncludesZero(chartAttributes
0340: .selectSingleNode(RANGE_INCLUDES_ZERO_NODE_NAME));
0341:
0342: // set we want domain to force zero
0343: setRangeStickyZero(chartAttributes
0344: .selectSingleNode(RANGE_STICKY_ZERO_NODE_NAME));
0345:
0346: // set the line style
0347: setLineStyle(chartAttributes
0348: .selectSingleNode(LINE_STYLE_NODE_NAME));
0349:
0350: // set the line width
0351: setLineWidth(chartAttributes
0352: .selectSingleNode(LINE_WIDTH_NODE_NAME));
0353:
0354: // set the marker visibility
0355: setMarkersVisible(chartAttributes
0356: .selectSingleNode(MARKER_VISIBLE_NODE_NAME));
0357:
0358: //set legend font
0359: setLegendFont(chartAttributes
0360: .selectSingleNode(LEGEND_FONT_NODE_NAME));
0361:
0362: // set legend border visible
0363: setLegendBorderVisible(chartAttributes
0364: .selectSingleNode(DISPLAY_LEGEND_BORDER_NODE_NAME));
0365:
0366: setTooltipContent(chartAttributes
0367: .selectSingleNode(TOOLTIP_CONTENT_NODE_NAME));
0368:
0369: setTooltipYFormat(chartAttributes
0370: .selectSingleNode(TOOLTIP_Y_FORMAT_NODE_NAME));
0371:
0372: setTooltipXFormat(chartAttributes
0373: .selectSingleNode(TOOLTIP_X_FORMAT_NODE_NAME));
0374:
0375: }
0376:
0377: private void setDataByColumn(IPentahoResultSet data) {
0378: // TODO Make this routine MDX friendly
0379: if (data == null) {
0380: noDataMessage = Messages
0381: .getString("CHART.USER_NO_DATA_AVAILABLE"); //$NON-NLS-1$
0382: return; // No data so we've got nothing to set
0383: // TODO come up with some sort of error strategy here.
0384: }
0385: boolean firstPass = true;
0386: String lastSeries = ""; //$NON-NLS-1$
0387: String seriesName = ""; //$NON-NLS-1$
0388: Object[] rowData = data.next();
0389: XYSeries wrkSeries = new XYSeries(seriesName);
0390: while (rowData != null) {
0391: seriesName = rowData[0].toString();
0392: if (firstPass || !seriesName.equalsIgnoreCase(lastSeries)) {
0393: if (!firstPass) {
0394: addSeries(wrkSeries);
0395: }
0396: wrkSeries = new XYSeries(seriesName);
0397: lastSeries = seriesName;
0398: firstPass = false;
0399: }
0400: if (rowData[1] instanceof Number
0401: && rowData[2] instanceof Number) {
0402: wrkSeries.add(((Number) rowData[1]).doubleValue(),
0403: ((Number) rowData[2]).doubleValue());
0404: }
0405: rowData = data.next();
0406: }
0407:
0408: if (!firstPass) {
0409: addSeries(wrkSeries);
0410: }
0411:
0412: if ((data.getRowCount() > 0) && (this .getSeriesCount() <= 0)) {
0413: noDataMessage = Messages
0414: .getString("CHART.USER_INCORRECT_DATA_FORMAT"); //$NON-NLS-1$
0415: }
0416:
0417: }
0418:
0419: private void setDataByRow(IPentahoResultSet data) {
0420: // TODO Make this routine MDX friendly
0421: if (data == null) {
0422: noDataMessage = Messages
0423: .getString("CHART.USER_NO_DATA_AVAILABLE"); //$NON-NLS-1$
0424: return; // No data so we've got nothing to set
0425: // TODO come up with some sort of error strategy here.
0426: }
0427: Object[] rowData = data.next();
0428: while (rowData != null) {
0429: String seriesName = (String) rowData[0];
0430: XYSeries wrkSeries = new XYSeries(seriesName);
0431: for (int column = 1; column < rowData.length - 1; column = column + 2) {
0432: wrkSeries.add(((Number) rowData[column]).doubleValue(),
0433: ((Number) rowData[column + 1]).doubleValue());
0434: }
0435: addSeries(wrkSeries);
0436: rowData = data.next();
0437: }
0438: if ((data.getRowCount() > 0) && (this .getSeriesCount() <= 0)) {
0439: noDataMessage = Messages
0440: .getString("CHART.USER_INCORRECT_DATA_FORMAT"); //$NON-NLS-1$
0441: }
0442: }
0443:
0444: /**
0445: * @param backgroundPaint
0446: * The backgroundPaint to set.
0447: */
0448: public void setChartBackgroundPaint(Paint chartBackgroundPaint) {
0449: if (chartBackgroundPaint != null) {
0450: this .chartBackgroundPaint = chartBackgroundPaint;
0451: }
0452: }
0453:
0454: /**
0455: * Return the java.awt.Font to be used to display the dial title
0456: *
0457: * @return Font The Font for the title of this Pie
0458: */
0459: public Font getTitleFont() {
0460: return titleFont;
0461: }
0462:
0463: public void setTitleFont(Font titleFont) {
0464: this .titleFont = titleFont;
0465: }
0466:
0467: public void setTitleFont(Node titleFontNode) {
0468: Font font = JFreeChartEngine.getFont(titleFontNode);
0469: if (font != null) {
0470: setTitleFont(font);
0471: }
0472: }
0473:
0474: /**
0475: * @return Returns the backgroundPaint.
0476: */
0477: public Paint getChartBackgroundPaint() {
0478: return chartBackgroundPaint;
0479: }
0480:
0481: /**
0482: * @return Returns the chartType.
0483: */
0484: public int getChartType() {
0485: return chartType;
0486: }
0487:
0488: public static int getChartType(String typeStr) {
0489: if (typeStr != null) {
0490: if (LINE_CHART_STR.equalsIgnoreCase(typeStr)) {
0491: return JFreeChartEngine.LINE_CHART_TYPE;
0492: } else if (AREA_CHART_STR.equalsIgnoreCase(typeStr)) {
0493: return JFreeChartEngine.AREA_CHART_TYPE;
0494: } else if (STEP_CHART_STR.equalsIgnoreCase(typeStr)) {
0495: return JFreeChartEngine.STEP_CHART_TYPE;
0496: } else if (STEP_AREA_CHART_STR.equalsIgnoreCase(typeStr)) {
0497: return JFreeChartEngine.STEP_AREA_CHART_TYPE;
0498: } else if (DIFFERENCE_CHART_STR.equalsIgnoreCase(typeStr)) {
0499: return JFreeChartEngine.DIFFERENCE_CHART_TYPE;
0500: } else if (DOT_CHART_STR.equalsIgnoreCase(typeStr)) {
0501: return JFreeChartEngine.DOT_CHART_TYPE;
0502: }
0503: }
0504: return JFreeChartEngine.UNDEFINED_CHART_TYPE;
0505: }
0506:
0507: public void setChartType(Node chartTypeNode) {
0508: if (chartTypeNode != null) {
0509: String typeStr = chartTypeNode.getText();
0510: setChartType(getChartType(typeStr));
0511: }
0512: }
0513:
0514: /**
0515: * @param chartType
0516: * The chartType to set.
0517: */
0518: public void setChartType(int chartType) {
0519: this .chartType = chartType;
0520: }
0521:
0522: /**
0523: * @return Returns the threeD.
0524: */
0525: public boolean isThreeD() {
0526: return threeD;
0527: }
0528:
0529: public void setThreeD(Node threeDNode) {
0530: if (threeDNode != null) {
0531: String boolStr = threeDNode.getText();
0532: Boolean booleanValue = new Boolean(boolStr);
0533: setThreeD(booleanValue.booleanValue());
0534: }
0535: }
0536:
0537: /**
0538: * @param threeD
0539: * The threeD to set.
0540: */
0541: public void setThreeD(boolean threeD) {
0542: this .threeD = threeD;
0543: }
0544:
0545: /**
0546: * @return Returns the stacked.
0547: */
0548: public boolean isStacked() {
0549: return stacked;
0550: }
0551:
0552: public void setStacked(Node stackedNode) {
0553: if (stackedNode != null) {
0554: String boolStr = stackedNode.getText();
0555: Boolean booleanValue = new Boolean(boolStr);
0556: setStacked(booleanValue.booleanValue());
0557: }
0558: }
0559:
0560: /**
0561: * @param stacked
0562: * The stacked to set.
0563: */
0564: public void setStacked(boolean stacked) {
0565: this .stacked = stacked;
0566: }
0567:
0568: /**
0569: * @return Returns the verticalTickLabels.
0570: */
0571: public boolean isDomainVerticalTickLabels() {
0572: return domainVerticalTickLabels;
0573: }
0574:
0575: public void setDomainVerticalTickLabels(
0576: Node domainVerticalTickLabelsNode) {
0577: if (domainVerticalTickLabelsNode != null) {
0578: String boolStr = domainVerticalTickLabelsNode.getText();
0579: Boolean booleanValue = new Boolean(boolStr);
0580: setDomainVerticalTickLabels(booleanValue.booleanValue());
0581: }
0582: }
0583:
0584: /**
0585: * @param domainVerticalTickLabels
0586: * The domainVerticalLabels to set.
0587: */
0588: public void setDomainVerticalTickLabels(
0589: boolean domainVerticalTickLabels) {
0590: this .domainVerticalTickLabels = domainVerticalTickLabels;
0591: }
0592:
0593: /**
0594: * @return Returns the domainIncludeZero.
0595: */
0596: public boolean isDomainIncludesZero() {
0597: return domainIncludesZero;
0598: }
0599:
0600: public void setDomainIncludesZero(Node domainIncludesZeroNode) {
0601: if (domainIncludesZeroNode != null) {
0602: String boolStr = domainIncludesZeroNode.getText();
0603: Boolean booleanValue = new Boolean(boolStr);
0604: setDomainIncludesZero(booleanValue.booleanValue());
0605: }
0606: }
0607:
0608: /**
0609: * @param domainIncludesZero
0610: * The domainIncludesZero to set.
0611: */
0612: public void setDomainIncludesZero(boolean domainIncludesZero) {
0613: this .domainIncludesZero = domainIncludesZero;
0614: }
0615:
0616: /**
0617: * @return Returns the domainStickyZero.
0618: */
0619: public boolean isDomainStickyZero() {
0620: return domainStickyZero;
0621: }
0622:
0623: public void setDomainStickyZero(Node domainStickyZeroNode) {
0624: if (domainStickyZeroNode != null) {
0625: String boolStr = domainStickyZeroNode.getText();
0626: Boolean booleanValue = new Boolean(boolStr);
0627: setDomainStickyZero(booleanValue.booleanValue());
0628: }
0629: }
0630:
0631: /**
0632: * @param domainStickyZero
0633: * The domainStickyZero to set.
0634: */
0635: public void setDomainStickyZero(boolean domainStickyZero) {
0636: this .domainStickyZero = domainStickyZero;
0637: }
0638:
0639: /**
0640: * @return Returns the domainIncludeZero.
0641: */
0642: public boolean isRangeIncludesZero() {
0643: return rangeIncludesZero;
0644: }
0645:
0646: public void setRangeIncludesZero(Node rangeIncludesZeroNode) {
0647: if (rangeIncludesZeroNode != null) {
0648: String boolStr = rangeIncludesZeroNode.getText();
0649: Boolean booleanValue = new Boolean(boolStr);
0650: setRangeIncludesZero(booleanValue.booleanValue());
0651: }
0652: }
0653:
0654: /**
0655: * @param domainIncludesZero
0656: * The domainIncludesZero to set.
0657: */
0658: public void setRangeIncludesZero(boolean rangeIncludesZero) {
0659: this .rangeIncludesZero = rangeIncludesZero;
0660: }
0661:
0662: /**
0663: * @return Returns the domainStickyZero.
0664: */
0665: public boolean isRangeStickyZero() {
0666: return rangeStickyZero;
0667: }
0668:
0669: public void setRangeStickyZero(Node rangeStickyZeroNode) {
0670: if (rangeStickyZeroNode != null) {
0671: String boolStr = rangeStickyZeroNode.getText();
0672: Boolean booleanValue = new Boolean(boolStr);
0673: setRangeStickyZero(booleanValue.booleanValue());
0674: }
0675: }
0676:
0677: /**
0678: * @param domainStickyZero
0679: * The domainStickyZero to set.
0680: */
0681: public void setRangeStickyZero(boolean rangeStickyZero) {
0682: this .rangeStickyZero = rangeStickyZero;
0683: }
0684:
0685: /**
0686: * @return Returns the height.
0687: */
0688: public int getHeight() {
0689: return height;
0690: }
0691:
0692: public void setHeight(Node heightNode) {
0693: if (heightNode != null) {
0694: setHeight(Integer.parseInt(heightNode.getText()));
0695: }
0696: }
0697:
0698: /**
0699: * @param height
0700: * The height to set.
0701: */
0702: public void setHeight(int height) {
0703: this .height = height;
0704: }
0705:
0706: /**
0707: * @return Returns the width.
0708: */
0709: public int getWidth() {
0710: return width;
0711: }
0712:
0713: public void setWidth(Node widthNode) {
0714: if (widthNode != null) {
0715: setWidth(Integer.parseInt(widthNode.getText()));
0716: }
0717: }
0718:
0719: /**
0720: * @param width
0721: * The width to set.
0722: */
0723: public void setWidth(int width) {
0724: this .width = width;
0725: }
0726:
0727: //--------------------------------------------------
0728: /**
0729: * @return Returns the dot height.
0730: */
0731: public int getDotHeight() {
0732: return dotHeight;
0733: }
0734:
0735: public void setDotHeight(Node heightNode) {
0736: if (heightNode != null) {
0737: setDotHeight(Integer.parseInt(heightNode.getText()));
0738: }
0739: }
0740:
0741: /**
0742: * @param height
0743: * The dot height to set.
0744: */
0745: public void setDotHeight(int height) {
0746: this .dotHeight = height;
0747: }
0748:
0749: /**
0750: * @return Returns the dot width.
0751: */
0752: public int getDotWidth() {
0753: return dotWidth;
0754: }
0755:
0756: public void setDotWidth(Node widthNode) {
0757: if (widthNode != null) {
0758: setDotWidth(Integer.parseInt(widthNode.getText()));
0759: }
0760: }
0761:
0762: /**
0763: * @param width
0764: * The dot width to set.
0765: */
0766: public void setDotWidth(int width) {
0767: this .dotWidth = width;
0768: }
0769:
0770: //--------------------------------------------------
0771: /**
0772: * @return Returns the title.
0773: */
0774: public String getTitle() {
0775: return title;
0776: }
0777:
0778: public void setTitle(Node chartTitleNode) {
0779: if (chartTitleNode != null) {
0780: setTitle(chartTitleNode.getText());
0781: }
0782: }
0783:
0784: /**
0785: * @param title
0786: * The title to set.
0787: */
0788: public void setTitle(String title) {
0789: this .title = title;
0790: }
0791:
0792: /**
0793: * @return Returns the paintSequence.
0794: */
0795: public Paint[] getPaintSequence() {
0796: return paintSequence;
0797: }
0798:
0799: public void setPaintSequence(Node paletteNode) {
0800: if (paletteNode != null) {
0801: List colorNodes = paletteNode.selectNodes(COLOR_NODE_NAME);
0802: Paint[] paints = new Paint[colorNodes.size()];
0803: for (int i = 0; i < colorNodes.size(); i++) {
0804: paints[i] = JFreeChartEngine.getPaint((Node) colorNodes
0805: .get(i));
0806: }
0807: setPaintSequence(paints);
0808: }
0809: }
0810:
0811: /**
0812: * @param paintSequence
0813: * The paintSequence to set.
0814: */
0815: public void setPaintSequence(Paint[] paintSequence) {
0816: this .paintSequence = paintSequence;
0817: }
0818:
0819: /**
0820: * @return Returns the subTitles.
0821: */
0822: public List getSubtitles() {
0823: return subTitles;
0824: }
0825:
0826: public void addSubTitles(List subTitleNodes) {
0827: if (subTitleNodes != null) {
0828: Iterator iter = subTitleNodes.iterator();
0829: while (iter.hasNext()) {
0830: addSubTitle(((Node) iter.next()).getText());
0831: }
0832: }
0833: }
0834:
0835: public void addSubTitle(String subTitle) {
0836: subTitles.add(subTitle);
0837: }
0838:
0839: /**
0840: * @return Returns the chartBackgroundImage.
0841: */
0842: public Image getChartBackgroundImage() {
0843: return chartBackgroundImage;
0844: }
0845:
0846: public void setChartBackgroundImage(Node chartBackgroundImageNode) {
0847: setChartBackgroundImage(JFreeChartEngine.getImage(
0848: chartBackgroundImageNode, getSession()));
0849: }
0850:
0851: /**
0852: * @param chartBackgroundImage
0853: * The chartBackgroundImage to set.
0854: */
0855: public void setChartBackgroundImage(Image chartBackgroundImage) {
0856: this .chartBackgroundImage = chartBackgroundImage;
0857: }
0858:
0859: /**
0860: * @return Returns the legendIncluded.
0861: */
0862: public boolean isLegendIncluded() {
0863: return legendIncluded;
0864: }
0865:
0866: public void setLegendIncluded(Node legendNode) {
0867: if (legendNode != null) {
0868: String boolStr = legendNode.getText();
0869: Boolean booleanValue = new Boolean(boolStr);
0870: setLegendIncluded(booleanValue.booleanValue());
0871: }
0872: }
0873:
0874: /**
0875: * @param legendIncluded
0876: * The legendIncluded to set.
0877: */
0878: public void setLegendIncluded(boolean legendIncluded) {
0879: this .legendIncluded = legendIncluded;
0880: }
0881:
0882: public void setPlotBackgroundPaint(Paint plotBackgroundPaint) {
0883: if (plotBackgroundPaint != null) {
0884: this .plotBackgroundPaint = plotBackgroundPaint;
0885: }
0886: }
0887:
0888: public Paint getPlotBackgroundPaint() {
0889: return plotBackgroundPaint;
0890: }
0891:
0892: /**
0893: * @return Returns the plotBackgroundImage.
0894: */
0895: public Image getPlotBackgroundImage() {
0896: return plotBackgroundImage;
0897: }
0898:
0899: public void setPlotBackgroundImage(Node plotBackgroundImageNode) {
0900: setPlotBackgroundImage(JFreeChartEngine.getImage(
0901: plotBackgroundImageNode, getSession()));
0902: }
0903:
0904: /**
0905: * @param plotBackgroundImage
0906: * The plotBackgroundImage to set.
0907: */
0908: public void setPlotBackgroundImage(Image plotBackgroundImage) {
0909: this .plotBackgroundImage = plotBackgroundImage;
0910: }
0911:
0912: /**
0913: * @return Returns the orientation.
0914: */
0915: public PlotOrientation getOrientation() {
0916: return orientation;
0917: }
0918:
0919: public void setOrientation(Node orientationNode) {
0920: if (orientationNode != null) {
0921: String orientationStr = orientationNode.getText();
0922: if (VERTICAL_ORIENTATION.equalsIgnoreCase(orientationStr)) {
0923: setOrientation(PlotOrientation.VERTICAL);
0924: } else if (HORIZONTAL_ORIENTATION
0925: .equalsIgnoreCase(orientationStr)) {
0926: setOrientation(PlotOrientation.HORIZONTAL);
0927: }
0928: }
0929: }
0930:
0931: /**
0932: * @param orientation
0933: * The orientation to set.
0934: */
0935: public void setOrientation(PlotOrientation orientation) {
0936: this .orientation = orientation;
0937: }
0938:
0939: /**
0940: * @return Returns the borderVisible.
0941: */
0942: public boolean isBorderVisible() {
0943: return borderVisible;
0944: }
0945:
0946: public void setBorderVisible(Node borderVisibleNode) {
0947: if (borderVisibleNode != null) {
0948: String boolStr = borderVisibleNode.getText();
0949: Boolean booleanValue = new Boolean(boolStr);
0950: setBorderVisible(booleanValue.booleanValue());
0951: }
0952: }
0953:
0954: /**
0955: * @param borderVisible
0956: * The borderVisible to set.
0957: */
0958: public void setBorderVisible(boolean borderVisible) {
0959: this .borderVisible = borderVisible;
0960: }
0961:
0962: /**
0963: * @return Returns the borderPaint.
0964: */
0965: public Paint getBorderPaint() {
0966: return borderPaint;
0967: }
0968:
0969: /**
0970: * @param borderPaint
0971: * The borderPaint to set.
0972: */
0973: public void setBorderPaint(Paint borderPaint) {
0974: this .borderPaint = borderPaint;
0975: }
0976:
0977: public void setTitlePosition(Node titlePositionNode) {
0978: if (titlePositionNode != null) {
0979: String titlePositionStr = titlePositionNode.getText();
0980: if ("top".equalsIgnoreCase(titlePositionStr)) { //$NON-NLS-1$
0981: setTitlePosition(RectangleEdge.TOP);
0982: } else if ("left".equalsIgnoreCase(titlePositionStr)) { //$NON-NLS-1$
0983: setTitlePosition(RectangleEdge.LEFT);
0984: } else if ("bottom".equalsIgnoreCase(titlePositionStr)) { //$NON-NLS-1$
0985: setTitlePosition(RectangleEdge.BOTTOM);
0986: } else if ("right".equalsIgnoreCase(titlePositionStr)) { //$NON-NLS-1$
0987: setTitlePosition(RectangleEdge.RIGHT);
0988: }
0989: }
0990: }
0991:
0992: /**
0993: * @return Returns the titlePosition.
0994: */
0995: public RectangleEdge getTitlePosition() {
0996: return titlePosition;
0997: }
0998:
0999: /**
1000: * @param titlePosition
1001: * The titlePosition to set.
1002: */
1003: public void setTitlePosition(RectangleEdge titlePosition) {
1004: this .titlePosition = titlePosition;
1005: }
1006:
1007: public void setChartBackground(Node chartBackgroundNode) {
1008: if (chartBackgroundNode != null) {
1009: Node backgroundTypeNode = chartBackgroundNode
1010: .selectSingleNode(BACKGROUND_TYPE_ATTRIBUTE_NAME);
1011: if (backgroundTypeNode != null) {
1012: String backgroundTypeStr = backgroundTypeNode.getText();
1013: if (COLOR_TYPE_NAME.equalsIgnoreCase(backgroundTypeStr)) {
1014: setChartBackgroundPaint(JFreeChartEngine
1015: .getPaint(chartBackgroundNode));
1016: setChartBackgroundImage((Image) null);
1017: } else if (IMAGE_TYPE_NAME
1018: .equalsIgnoreCase(backgroundTypeStr)) {
1019: setChartBackgroundImage(chartBackgroundNode);
1020: setChartBackgroundPaint(null);
1021: } else if (TEXTURE_TYPE_NAME
1022: .equalsIgnoreCase(backgroundTypeStr)) {
1023: setChartBackgroundPaint(JFreeChartEngine
1024: .getTexturePaint(chartBackgroundNode,
1025: getWidth(), getHeight(),
1026: getSession()));
1027: setChartBackgroundImage((Image) null);
1028: } else if (GRADIENT_TYPE_NAME
1029: .equalsIgnoreCase(backgroundTypeStr)) {
1030: setChartBackgroundPaint(JFreeChartEngine
1031: .getGradientPaint(chartBackgroundNode,
1032: getWidth(), getHeight()));
1033: setChartBackgroundImage((Image) null);
1034: }
1035: }
1036: }
1037: }
1038:
1039: public void setPlotBackground(Node plotBackgroundNode) {
1040: if (plotBackgroundNode != null) {
1041: Node backgroundTypeNode = plotBackgroundNode
1042: .selectSingleNode(BACKGROUND_TYPE_ATTRIBUTE_NAME);
1043: if (backgroundTypeNode != null) {
1044: String backgroundTypeStr = backgroundTypeNode.getText();
1045: if (COLOR_TYPE_NAME.equalsIgnoreCase(backgroundTypeStr)) {
1046: setPlotBackgroundPaint(JFreeChartEngine
1047: .getPaint(plotBackgroundNode));
1048: setPlotBackgroundImage((Image) null);
1049: } else if (IMAGE_TYPE_NAME
1050: .equalsIgnoreCase(backgroundTypeStr)) {
1051: setPlotBackgroundImage(plotBackgroundNode);
1052: setPlotBackgroundPaint(null);
1053: } else if (TEXTURE_TYPE_NAME
1054: .equalsIgnoreCase(backgroundTypeStr)) {
1055: setPlotBackgroundPaint(JFreeChartEngine
1056: .getTexturePaint(plotBackgroundNode,
1057: getWidth(), getHeight(),
1058: getSession()));
1059: setPlotBackgroundImage((Image) null);
1060: } else if (GRADIENT_TYPE_NAME
1061: .equalsIgnoreCase(backgroundTypeStr)) {
1062: setPlotBackgroundPaint(JFreeChartEngine
1063: .getGradientPaint(plotBackgroundNode,
1064: getWidth(), getHeight()));
1065: setPlotBackgroundImage((Image) null);
1066: }
1067: }
1068: }
1069: }
1070:
1071: public void setDomainTitle(Node titleNode) {
1072: if (titleNode != null) {
1073: setDomainTitle(titleNode.getText());
1074: }
1075: }
1076:
1077: /**
1078: * @return Returns the domainTitle.
1079: */
1080: public String getDomainTitle() {
1081: return domainTitle;
1082: }
1083:
1084: /**
1085: * @param domainTitle
1086: * The domainTitle to set.
1087: */
1088: public void setDomainTitle(String domainTitle) {
1089: this .domainTitle = domainTitle;
1090: }
1091:
1092: public void setRangeTitle(Node titleNode) {
1093: if (titleNode != null) {
1094: setRangeTitle(titleNode.getText());
1095: }
1096: }
1097:
1098: /**
1099: * @return Returns the rangeTitle.
1100: */
1101: public String getRangeTitle() {
1102: return rangeTitle;
1103: }
1104:
1105: /**
1106: * @param rangeTitle
1107: * The rangeTitle to set.
1108: */
1109: public void setRangeTitle(String rangeTitle) {
1110: this .rangeTitle = rangeTitle;
1111: }
1112:
1113: public void setDomainTitleFont(Node titleFontNode) {
1114: Font font = JFreeChartEngine.getFont(titleFontNode);
1115: if (font != null) {
1116: setDomainTitleFont(font);
1117: }
1118: }
1119:
1120: /**
1121: * @return Returns the domainTitleFont.
1122: */
1123: public Font getDomainTitleFont() {
1124: return domainTitleFont;
1125: }
1126:
1127: /**
1128: * @param domainTitleFont
1129: * The domainTitleFont to set.
1130: */
1131: public void setDomainTitleFont(Font domainTitleFont) {
1132: this .domainTitleFont = domainTitleFont;
1133: }
1134:
1135: /**
1136: * Return the java.awt.Font to be used to display the range axis tick labels
1137: *
1138: * @return Font The Font for the range axis tick labels
1139: */
1140: public Font getDomainTickFont() {
1141: return domainTickFont;
1142: }
1143:
1144: /**
1145: * @param domainTickFont
1146: * The domainTickFont to set.
1147: */
1148: public void setDomainTickFont(Font domainTickFont) {
1149: this .domainTickFont = domainTickFont;
1150: }
1151:
1152: public void setDomainTickFont(Node rangeTickFontNode) {
1153: Font font = JFreeChartEngine.getFont(rangeTickFontNode);
1154: if (font != null) {
1155: setDomainTickFont(font);
1156: }
1157: }
1158:
1159: /**
1160: * @return Returns the rangeTickFormat.
1161: */
1162: public NumberFormat getDomainTickFormat() {
1163: return domainTickFormat;
1164: }
1165:
1166: /**
1167: * @param rangeTickFormat
1168: * The range tick number format to set.
1169: */
1170: public void setDomainTickFormat(NumberFormat domainTickFormat) {
1171: this .domainTickFormat = domainTickFormat;
1172: }
1173:
1174: public void setDomainTickFormat(Node tickFormatFontNode) {
1175: if (tickFormatFontNode != null) {
1176: NumberFormat format = new DecimalFormat(tickFormatFontNode
1177: .getText());
1178: if (format != null) {
1179: setDomainTickFormat(format);
1180: }
1181: }
1182: }
1183:
1184: public void setRangeTitleFont(Node titleFontNode) {
1185: Font font = JFreeChartEngine.getFont(titleFontNode);
1186: if (font != null) {
1187: setRangeTitleFont(font);
1188: }
1189: }
1190:
1191: /**
1192: * @return Returns the rangeTitleFont.
1193: */
1194: public Font getRangeTitleFont() {
1195: return rangeTitleFont;
1196: }
1197:
1198: /**
1199: * @param rangeTitleFont
1200: * The rangeTitleFont to set.
1201: */
1202: public void setRangeTitleFont(Font rangeTitleFont) {
1203: this .rangeTitleFont = rangeTitleFont;
1204: }
1205:
1206: /**
1207: * @return Returns the rangeTickFormat.
1208: */
1209: public NumberFormat getRangeTickFormat() {
1210: return rangeTickFormat;
1211: }
1212:
1213: /**
1214: * @param rangeTickFormat
1215: * The range tick number format to set.
1216: */
1217: public void setRangeTickFormat(NumberFormat rangeTickFormat) {
1218: this .rangeTickFormat = rangeTickFormat;
1219: }
1220:
1221: public void setRangeTickFormat(Node tickFormatFontNode) {
1222: if (tickFormatFontNode != null) {
1223: NumberFormat format = new DecimalFormat(tickFormatFontNode
1224: .getText());
1225: if (format != null) {
1226: setRangeTickFormat(format);
1227: }
1228: }
1229: }
1230:
1231: /**
1232: * Return the java.awt.Font to be used to display the range axis tick labels
1233: *
1234: * @return Font The Font for the range axis tick labels
1235: */
1236: public Font getRangeTickFont() {
1237: return rangeTickFont;
1238: }
1239:
1240: /**
1241: * @param rangeTitleFont
1242: * The rangeTitleFont to set.
1243: */
1244: public void setRangeTickFont(Font rangeTickFont) {
1245: this .rangeTickFont = rangeTickFont;
1246: }
1247:
1248: public void setRangeTickFont(Node rangeTickFontNode) {
1249: Font font = JFreeChartEngine.getFont(rangeTickFontNode);
1250: if (font != null) {
1251: setRangeTickFont(font);
1252: }
1253: }
1254:
1255: public boolean isDisplayLabels() {
1256: // TODO Auto-generated method stub
1257: return false;
1258: }
1259:
1260: /**
1261: *
1262: * @return returns the style set for the lines
1263: * @see ChartDefinition.LINE_STYLE_SOLID_STR
1264: * @see ChartDefinition.LINE_STYLE_DASH_STR
1265: * @see ChartDefinition.LINE_STYLE_DOT_STR
1266: * @see ChartDefinition.LINE_STYLE_DASHDOT_STR
1267: * @see ChartDefinition.LINE_STYLE_DASHDOTDOT_STR
1268: */
1269: public String getLineStyle() {
1270: return lineStyle;
1271: }
1272:
1273: /**
1274: *
1275: * @param lineStyle set the style for all line series
1276: * @see ChartDefinition.LINE_STYLE_SOLID_STR
1277: * @see ChartDefinition.LINE_STYLE_DASH_STR
1278: * @see ChartDefinition.LINE_STYLE_DOT_STR
1279: * @see ChartDefinition.LINE_STYLE_DASHDOT_STR
1280: * @see ChartDefinition.LINE_STYLE_DASHDOTDOT_STR
1281: */
1282: public void setLineStyle(String lineStyle) {
1283: this .lineStyle = lineStyle;
1284: }
1285:
1286: /**
1287: *
1288: * @param lineStyleNode set the style from an XML node
1289: */
1290: public void setLineStyle(Node lineStyleNode) {
1291: if (lineStyleNode != null) {
1292: setLineStyle(lineStyleNode.getText());
1293: }
1294: }
1295:
1296: /**
1297: *
1298: * @return the width of all line series
1299: * Valid values are float numbers zero or greater
1300: */
1301: public float getLineWidth() {
1302: return lineWidth;
1303: }
1304:
1305: /**
1306: *
1307: * @param lineWidth set the width of all line series
1308: * Valid values are float numbers zero or greater
1309: */
1310: public void setLineWidth(float lineWidth) {
1311: this .lineWidth = lineWidth;
1312: }
1313:
1314: /**
1315: *
1316: * @param lineWidthNode set the line width from an XML node
1317: */
1318: public void setLineWidth(Node lineWidthNode) {
1319: if (lineWidthNode != null) {
1320: setLineWidth(Float.parseFloat(lineWidthNode.getText()));
1321: }
1322: }
1323:
1324: public IPentahoSession getSession() {
1325: return session;
1326: }
1327:
1328: public void setSession(IPentahoSession session) {
1329: this .session = session;
1330: }
1331:
1332: /**
1333: *
1334: * @return boolean whether the markers (data points) for all series are displayed
1335: */
1336: public boolean isMarkersVisible() {
1337: return markersVisible;
1338: }
1339:
1340: /**
1341: *
1342: * @param markersVisible set whether the markers (data points) for all series should be displayed
1343: */
1344: public void setMarkersVisible(boolean markersVisible) {
1345: this .markersVisible = markersVisible;
1346: }
1347:
1348: /**
1349: *
1350: * @param markersVisibleNode set the markers visibility from an XML node
1351: */
1352: public void setMarkersVisible(Node markersVisibleNode) {
1353: if (markersVisibleNode != null) {
1354: String boolStr = markersVisibleNode.getText();
1355: Boolean booleanValue = new Boolean(boolStr);
1356: setMarkersVisible(booleanValue.booleanValue());
1357: }
1358: }
1359:
1360: /**
1361: * Return the java.awt.Font to be used to display the legend items
1362: *
1363: * @return Font The font for the legend items
1364: */
1365: public Font getLegendFont() {
1366: // TODO Auto-generated method stub
1367: return legendFont;
1368: }
1369:
1370: /**
1371: * Set java.awt.Font to be used to display the legend items
1372: *
1373: * @param Font The java.awt.Font for the legend items
1374: */
1375: public void setLegendFont(Font legendFont) {
1376: this .legendFont = legendFont;
1377: }
1378:
1379: public void setLegendFont(Node legendFontNode) {
1380: Font font = JFreeChartEngine.getFont(legendFontNode);
1381: if (font != null) {
1382: setLegendFont(font);
1383: }
1384: }
1385:
1386: public void setLegendBorderVisible(Node legendBorderVisibleNode) {
1387: if (legendBorderVisibleNode != null) {
1388: boolean legBorderVisible = (new Boolean(
1389: legendBorderVisibleNode.getText())).booleanValue();
1390: setLegendBorderVisible(legBorderVisible);
1391: }
1392: }
1393:
1394: /**
1395: * @param boolean legendBorderVisible
1396: * Set the visibility of the legend border.
1397: */
1398: public void setLegendBorderVisible(boolean legendBorderVisible) {
1399: this .legendBorderVisible = legendBorderVisible;
1400: }
1401:
1402: /**
1403: * Return the boolen that states if the legend border is visible
1404: *
1405: * @return boolean Is the legend border visible
1406: */
1407: public boolean isLegendBorderVisible() {
1408: // TODO Auto-generated method stub
1409: return legendBorderVisible;
1410: }
1411:
1412: /**
1413: * Return the range axis' minimum value
1414: *
1415: * @return double Range axis' minimum value
1416: */
1417: public double getRangeMinimum() {
1418: return rangeMinimum;
1419: }
1420:
1421: public void setRangeMinimum(Node rangeMinimumNode) {
1422: if (rangeMinimumNode != null) {
1423: setRangeMinimum(Double.parseDouble(rangeMinimumNode
1424: .getText()));
1425: }
1426:
1427: }
1428:
1429: /**
1430: * @param double rangeMinimum
1431: * Set the minimum value of the range axis.
1432: */
1433: public void setRangeMinimum(double rangeMinimum) {
1434: this .rangeMinimum = rangeMinimum;
1435: }
1436:
1437: /**
1438: * Return the range axis' maximum value
1439: *
1440: * @return double Range axis' maximum value
1441: */
1442: public double getRangeMaximum() {
1443: return rangeMaximum;
1444: }
1445:
1446: public void setRangeMaximum(Node rangeMaximumNode) {
1447: if (rangeMaximumNode != null) {
1448: setRangeMaximum(Double.parseDouble(rangeMaximumNode
1449: .getText()));
1450: }
1451:
1452: }
1453:
1454: /**
1455: * @param double rangeMaximum
1456: * Set the maximum value of the range axis.
1457: */
1458: public void setRangeMaximum(double rangeMaximum) {
1459: this .rangeMaximum = rangeMaximum;
1460: }
1461:
1462: /**
1463: * Return the domain axis' minimum value
1464: *
1465: * @return double domain axis' minimum value
1466: */
1467: public double getDomainMinimum() {
1468: return domainMinimum;
1469: }
1470:
1471: public void setDomainMinimum(Node domainMinimumNode) {
1472: if (domainMinimumNode != null) {
1473: setDomainMinimum(Double.parseDouble(domainMinimumNode
1474: .getText()));
1475: }
1476:
1477: }
1478:
1479: /**
1480: * @param double domainMinimum
1481: * Set the minimum value of the domain axis.
1482: */
1483: public void setDomainMinimum(double domainMinimum) {
1484: this .domainMinimum = domainMinimum;
1485: }
1486:
1487: /**
1488: * Return the domain axis' maximum value
1489: *
1490: * @return double domain axis' maximum value
1491: */
1492: public double getDomainMaximum() {
1493: return domainMaximum;
1494: }
1495:
1496: public void setDomainMaximum(Node domainMaximumNode) {
1497: if (domainMaximumNode != null) {
1498: setDomainMaximum(Double.parseDouble(domainMaximumNode
1499: .getText()));
1500: }
1501:
1502: }
1503:
1504: /**
1505: * @param double domainMaximum
1506: * Set the maximum value of the domain axis.
1507: */
1508: public void setDomainMaximum(double domainMaximum) {
1509: this .domainMaximum = domainMaximum;
1510: }
1511:
1512: public String getNoDataMessage() {
1513: return noDataMessage;
1514: }
1515:
1516: public String getTooltipContent() {
1517: return tooltipContent;
1518: }
1519:
1520: public void setTooltipContent(String tooltipContent) {
1521: this .tooltipContent = tooltipContent;
1522: }
1523:
1524: public String getTooltipXFormat() {
1525: return tooltipXFormat;
1526: }
1527:
1528: public void setTooltipXFormat(String tooltipXFormat) {
1529: this .tooltipXFormat = tooltipXFormat;
1530: }
1531:
1532: public String getTooltipYFormat() {
1533: return tooltipYFormat;
1534: }
1535:
1536: public void setTooltipYFormat(String tooltipYFormat) {
1537: this .tooltipYFormat = tooltipYFormat;
1538: }
1539:
1540: public void setTooltipContent(Node node) {
1541: if (node != null) {
1542: setTooltipContent(node.getText());
1543: }
1544: }
1545:
1546: public void setTooltipXFormat(Node node) {
1547: if (node != null) {
1548: setTooltipXFormat(node.getText());
1549: }
1550: }
1551:
1552: public void setTooltipYFormat(Node node) {
1553: if (node != null) {
1554: setTooltipYFormat(node.getText());
1555: }
1556: }
1557: }
|