From: <mu...@us...> - 2008-09-19 01:34:04
|
Revision: 1631 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=1631&view=rev Author: mungady Date: 2008-09-19 08:34:00 +0000 (Fri, 19 Sep 2008) Log Message: ----------- Whitespace. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2008-09-19 08:33:15 UTC (rev 1630) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2008-09-19 08:34:00 UTC (rev 1631) @@ -1298,7 +1298,6 @@ * @return <code>true</code> or <code>false</code>. */ public boolean equals(Object obj) { - if (obj == this) { return true; } @@ -1358,7 +1357,6 @@ return false; } return true; - } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2011-10-15 04:44:52
|
Revision: 2318 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=2318&view=rev Author: mungady Date: 2011-10-15 04:44:46 +0000 (Sat, 15 Oct 2011) Log Message: ----------- 2011-10-15 David Gilbert <dav...@ob...> * org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java (getLegendItem): Added early returns to reduce indentation, updated Javadoc. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2011-10-13 08:20:09 UTC (rev 2317) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2011-10-15 04:44:46 UTC (rev 2318) @@ -1217,65 +1217,62 @@ * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * - * @return A legend item for the series. + * @return A legend item for the series (possibly <code>null</code). */ public LegendItem getLegendItem(int datasetIndex, int series) { - XYPlot plot = getPlot(); if (plot == null) { return null; } - LegendItem result = null; XYDataset dataset = plot.getDataset(datasetIndex); - if (dataset != null) { - if (getItemVisible(series, 0)) { - String label = getLegendItemLabelGenerator().generateLabel( - dataset, series); - String description = label; - String toolTipText = null; - if (getLegendItemToolTipGenerator() != null) { - toolTipText = getLegendItemToolTipGenerator().generateLabel( - dataset, series); - } - String urlText = null; - if (getLegendItemURLGenerator() != null) { - urlText = getLegendItemURLGenerator().generateLabel( - dataset, series); - } - boolean shapeIsVisible = getItemShapeVisible(series, 0); - Shape shape = lookupLegendShape(series); - boolean shapeIsFilled = getItemShapeFilled(series, 0); - Paint fillPaint = (this.useFillPaint - ? lookupSeriesFillPaint(series) - : lookupSeriesPaint(series)); - boolean shapeOutlineVisible = this.drawOutlines; - Paint outlinePaint = (this.useOutlinePaint - ? lookupSeriesOutlinePaint(series) - : lookupSeriesPaint(series)); - Stroke outlineStroke = lookupSeriesOutlineStroke(series); - boolean lineVisible = getItemLineVisible(series, 0); - Stroke lineStroke = lookupSeriesStroke(series); - Paint linePaint = lookupSeriesPaint(series); - result = new LegendItem(label, description, toolTipText, - urlText, shapeIsVisible, shape, shapeIsFilled, - fillPaint, shapeOutlineVisible, outlinePaint, - outlineStroke, lineVisible, this.legendLine, - lineStroke, linePaint); - result.setLabelFont(lookupLegendTextFont(series)); - Paint labelPaint = lookupLegendTextPaint(series); - if (labelPaint != null) { - result.setLabelPaint(labelPaint); - } - result.setSeriesKey(dataset.getSeriesKey(series)); - result.setSeriesIndex(series); - result.setDataset(dataset); - result.setDatasetIndex(datasetIndex); - } + if (dataset == null) { + return null; } - + + if (!getItemVisible(series, 0)) { + return null; + } + String label = getLegendItemLabelGenerator().generateLabel(dataset, + series); + String description = label; + String toolTipText = null; + if (getLegendItemToolTipGenerator() != null) { + toolTipText = getLegendItemToolTipGenerator().generateLabel( + dataset, series); + } + String urlText = null; + if (getLegendItemURLGenerator() != null) { + urlText = getLegendItemURLGenerator().generateLabel(dataset, + series); + } + boolean shapeIsVisible = getItemShapeVisible(series, 0); + Shape shape = lookupLegendShape(series); + boolean shapeIsFilled = getItemShapeFilled(series, 0); + Paint fillPaint = (this.useFillPaint ? lookupSeriesFillPaint(series) + : lookupSeriesPaint(series)); + boolean shapeOutlineVisible = this.drawOutlines; + Paint outlinePaint = (this.useOutlinePaint ? lookupSeriesOutlinePaint( + series) : lookupSeriesPaint(series)); + Stroke outlineStroke = lookupSeriesOutlineStroke(series); + boolean lineVisible = getItemLineVisible(series, 0); + Stroke lineStroke = lookupSeriesStroke(series); + Paint linePaint = lookupSeriesPaint(series); + LegendItem result = new LegendItem(label, description, toolTipText, + urlText, shapeIsVisible, shape, shapeIsFilled, fillPaint, + shapeOutlineVisible, outlinePaint, outlineStroke, lineVisible, + this.legendLine, lineStroke, linePaint); + result.setLabelFont(lookupLegendTextFont(series)); + Paint labelPaint = lookupLegendTextPaint(series); + if (labelPaint != null) { + result.setLabelPaint(labelPaint); + } + result.setSeriesKey(dataset.getSeriesKey(series)); + result.setSeriesIndex(series); + result.setDataset(dataset); + result.setDatasetIndex(datasetIndex); + return result; - } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2012-09-23 20:11:28
|
Revision: 2521 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=2521&view=rev Author: mungady Date: 2012-09-23 20:11:22 +0000 (Sun, 23 Sep 2012) Log Message: ----------- Add defensive NPE check - see bug 3016544. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2012-09-23 19:12:49 UTC (rev 2520) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2012-09-23 20:11:22 UTC (rev 2521) @@ -21,7 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * - * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners.] * * --------------------------- @@ -66,7 +66,7 @@ * 19-Sep-2008 : Fixed bug with drawSeriesLineAsPath - patch by Greg Darke (DG); * 18-May-2009 : Clip lines in drawPrimaryLine() (DG); * 05-Jul-2012 : Removed JDK 1.3.1 code (DG); - * + * */ package org.jfree.chart.renderer.xy; @@ -919,7 +919,7 @@ // setup for collecting optional entity info... EntityCollection entities = null; - if (info != null) { + if (info != null && info.getOwner() != null) { entities = info.getOwner().getEntityCollection(); } @@ -1228,7 +1228,7 @@ if (dataset == null) { return null; } - + if (!getItemVisible(series, 0)) { return null; } @@ -1270,7 +1270,7 @@ result.setSeriesIndex(series); result.setDataset(dataset); result.setDatasetIndex(datasetIndex); - + return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2013-07-02 16:50:37
|
Revision: 2594 http://sourceforge.net/p/jfreechart/code/2594 Author: mungady Date: 2013-07-02 16:50:33 +0000 (Tue, 02 Jul 2013) Log Message: ----------- Use ParamChecks class. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2013-07-02 16:49:07 UTC (rev 2593) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2013-07-02 16:50:33 UTC (rev 2594) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2012, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------------------------- * XYLineAndShapeRenderer.java * --------------------------- - * (C) Copyright 2004-2009, by Object Refinery Limited. + * (C) Copyright 2004-2013, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -66,6 +66,7 @@ * 19-Sep-2008 : Fixed bug with drawSeriesLineAsPath - patch by Greg Darke (DG); * 18-May-2009 : Clip lines in drawPrimaryLine() (DG); * 05-Jul-2012 : Removed JDK 1.3.1 code (DG); + * 02-Jul-2013 : Use ParamChecks (DG); * */ @@ -92,6 +93,7 @@ import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.util.LineUtilities; +import org.jfree.chart.util.ParamChecks; import org.jfree.data.xy.XYDataset; import org.jfree.io.SerialUtilities; import org.jfree.ui.RectangleEdge; @@ -419,9 +421,7 @@ * @see #getLegendLine() */ public void setLegendLine(Shape line) { - if (line == null) { - throw new IllegalArgumentException("Null 'line' argument."); - } + ParamChecks.nullNotPermitted(line, "line"); this.legendLine = line; fireChangeEvent(); } @@ -883,18 +883,10 @@ * (<code>null</code> permitted). * @param pass the pass index. */ - public void drawItem(Graphics2D g2, - XYItemRendererState state, - Rectangle2D dataArea, - PlotRenderingInfo info, - XYPlot plot, - ValueAxis domainAxis, - ValueAxis rangeAxis, - XYDataset dataset, - int series, - int item, - CrosshairState crosshairState, - int pass) { + public void drawItem(Graphics2D g2, XYItemRendererState state, + Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, + ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, + int series, int item, CrosshairState crosshairState, int pass) { // do nothing if item is not visible if (!getItemVisible(series, item)) { @@ -1126,14 +1118,10 @@ * @param crosshairState the crosshair state. * @param entities the entity collection. */ - protected void drawSecondaryPass(Graphics2D g2, XYPlot plot, - XYDataset dataset, - int pass, int series, int item, - ValueAxis domainAxis, - Rectangle2D dataArea, - ValueAxis rangeAxis, - CrosshairState crosshairState, - EntityCollection entities) { + protected void drawSecondaryPass(Graphics2D g2, XYPlot plot, + XYDataset dataset, int pass, int series, int item, + ValueAxis domainAxis, Rectangle2D dataArea, ValueAxis rangeAxis, + CrosshairState crosshairState, EntityCollection entities) { Shape entityArea = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2013-11-20 15:38:42
|
Revision: 2942 http://sourceforge.net/p/jfreechart/code/2942 Author: mungady Date: 2013-11-20 15:38:40 +0000 (Wed, 20 Nov 2013) Log Message: ----------- Initialise the series path in the State constructor. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2013-11-20 15:37:36 UTC (rev 2941) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2013-11-20 15:38:40 UTC (rev 2942) @@ -794,6 +794,7 @@ */ public State(PlotRenderingInfo info) { super(info); + this.seriesPath = new GeneralPath(); } /** @@ -853,16 +854,10 @@ * * @return The renderer state. */ - public XYItemRendererState initialise(Graphics2D g2, - Rectangle2D dataArea, - XYPlot plot, - XYDataset data, - PlotRenderingInfo info) { - - State state = new State(info); - state.seriesPath = new GeneralPath(); - return state; - + @Override + public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, + XYPlot plot, XYDataset data, PlotRenderingInfo info) { + return new State(info); } /** @@ -883,10 +878,11 @@ * (<code>null</code> permitted). * @param pass the pass index. */ + @Override public void drawItem(Graphics2D g2, XYItemRendererState state, - Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, - ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, - int series, int item, CrosshairState crosshairState, int pass) { + Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, + ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, + int series, int item, CrosshairState crosshairState, int pass) { // do nothing if item is not visible if (!getItemVisible(series, item)) { @@ -1052,16 +1048,10 @@ * @param dataArea the area within which the data is being drawn. */ protected void drawPrimaryLineAsPath(XYItemRendererState state, - Graphics2D g2, XYPlot plot, - XYDataset dataset, - int pass, - int series, - int item, - ValueAxis domainAxis, - ValueAxis rangeAxis, - Rectangle2D dataArea) { + Graphics2D g2, XYPlot plot, XYDataset dataset, int pass, + int series, int item, ValueAxis domainAxis, ValueAxis rangeAxis, + Rectangle2D dataArea) { - RectangleEdge xAxisLocation = plot.getDomainAxisEdge(); RectangleEdge yAxisLocation = plot.getRangeAxisEdge(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-01 09:34:12
|
Revision: 3175 http://sourceforge.net/p/jfreechart/code/3175 Author: mungady Date: 2014-07-01 09:34:08 +0000 (Tue, 01 Jul 2014) Log Message: ----------- Fix Javadoc warnings. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2014-07-01 08:53:37 UTC (rev 3174) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java 2014-07-01 09:34:08 UTC (rev 3175) @@ -1196,7 +1196,7 @@ * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * - * @return A legend item for the series (possibly <code>null</code). + * @return A legend item for the series (possibly {@code null}). */ @Override public LegendItem getLegendItem(int datasetIndex, int series) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |