You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(165) |
Nov
(296) |
Dec
(92) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(84) |
Feb
(20) |
Mar
(20) |
Apr
(42) |
May
(26) |
Jun
(30) |
Jul
(77) |
Aug
(151) |
Sep
(61) |
Oct
(259) |
Nov
(160) |
Dec
(76) |
2007 |
Jan
(159) |
Feb
(155) |
Mar
(183) |
Apr
(113) |
May
(110) |
Jun
(178) |
Jul
(56) |
Aug
(21) |
Sep
(50) |
Oct
(251) |
Nov
(218) |
Dec
(42) |
2008 |
Jan
(14) |
Feb
(37) |
Mar
(60) |
Apr
(77) |
May
(146) |
Jun
(256) |
Jul
(72) |
Aug
(51) |
Sep
(283) |
Oct
(22) |
Nov
(55) |
Dec
(53) |
2009 |
Jan
(56) |
Feb
(45) |
Mar
(56) |
Apr
(98) |
May
(84) |
Jun
(87) |
Jul
(32) |
Aug
(6) |
Sep
(19) |
Oct
|
Nov
(10) |
Dec
(6) |
2010 |
Jan
(2) |
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(158) |
Nov
(17) |
Dec
(15) |
2012 |
Jan
(9) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(22) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(259) |
Aug
(125) |
Sep
(24) |
Oct
(8) |
Nov
(132) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(26) |
Mar
(17) |
Apr
(8) |
May
|
Jun
(31) |
Jul
(126) |
Aug
(22) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
(19) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mu...@us...> - 2014-02-28 12:51:13
|
Revision: 3097 http://sourceforge.net/p/jfreechart/code/3097 Author: mungady Date: 2014-02-28 12:51:06 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Update version numbers. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ant/build.xml Modified: branches/jfreechart-1.0.x-branch/ant/build.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build.xml 2014-02-28 12:49:50 UTC (rev 3096) +++ branches/jfreechart-1.0.x-branch/ant/build.xml 2014-02-28 12:51:06 UTC (rev 3097) @@ -20,15 +20,15 @@ <target name="initialise" description="Initialise required settings."> <tstamp /> <property name="jfreechart.name" value="jfreechart" /> - <property name="jfreechart.version" value="1.0.17" /> + <property name="jfreechart.version" value="1.0.18-pre" /> <property name="jfreechart-bundle-file" value="${jfreechart.name}-${jfreechart.version}-bundle.jar" /> <property name="jcommon.name" value="jcommon" /> <property name="jcommon.version" value="1.0.21" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreesvg.name" value="jfreesvg" /> - <property name="jfreesvg.version" value="1.4" /> + <property name="jfreesvg.version" value="1.7" /> <property name="orsonpdf.name" value="orsonpdf" /> - <property name="orsonpdf.version" value="1.3-eval" /> + <property name="orsonpdf.version" value="1.4-eval" /> <property name="orsoncharts.version" value="1.0-eval" /> <property name="builddir" value="${basedir}/build" /> <property name="servlet.jar" value="${basedir}/lib/servlet.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 12:49:54
|
Revision: 3096 http://sourceforge.net/p/jfreechart/code/3096 Author: mungady Date: 2014-02-28 12:49:50 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Update OrsonPDF to version 1.4 Added Paths: ----------- branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar Removed Paths: ------------- branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.3-eval.jar Deleted: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.3-eval.jar =================================================================== (Binary files differ) Added: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar =================================================================== (Binary files differ) Index: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar =================================================================== --- branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar 2014-02-28 12:46:56 UTC (rev 3095) +++ branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar 2014-02-28 12:49:50 UTC (rev 3096) Property changes on: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.4-eval.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 12:46:59
|
Revision: 3095 http://sourceforge.net/p/jfreechart/code/3095 Author: mungady Date: 2014-02-28 12:46:56 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Update JFreeSVG to version 1.7. Removed Paths: ------------- branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.4.jar Deleted: branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.4.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 12:46:38
|
Revision: 3094 http://sourceforge.net/p/jfreechart/code/3094 Author: mungady Date: 2014-02-28 12:46:31 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Update JFreeSVG to version 1.7. Added Paths: ----------- branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar Added: branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar =================================================================== (Binary files differ) Index: branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar =================================================================== --- branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar 2014-02-28 11:51:03 UTC (rev 3093) +++ branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar 2014-02-28 12:46:31 UTC (rev 3094) Property changes on: branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.7.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 11:51:06
|
Revision: 3093 http://sourceforge.net/p/jfreechart/code/3093 Author: mungady Date: 2014-02-28 11:51:03 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Update Changelog. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-28 11:50:27 UTC (rev 3092) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-28 11:51:03 UTC (rev 3093) @@ -1,5 +1,6 @@ 2014-02-28 David Gilbert <dav...@ob...> + * org/jfree/chart/plot/CenterTextMode.java: New file, * org/jfree/chart/plot/RingPlot.java (centerTextMode): New field, (centerText): Likewise, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 11:50:30
|
Revision: 3092 http://sourceforge.net/p/jfreechart/code/3092 Author: mungady Date: 2014-02-28 11:50:27 +0000 (Fri, 28 Feb 2014) Log Message: ----------- Added CenterTextMode enum. Added Paths: ----------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CenterTextMode.java Added: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CenterTextMode.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CenterTextMode.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/CenterTextMode.java 2014-02-28 11:50:27 UTC (rev 3092) @@ -0,0 +1,59 @@ +/* =========================================================== + * JFreeChart : a free chart library for the Java(tm) platform + * =========================================================== + * + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. + * + * Project Info: http://www.jfree.org/jfreechart/index.html + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners.] + * + * ------------------- + * CenterTextMode.java + * ------------------- + * (C) Copyright 2014, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * Changes + * ------- + * 28-Feb-2014 : Version 1 (DG); + * + */ + +package org.jfree.chart.plot; + +/** + * The mode for the center text on a {@link RingPlot}. + * + * @since 1.0.18 + */ +public enum CenterTextMode { + + /** A fixed text item */ + FIXED, + + /** A value item (taken from the first item in the dataset). */ + VALUE, + + /** No center text. */ + NONE + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 11:45:47
|
Revision: 3091 http://sourceforge.net/p/jfreechart/code/3091 Author: mungady Date: 2014-02-28 11:45:44 +0000 (Fri, 28 Feb 2014) Log Message: ----------- 2014-02-28 David Gilbert <dav...@ob...> * org/jfree/chart/plot/RingPlot.java (centerTextMode): New field, (centerText): Likewise, (centerTextFont): Likewise, (centerTextColor): Likewise, (centerTextFormatter): Likewise, (RingPlot(PieDataset)): Initialise new fields, (get/setCenterTextMode): New methods, (get/setCenterText): Likewise, (get/setCenterTextFont): Likewise, (get/setCenterTextColor): Likewise, (get/setCenterTextFormatter): Likewise, (drawItem): Draw the center text, (equals): Check new fields. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/plot/RingPlotTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/plot/RingPlotTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/plot/RingPlotTest.java 2014-02-28 11:45:25 UTC (rev 3090) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/plot/RingPlotTest.java 2014-02-28 11:45:44 UTC (rev 3091) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ----------------- * RingPlotTest.java * ----------------- - * (C) Copyright 2004-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2004-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,7 +36,8 @@ * ------- * 09-Nov-2004 : Version 1 (DG); * 12-Oct-2006 : Updated testEquals() (DG); - * + * 28-Feb-2014 : Add tests for new fields (DG); + * */ package org.jfree.chart.plot; @@ -45,13 +46,16 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import org.junit.Test; + import java.awt.BasicStroke; import java.awt.Color; +import java.awt.Font; import java.awt.GradientPaint; import java.awt.Stroke; +import java.text.DecimalFormat; import org.jfree.chart.TestUtilities; -import org.junit.Test; /** * Tests for the {@link RingPlot} class. @@ -70,6 +74,31 @@ assertTrue(plot1.equals(plot2)); assertTrue(plot2.equals(plot1)); + plot1.setCenterTextMode(CenterTextMode.FIXED); + assertFalse(plot1.equals(plot2)); + plot2.setCenterTextMode(CenterTextMode.FIXED); + assertTrue(plot1.equals(plot2)); + + plot1.setCenterText("ABC"); + assertFalse(plot1.equals(plot2)); + plot2.setCenterText("ABC"); + assertTrue(plot1.equals(plot2)); + + plot1.setCenterTextColor(Color.RED); + assertFalse(plot1.equals(plot2)); + plot2.setCenterTextColor(Color.RED); + assertTrue(plot1.equals(plot2)); + + plot1.setCenterTextFont(new Font(Font.SERIF, Font.PLAIN, 7)); + assertFalse(plot1.equals(plot2)); + plot2.setCenterTextFont(new Font(Font.SERIF, Font.PLAIN, 7)); + assertTrue(plot1.equals(plot2)); + + plot1.setCenterTextFormatter(new DecimalFormat("0.000")); + assertFalse(plot1.equals(plot2)); + plot2.setCenterTextFormatter(new DecimalFormat("0.000")); + assertTrue(plot1.equals(plot2)); + // separatorsVisible plot1.setSeparatorsVisible(false); assertFalse(plot1.equals(plot2)); @@ -108,7 +137,6 @@ assertFalse(plot1.equals(plot2)); plot2.setSectionDepth(0.12); assertTrue(plot1.equals(plot2)); - } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 11:45:28
|
Revision: 3090 http://sourceforge.net/p/jfreechart/code/3090 Author: mungady Date: 2014-02-28 11:45:25 +0000 (Fri, 28 Feb 2014) Log Message: ----------- 2014-02-28 David Gilbert <dav...@ob...> * org/jfree/chart/plot/RingPlot.java (centerTextMode): New field, (centerText): Likewise, (centerTextFont): Likewise, (centerTextColor): Likewise, (centerTextFormatter): Likewise, (RingPlot(PieDataset)): Initialise new fields, (get/setCenterTextMode): New methods, (get/setCenterText): Likewise, (get/setCenterTextFont): Likewise, (get/setCenterTextColor): Likewise, (get/setCenterTextFormatter): Likewise, (drawItem): Draw the center text, (equals): Check new fields. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-28 11:44:55 UTC (rev 3089) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-28 11:45:25 UTC (rev 3090) @@ -1,3 +1,20 @@ +2014-02-28 David Gilbert <dav...@ob...> + + * org/jfree/chart/plot/RingPlot.java + (centerTextMode): New field, + (centerText): Likewise, + (centerTextFont): Likewise, + (centerTextColor): Likewise, + (centerTextFormatter): Likewise, + (RingPlot(PieDataset)): Initialise new fields, + (get/setCenterTextMode): New methods, + (get/setCenterText): Likewise, + (get/setCenterTextFont): Likewise, + (get/setCenterTextColor): Likewise, + (get/setCenterTextFormatter): Likewise, + (drawItem): Draw the center text, + (equals): Check new fields. + 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/time/TimeSeries.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-28 11:44:58
|
Revision: 3089 http://sourceforge.net/p/jfreechart/code/3089 Author: mungady Date: 2014-02-28 11:44:55 +0000 (Fri, 28 Feb 2014) Log Message: ----------- 2014-02-28 David Gilbert <dav...@ob...> * org/jfree/chart/plot/RingPlot.java (centerTextMode): New field, (centerText): Likewise, (centerTextFont): Likewise, (centerTextColor): Likewise, (centerTextFormatter): Likewise, (RingPlot(PieDataset)): Initialise new fields, (get/setCenterTextMode): New methods, (get/setCenterText): Likewise, (get/setCenterTextFont): Likewise, (get/setCenterTextColor): Likewise, (get/setCenterTextFormatter): Likewise, (drawItem): Draw the center text, (equals): Check new fields. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/RingPlot.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/RingPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/RingPlot.java 2014-02-27 15:22:48 UTC (rev 3088) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/RingPlot.java 2014-02-28 11:44:55 UTC (rev 3089) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------- * RingPlot.java * ------------- - * (C) Copyright 2004-2013, by Object Refinery Limited. + * (C) Copyright 2004-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limtied); * Contributor(s): Christoph Beck (bug 2121818); @@ -47,6 +47,7 @@ * 13-Jul-2009 : Added support for shadow generator (DG); * 11-Oct-2011 : Check sectionOutlineVisible - bug 3237879 (DG); * 02-Jul-2013 : Use ParamChecks (DG); + * 28-Feb-2014 : Add center text feature (DG); * */ @@ -54,6 +55,7 @@ import java.awt.BasicStroke; import java.awt.Color; +import java.awt.Font; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; @@ -66,16 +68,19 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; +import java.text.DecimalFormat; +import java.text.Format; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.entity.PieSectionEntity; -import org.jfree.chart.event.PlotChangeEvent; import org.jfree.chart.labels.PieToolTipGenerator; import org.jfree.chart.urls.PieURLGenerator; import org.jfree.chart.util.ParamChecks; import org.jfree.data.general.PieDataset; import org.jfree.io.SerialUtilities; +import org.jfree.text.TextUtilities; import org.jfree.ui.RectangleInsets; +import org.jfree.ui.TextAnchor; import org.jfree.util.ObjectUtilities; import org.jfree.util.PaintUtilities; import org.jfree.util.Rotation; @@ -90,7 +95,28 @@ /** For serialization. */ private static final long serialVersionUID = 1556064784129676620L; + /** The center text mode. */ + private CenterTextMode centerTextMode = CenterTextMode.NONE; + + /** + * Text to display in the middle of the chart (used for + * CenterTextMode.FIXED). + */ + private String centerText; + /** + * The formatter used when displaying the first data value from the + * dataset (CenterTextMode.VALUE). + */ + private Format centerTextFormatter = new DecimalFormat("0.00"); + + /** The font used to display the center text. */ + private Font centerTextFont; + + /** The color used to display the center text. */ + private Color centerTextColor; + + /** * A flag that controls whether or not separators are drawn between the * sections of the chart. */ @@ -133,15 +159,155 @@ */ public RingPlot(PieDataset dataset) { super(dataset); + this.centerTextMode = CenterTextMode.NONE; + this.centerText = null; + this.centerTextFormatter = new DecimalFormat("0.00"); + this.centerTextFont = DEFAULT_LABEL_FONT; + this.centerTextColor = Color.BLACK; this.separatorsVisible = true; this.separatorStroke = new BasicStroke(0.5f); this.separatorPaint = Color.gray; - this.innerSeparatorExtension = 0.20; // twenty percent - this.outerSeparatorExtension = 0.20; // twenty percent + this.innerSeparatorExtension = 0.20; // 20% + this.outerSeparatorExtension = 0.20; // 20% this.sectionDepth = 0.20; // 20% } /** + * Returns the mode for displaying text in the center of the plot. The + * default value is {@link CenterTextMode#NONE} therefore no text + * will be displayed by default. + * + * @return The mode (never <code>null</code>). + * + * @since 1.0.18 + */ + public CenterTextMode getCenterTextMode() { + return this.centerTextMode; + } + + /** + * Sets the mode for displaying text in the center of the plot and sends + * a change event to all registered listeners. For + * {@link CenterTextMode#FIXED}, the display text will come from the + * <code>centerText</code> attribute (see {@link #getCenterText()}). + * For {@link CenterTextMode#VALUE}, the center text will be the value from + * the first section in the dataset. + * + * @param mode the mode (<code>null</code> not permitted). + * + * @since 1.0.18 + */ + public void setCenterTextMode(CenterTextMode mode) { + ParamChecks.nullNotPermitted(mode, "mode"); + this.centerTextMode = mode; + fireChangeEvent(); + } + + /** + * Returns the text to display in the center of the plot when the mode + * is {@link CenterTextMode#FIXED}. + * + * @return The text (possibly <code>null</code>). + * + * @since 1.0.18. + */ + public String getCenterText() { + return this.centerText; + } + + /** + * Sets the text to display in the center of the plot and sends a + * change event to all registered listeners. If the text is set to + * <code>null</code>, no text will be displayed. + * + * @param text the text (<code>null</code> permitted). + * + * @since 1.0.18 + */ + public void setCenterText(String text) { + this.centerText = text; + fireChangeEvent(); + } + + /** + * Returns the formatter used to format the center text value for the mode + * {@link CenterTextMode#VALUE}. The default value is + * <code>DecimalFormat("0.00");</code>. + * + * @return The formatter (never <code>null</code>). + * + * @since 1.0.18 + */ + public Format getCenterTextFormatter() { + return this.centerTextFormatter; + } + + /** + * Sets the formatter used to format the center text value and sends a + * change event to all registered listeners. + * + * @param formatter the formatter (<code>null</code> not permitted). + * + * @since 1.0.18 + */ + public void setCenterTextFormatter(Format formatter) { + ParamChecks.nullNotPermitted(formatter, "formatter"); + this.centerTextFormatter = formatter; + } + + /** + * Returns the font used to display the center text. The default value + * is {@link PiePlot#DEFAULT_LABEL_FONT}. + * + * @return The font (never <code>null</code>). + * + * @since 1.0.18 + */ + public Font getCenterTextFont() { + return this.centerTextFont; + } + + /** + * Sets the font used to display the center text and sends a change event + * to all registered listeners. + * + * @param font the font (<code>null</code> not permitted). + * + * @since 1.0.18 + */ + public void setCenterTextFont(Font font) { + ParamChecks.nullNotPermitted(font, "font"); + this.centerTextFont = font; + fireChangeEvent(); + } + + /** + * Returns the color for the center text. The default value is + * <code>Color.BLACK</code>. + * + * @return The color (never <code>null</code>). + * + * @since 1.0.18 + */ + public Color getCenterTextColor() { + return this.centerTextColor; + } + + /** + * Sets the color for the center text and sends a change event to all + * registered listeners. + * + * @param color the color (<code>null</code> not permitted). + * + * @since 1.0.18 + */ + public void setCenterTextColor(Color color) { + ParamChecks.nullNotPermitted(color, "color"); + this.centerTextColor = color; + fireChangeEvent(); + } + + /** * Returns a flag that indicates whether or not separators are drawn between * the sections in the chart. * @@ -319,11 +485,9 @@ @Override public PiePlotState initialise(Graphics2D g2, Rectangle2D plotArea, PiePlot plot, Integer index, PlotRenderingInfo info) { - PiePlotState state = super.initialise(g2, plotArea, plot, index, info); state.setPassesRequired(3); return state; - } /** @@ -418,6 +582,23 @@ g2.setStroke(outlineStroke); g2.draw(path); } + + if (section == 0) { + String nstr = null; + if (this.centerTextMode.equals(CenterTextMode.VALUE)) { + nstr = this.centerTextFormatter.format(n); + } else if (this.centerTextMode.equals(CenterTextMode.FIXED)) { + nstr = this.centerText; + } + if (nstr != null) { + g2.setFont(this.centerTextFont); + g2.setPaint(this.centerTextColor); + TextUtilities.drawAlignedString(nstr, g2, + (float) dataArea.getCenterX(), + (float) dataArea.getCenterY(), + TextAnchor.CENTER); + } + } // add an entity for the pie section if (state.getInfo() != null) { @@ -484,6 +665,21 @@ return false; } RingPlot that = (RingPlot) obj; + if (!this.centerTextMode.equals(that.centerTextMode)) { + return false; + } + if (!ObjectUtilities.equal(this.centerText, that.centerText)) { + return false; + } + if (!this.centerTextFormatter.equals(that.centerTextFormatter)) { + return false; + } + if (!this.centerTextFont.equals(that.centerTextFont)) { + return false; + } + if (!this.centerTextColor.equals(that.centerTextColor)) { + return false; + } if (this.separatorsVisible != that.separatorsVisible) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-27 15:22:52
|
Revision: 3088 http://sourceforge.net/p/jfreechart/code/3088 Author: mungady Date: 2014-02-27 15:22:48 +0000 (Thu, 27 Feb 2014) Log Message: ----------- Remove incorrect Javadoc. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/LogAxis.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/LogAxis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/LogAxis.java 2014-02-23 15:37:08 UTC (rev 3087) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/LogAxis.java 2014-02-27 15:22:48 UTC (rev 3088) @@ -276,7 +276,7 @@ /** * Calculates the value from a given log. * - * @param log the log value (must be > 0.0). + * @param log the log value. * * @return The value with the given log. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 15:37:12
|
Revision: 3087 http://sourceforge.net/p/jfreechart/code/3087 Author: mungady Date: 2014-02-23 15:37:08 +0000 (Sun, 23 Feb 2014) Log Message: ----------- Updated tests. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesCollectionTest.java branches/jfreechart-1.0.x-branch/tests/org/jfree/data/xy/XYSeriesCollectionTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesCollectionTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesCollectionTest.java 2014-02-23 14:26:15 UTC (rev 3086) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesCollectionTest.java 2014-02-23 15:37:08 UTC (rev 3087) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ----------------------------- * TimeSeriesCollectionTest.java * ----------------------------- - * (C) Copyright 2003-2013, by Object Refinery Limited. + * (C) Copyright 2003-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -50,7 +50,12 @@ import static org.junit.Assert.assertNull; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collections; +import java.util.GregorianCalendar; import java.util.List; +import java.util.Locale; import java.util.TimeZone; import org.jfree.chart.TestUtilities; @@ -395,25 +400,81 @@ @Test public void testGetRangeBounds() { TimeSeriesCollection dataset = new TimeSeriesCollection(); - Range r = dataset.getRangeBounds(false); - assertNull(r); + + // when the dataset contains no series, we expect the range to be null + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + // when the dataset contains one or more series, but those series + // contain no items, we still expect the range to be null TimeSeries s1 = new TimeSeries("S1"); dataset.addSeries(s1); - r = dataset.getRangeBounds(false); - assertTrue(Double.isNaN(r.getLowerBound())); - assertTrue(Double.isNaN(r.getUpperBound())); + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + // tests with values s1.add(new Year(2012), 1.0); - r = dataset.getRangeBounds(false); - assertEquals(1.0, r.getLowerBound(), EPSILON); - assertEquals(1.0, r.getUpperBound(), EPSILON); - + assertEquals(new Range(1.0, 1.0), dataset.getRangeBounds(false)); + assertEquals(new Range(1.0, 1.0), dataset.getRangeBounds(true)); + s1.add(new Year(2013), -1.0); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(true)); + s1.add(new Year(2014), null); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(true)); + + // adding a second series TimeSeries s2 = new TimeSeries("S2"); dataset.addSeries(s2); - r = dataset.getRangeBounds(false); - assertEquals(1.0, r.getLowerBound(), EPSILON); - assertEquals(1.0, r.getUpperBound(), EPSILON); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.0, 1.0), dataset.getRangeBounds(true)); + + s2.add(new Year(2014), 5.0); + assertEquals(new Range(-1.0, 5.0), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.0, 5.0), dataset.getRangeBounds(true)); + + dataset.removeAllSeries(); + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + + s1 = new TimeSeries("s1"); + s2 = new TimeSeries("s2"); + dataset.addSeries(s1); + dataset.addSeries(s2); + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + + s2.add(new Year(2014), 100.0); + assertEquals(new Range(100.0, 100.0), dataset.getRangeBounds(false)); + assertEquals(new Range(100.0, 100.0), dataset.getRangeBounds(true)); } + @Test + public void testGetRangeBounds2() { + TimeZone tzone = TimeZone.getTimeZone("Europe/London"); + Calendar calendar = new GregorianCalendar(tzone, Locale.UK); + calendar.clear(); + calendar.set(2014, Calendar.FEBRUARY, 23, 6, 0); + long start = calendar.getTimeInMillis(); + calendar.clear(); + calendar.set(2014, Calendar.FEBRUARY, 24, 18, 0); + long end = calendar.getTimeInMillis(); + Range range = new Range(start, end); + + TimeSeriesCollection collection = new TimeSeriesCollection(tzone); + assertNull(collection.getRangeBounds(Collections.EMPTY_LIST, range, + true)); + + TimeSeries s1 = new TimeSeries("S1"); + s1.add(new Day(24, 2, 2014), 10.0); + collection.addSeries(s1); + assertEquals(new Range(10.0, 10.0), collection.getRangeBounds( + Arrays.asList("S1"), range, true)); + collection.setXPosition(TimePeriodAnchor.MIDDLE); + assertEquals(new Range(10.0, 10.0), collection.getRangeBounds( + Arrays.asList("S1"), range, true)); + collection.setXPosition(TimePeriodAnchor.END); + assertTrue(collection.getRangeBounds( + Arrays.asList("S1"), range, true).isNaNRange()); + } } Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/xy/XYSeriesCollectionTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/xy/XYSeriesCollectionTest.java 2014-02-23 14:26:15 UTC (rev 3086) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/xy/XYSeriesCollectionTest.java 2014-02-23 15:37:08 UTC (rev 3087) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------------------------- * XYSeriesCollectionTest.java * --------------------------- - * (C) Copyright 2003-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2003-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -55,13 +55,13 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.fail - ; +import static org.junit.Assert.fail; + import org.jfree.chart.TestUtilities; - import org.jfree.data.Range; import org.jfree.data.UnknownKeyException; import org.jfree.util.PublicCloneable; + import org.junit.Test; /** @@ -349,31 +349,120 @@ @Test public void testGetRangeBounds() { XYSeriesCollection dataset = new XYSeriesCollection(); - Range r = dataset.getRangeBounds(false); - assertNull(r); - r = dataset.getRangeBounds(true); - assertNull(r); + + // when the dataset contains no series, we expect the value range to + // be null + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + // when the dataset contains one or more series, but those series + // contain no items, we expect the value range to be null XYSeries series = new XYSeries("S1"); dataset.addSeries(series); - r = dataset.getRangeBounds(false); - assertNull(r); - r = dataset.getRangeBounds(true); - assertNull(r); + assertNull(dataset.getRangeBounds(false)); + assertNull(dataset.getRangeBounds(true)); + // tests with values series.add(1.0, 1.1); - r = dataset.getRangeBounds(false); - assertEquals(new Range(1.1, 1.1), r); - r = dataset.getRangeBounds(true); - assertEquals(new Range(1.1, 1.1), r); + assertEquals(new Range(1.1, 1.1), dataset.getRangeBounds(false)); + assertEquals(new Range(1.1, 1.1), dataset.getRangeBounds(true)); series.add(-1.0, -1.1); - r = dataset.getRangeBounds(false); - assertEquals(new Range(-1.1, 1.1), r); - r = dataset.getRangeBounds(true); - assertEquals(new Range(-1.1, 1.1), r); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); + + series.add(0.0, null); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); + + XYSeries s2 = new XYSeries("S2"); + dataset.addSeries(s2); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.1, 1.1), dataset.getRangeBounds(true)); + + s2.add(2.0, 5.0); + assertEquals(new Range(-1.1, 5.0), dataset.getRangeBounds(false)); + assertEquals(new Range(-1.1, 5.0), dataset.getRangeBounds(true)); } + @Test + public void testGetRangeLowerBound() { + XYSeriesCollection dataset = new XYSeriesCollection(); + + // when the dataset contains no series, we expect the value range to + // be null + assertTrue(Double.isNaN(dataset.getRangeLowerBound(false))); + assertTrue(Double.isNaN(dataset.getRangeLowerBound(true))); + + // when the dataset contains one or more series, but those series + // contain no items, we expect the value range to be null + XYSeries series = new XYSeries("S1"); + dataset.addSeries(series); + assertTrue(Double.isNaN(dataset.getRangeLowerBound(false))); + assertTrue(Double.isNaN(dataset.getRangeLowerBound(true))); + + // tests with values + series.add(1.0, 1.1); + assertEquals(1.1, dataset.getRangeLowerBound(false), EPSILON); + assertEquals(1.1, dataset.getRangeLowerBound(true), EPSILON); + + series.add(-1.0, -1.1); + assertEquals(-1.1, dataset.getRangeLowerBound(false), EPSILON); + assertEquals(-1.1, dataset.getRangeLowerBound(true), EPSILON); + + series.add(0.0, null); + assertEquals(-1.1, dataset.getRangeLowerBound(false), EPSILON); + assertEquals(-1.1, dataset.getRangeLowerBound(true), EPSILON); + + XYSeries s2 = new XYSeries("S2"); + dataset.addSeries(s2); + assertEquals(-1.1, dataset.getRangeLowerBound(false), EPSILON); + assertEquals(-1.1, dataset.getRangeLowerBound(true), EPSILON); + + s2.add(2.0, 5.0); + assertEquals(-1.1, dataset.getRangeLowerBound(false), EPSILON); + assertEquals(-1.1, dataset.getRangeLowerBound(true), EPSILON); + } + + @Test + public void testGetRangeUpperBound() { + XYSeriesCollection dataset = new XYSeriesCollection(); + + // when the dataset contains no series, we expect the value range to + // be null + assertTrue(Double.isNaN(dataset.getRangeUpperBound(false))); + assertTrue(Double.isNaN(dataset.getRangeUpperBound(true))); + + // when the dataset contains one or more series, but those series + // contain no items, we expect the value range to be null + XYSeries series = new XYSeries("S1"); + dataset.addSeries(series); + assertTrue(Double.isNaN(dataset.getRangeUpperBound(false))); + assertTrue(Double.isNaN(dataset.getRangeUpperBound(true))); + + // tests with values + series.add(1.0, 1.1); + assertEquals(1.1, dataset.getRangeUpperBound(false), EPSILON); + assertEquals(1.1, dataset.getRangeUpperBound(true), EPSILON); + + series.add(-1.0, -1.1); + assertEquals(1.1, dataset.getRangeUpperBound(false), EPSILON); + assertEquals(1.1, dataset.getRangeUpperBound(true), EPSILON); + + series.add(0.0, null); + assertEquals(1.1, dataset.getRangeUpperBound(false), EPSILON); + assertEquals(1.1, dataset.getRangeUpperBound(true), EPSILON); + + XYSeries s2 = new XYSeries("S2"); + dataset.addSeries(s2); + assertEquals(1.1, dataset.getRangeUpperBound(false), EPSILON); + assertEquals(1.1, dataset.getRangeUpperBound(true), EPSILON); + + s2.add(2.0, 5.0); + assertEquals(5.0, dataset.getRangeUpperBound(false), EPSILON); + assertEquals(5.0, dataset.getRangeUpperBound(true), EPSILON); + } + /** * A check that the dataset prevents renaming a series to the name of an * existing series in the dataset. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 14:26:20
|
Revision: 3086 http://sourceforge.net/p/jfreechart/code/3086 Author: mungady Date: 2014-02-23 14:26:15 +0000 (Sun, 23 Feb 2014) Log Message: ----------- Remove System.out lines. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java 2014-02-23 08:36:36 UTC (rev 3085) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java 2014-02-23 14:26:15 UTC (rev 3086) @@ -1171,11 +1171,9 @@ Calendar calendar = new GregorianCalendar(tzone, Locale.UK); calendar.clear(); calendar.set(2014, Calendar.FEBRUARY, 23, 6, 0); - System.out.println(calendar.getTime()); long start = calendar.getTimeInMillis(); calendar.clear(); calendar.set(2014, Calendar.FEBRUARY, 24, 18, 0); - System.out.println(calendar.getTime()); long end = calendar.getTimeInMillis(); Range range = new Range(start, end); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 08:36:39
|
Revision: 3085 http://sourceforge.net/p/jfreechart/code/3085 Author: mungady Date: 2014-02-23 08:36:36 +0000 (Sun, 23 Feb 2014) Log Message: ----------- New tests. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java 2014-02-23 08:35:50 UTC (rev 3084) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/time/TimeSeriesTest.java 2014-02-23 08:36:36 UTC (rev 3085) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------------- * TimeSeriesTest.java * ------------------- - * (C) Copyright 2001-2013, by Object Refinery Limited. + * (C) Copyright 2001-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -55,6 +55,10 @@ package org.jfree.data.time; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.Locale; +import java.util.TimeZone; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -62,6 +66,7 @@ import static org.junit.Assert.fail; import org.jfree.chart.TestUtilities; +import org.jfree.data.Range; import org.jfree.data.general.SeriesChangeEvent; import org.jfree.data.general.SeriesChangeListener; @@ -127,7 +132,6 @@ */ @Test public void testClone() throws CloneNotSupportedException { - TimeSeries series = new TimeSeries("Test Series"); RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002); series.add(jan1st2002, new Integer(42)); @@ -350,7 +354,6 @@ */ @Test public void testCreateCopy1() { - TimeSeries series = new TimeSeries("Series", Month.class); series.add(new Month(MonthConstants.JANUARY, 2003), 45.0); series.add(new Month(MonthConstants.FEBRUARY, 2003), 55.0); @@ -436,7 +439,6 @@ catch (CloneNotSupportedException e) { assertTrue(false); } - } /** @@ -445,7 +447,6 @@ */ @Test public void testCreateCopy2() { - TimeSeries series = new TimeSeries("Series", Month.class); series.add(new Month(MonthConstants.JANUARY, 2003), 45.0); series.add(new Month(MonthConstants.FEBRUARY, 2003), 55.0); @@ -978,6 +979,24 @@ assertEquals(1.1, s1.getMinY(), EPSILON); } + @Test + public void testGetMinY2() { + TimeSeries ts = new TimeSeries("Time Series"); + assertTrue(Double.isNaN(ts.getMinY())); + + ts.add(new Year(2014), 1.0); + assertEquals(1.0, ts.getMinY(), EPSILON); + + ts.addOrUpdate(new Year(2014), null); + assertTrue(Double.isNaN(ts.getMinY())); + + ts.addOrUpdate(new Year(2014), 1.0); + assertEquals(1.0, ts.getMinY(), EPSILON); + + ts.clear(); + assertTrue(Double.isNaN(ts.getMinY())); + } + /** * Some checks for the getMaxY() method. */ @@ -1005,6 +1024,24 @@ assertEquals(2.2, s1.getMaxY(), EPSILON); } + @Test + public void testGetMaxY2() { + TimeSeries ts = new TimeSeries("Time Series"); + assertTrue(Double.isNaN(ts.getMaxY())); + + ts.add(new Year(2014), 1.0); + assertEquals(1.0, ts.getMaxY(), EPSILON); + + ts.addOrUpdate(new Year(2014), null); + assertTrue(Double.isNaN(ts.getMaxY())); + + ts.addOrUpdate(new Year(2014), 1.0); + assertEquals(1.0, ts.getMaxY(), EPSILON); + + ts.clear(); + assertTrue(Double.isNaN(ts.getMaxY())); + } + /** * A test for the clear method. */ @@ -1105,4 +1142,67 @@ s1.setKey("S2"); } + @Test + public void testFindValueRange() { + TimeSeries ts = new TimeSeries("Time Series"); + assertNull(ts.findValueRange()); + + ts.add(new Year(2014), 1.0); + assertEquals(new Range(1.0, 1.0), ts.findValueRange()); + + ts.add(new Year(2015), 2.0); + assertEquals(new Range(1.0, 2.0), ts.findValueRange()); + + // null items are ignored + ts.add(new Year(2016), null); + assertEquals(new Range(1.0, 2.0), ts.findValueRange()); + + ts.clear(); + assertNull(ts.findValueRange()); + + // if there are only null items, we get a NaNRange + ts.add(new Year(2014), null); + assertTrue(ts.findValueRange().isNaNRange()); + } + + @Test + public void testFindValueRange2() { + TimeZone tzone = TimeZone.getTimeZone("Europe/London"); + Calendar calendar = new GregorianCalendar(tzone, Locale.UK); + calendar.clear(); + calendar.set(2014, Calendar.FEBRUARY, 23, 6, 0); + System.out.println(calendar.getTime()); + long start = calendar.getTimeInMillis(); + calendar.clear(); + calendar.set(2014, Calendar.FEBRUARY, 24, 18, 0); + System.out.println(calendar.getTime()); + long end = calendar.getTimeInMillis(); + Range range = new Range(start, end); + + TimeSeries ts = new TimeSeries("Time Series"); + assertNull(ts.findValueRange(range, TimePeriodAnchor.START, tzone)); + assertNull(ts.findValueRange(range, TimePeriodAnchor.MIDDLE, tzone)); + assertNull(ts.findValueRange(range, TimePeriodAnchor.END, tzone)); + + ts.add(new Day(23, 2, 2014), 5.0); + assertTrue(ts.findValueRange(range, TimePeriodAnchor.START, tzone).isNaNRange()); + assertEquals(new Range(5.0, 5.0), + ts.findValueRange(range, TimePeriodAnchor.MIDDLE, tzone)); + assertEquals(new Range(5.0, 5.0), + ts.findValueRange(range, TimePeriodAnchor.END, tzone)); + + ts.add(new Day(24, 2, 2014), 6.0); + assertEquals(new Range(6.0, 6.0), + ts.findValueRange(range, TimePeriodAnchor.START, tzone)); + assertEquals(new Range(5.0, 6.0), + ts.findValueRange(range, TimePeriodAnchor.MIDDLE, tzone)); + assertEquals(new Range(5.0, 5.0), + ts.findValueRange(range, TimePeriodAnchor.END, tzone)); + + ts.clear(); + ts.add(new Day(24, 2, 2014), null); + assertTrue(ts.findValueRange(range, TimePeriodAnchor.START, tzone).isNaNRange()); + assertTrue(ts.findValueRange(range, TimePeriodAnchor.MIDDLE, tzone).isNaNRange()); + assertTrue(ts.findValueRange(range, TimePeriodAnchor.END, tzone).isNaNRange()); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 08:35:52
|
Revision: 3084 http://sourceforge.net/p/jfreechart/code/3084 Author: mungady Date: 2014-02-23 08:35:50 +0000 (Sun, 23 Feb 2014) Log Message: ----------- 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/time/TimeSeries.java (findValueRange): New method, (findValueRange(Range, TimeZone): Likewise, (findValueRange(Range , TimePeriodAnchor, TimeZone): Likewise, (updateMinMaxYByIteration): Renamed private method (was findBoundsByIteration). Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-23 08:35:36 UTC (rev 3083) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-23 08:35:50 UTC (rev 3084) @@ -1,5 +1,19 @@ 2014-02-23 David Gilbert <dav...@ob...> + * org/jfree/data/time/TimeSeries.java + (findValueRange): New method, + (findValueRange(Range, TimeZone): Likewise, + (findValueRange(Range , TimePeriodAnchor, TimeZone): Likewise, + (updateMinMaxYByIteration): Renamed private method (was + findBoundsByIteration). + +2014-02-23 David Gilbert <dav...@ob...> + + * org/jfree/data/Range.java + (isNaNRange): New method. + +2014-02-23 David Gilbert <dav...@ob...> + * org/jfree/data/time/RegularTimePeriod.java (getMillisecond) : New method. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 08:35:39
|
Revision: 3083 http://sourceforge.net/p/jfreechart/code/3083 Author: mungady Date: 2014-02-23 08:35:36 +0000 (Sun, 23 Feb 2014) Log Message: ----------- 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/time/TimeSeries.java (findValueRange): New method, (findValueRange(Range, TimeZone): Likewise, (findValueRange(Range , TimePeriodAnchor, TimeZone): Likewise, (updateMinMaxYByIteration): Renamed private method (was findBoundsByIteration). Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/TimeSeries.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/TimeSeries.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/TimeSeries.java 2014-02-23 08:27:46 UTC (rev 3082) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/TimeSeries.java 2014-02-23 08:35:36 UTC (rev 3083) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------------- * TimeSeries.java * --------------- - * (C) Copyright 2001-2013, by Object Refinery Limited. + * (C) Copyright 2001-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Bryan Scott; @@ -93,16 +93,17 @@ import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.TimeZone; + import org.jfree.chart.util.ParamChecks; - +import org.jfree.data.Range; import org.jfree.data.general.Series; -import org.jfree.data.general.SeriesChangeEvent; import org.jfree.data.general.SeriesException; import org.jfree.util.ObjectUtilities; @@ -333,9 +334,97 @@ } /** - * Returns the smallest y-value in the series, ignoring any null and - * Double.NaN values. This method returns Double.NaN if there is no - * smallest y-value (for example, when the series is empty). + * Returns the range of y-values in the time series. Any <code>null</code> + * data values in the series will be ignored (except for the special case + * where all data values are <code>null</code>, in which case the return + * value is <code>Range(Double.NaN, Double.NaN)</code>). If the time + * series contains no items, this method will return <code>null</code>. + * + * @return The range of y-values in the time series (possibly + * <code>null</code>). + * + * @since 1.0.18 + */ + public Range findValueRange() { + if (this.data.isEmpty()) { + return null; + } + return new Range(this.minY, this.maxY); + } + + /** + * Returns the range of y-values in the time series that fall within + * the specified range of x-values. This is equivalent to + * <code>findValueRange(xRange, TimePeriodAnchor.MIDDLE, timeZone)</code>. + * + * @param xRange the subrange of x-values (<code>null</code> not + * permitted). + * @param timeZone the time zone used to convert x-values to time periods + * (<code>null</code> not permitted). + * + * @return The range. + * + * @since 1.0.18 + */ + public Range findValueRange(Range xRange, TimeZone timeZone) { + return findValueRange(xRange, TimePeriodAnchor.MIDDLE, timeZone); + } + + /** + * Finds the range of y-values that fall within the specified range of + * x-values (where the x-values are interpreted as milliseconds since the + * epoch and converted to time periods using the specified timezone). + * + * @param xRange the subset of x-values to use (<coded>null</code> not + * permitted). + * @param xAnchor the anchor point for the x-values (<code>null</code> + * not permitted). + * @param zone the time zone (<code>null</code> not permitted). + * + * @return The range of y-values. + * + * @since 1.0.18 + */ + public Range findValueRange(Range xRange, TimePeriodAnchor xAnchor, + TimeZone zone) { + ParamChecks.nullNotPermitted(xRange, "xRange"); + ParamChecks.nullNotPermitted(xAnchor, "xAnchor"); + ParamChecks.nullNotPermitted(zone, "zone"); + if (this.data.isEmpty()) { + return null; + } + Calendar calendar = Calendar.getInstance(zone); + // since the items are ordered, we could be more clever here and avoid + // iterating over all the data + double lowY = Double.POSITIVE_INFINITY; + double highY = Double.NEGATIVE_INFINITY; + for (int i = 0; i < this.data.size(); i++) { + TimeSeriesDataItem item = (TimeSeriesDataItem) this.data.get(i); + long millis = item.getPeriod().getMillisecond(xAnchor, calendar); + if (xRange.contains(millis)) { + Number n = item.getValue(); + if (n != null) { + double v = n.doubleValue(); + lowY = Math.min(lowY, v); + highY = Math.max(highY, v); + } + } + } + if (Double.isInfinite(lowY) && Double.isInfinite(highY)) { + if (lowY < highY) { + return new Range(lowY, highY); + } else { + return new Range(Double.NaN, Double.NaN); + } + } + return new Range(lowY, highY); + } + + /** + * Returns the smallest y-value in the series, ignoring any + * <code>null</code> and <code>Double.NaN</code> values. This method + * returns <code>Double.NaN</code> if there is no smallest y-value (for + * example, when the series is empty). * * @return The smallest y-value. * @@ -348,8 +437,9 @@ } /** - * Returns the largest y-value in the series, ignoring any Double.NaN - * values. This method returns Double.NaN if there is no largest y-value + * Returns the largest y-value in the series, ignoring any + * <code>null</code> and <code>Double.NaN</code> values. This method + * returns <code>Double.NaN</code> if there is no largest y-value * (for example, when the series is empty). * * @return The largest y-value. @@ -732,7 +822,7 @@ } item.setValue(value); if (iterate) { - findBoundsByIteration(); + updateMinMaxYByIteration(); } else if (value != null) { double yy = value.doubleValue(); @@ -837,7 +927,7 @@ } existing.setValue(item.getValue()); if (iterate) { - findBoundsByIteration(); + updateMinMaxYByIteration(); } else if (item.getValue() != null) { double yy = item.getValue().doubleValue(); @@ -884,7 +974,7 @@ removed = true; } if (removed) { - findBoundsByIteration(); + updateMinMaxYByIteration(); if (notify) { fireSeriesChanged(); } @@ -936,7 +1026,7 @@ removed = true; } if (removed) { - findBoundsByIteration(); + updateMinMaxYByIteration(); if (notify) { fireSeriesChanged(); } @@ -1004,7 +1094,7 @@ for (int i = 0; i <= (end - start); i++) { this.data.remove(start); } - findBoundsByIteration(); + updateMinMaxYByIteration(); if (this.data.isEmpty()) { this.timePeriodClass = null; } @@ -1229,7 +1319,7 @@ double y = yN.doubleValue(); if (!Double.isNaN(y)) { if (y <= this.minY || y >= this.maxY) { - findBoundsByIteration(); + updateMinMaxYByIteration(); } } } @@ -1241,7 +1331,7 @@ * * @since 1.0.14 */ - private void findBoundsByIteration() { + private void updateMinMaxYByIteration() { this.minY = Double.NaN; this.maxY = Double.NaN; Iterator iterator = this.data.iterator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 08:27:49
|
Revision: 3082 http://sourceforge.net/p/jfreechart/code/3082 Author: mungady Date: 2014-02-23 08:27:46 +0000 (Sun, 23 Feb 2014) Log Message: ----------- Added test. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/RangeTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/RangeTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/RangeTest.java 2014-02-23 08:22:56 UTC (rev 3081) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/RangeTest.java 2014-02-23 08:27:46 UTC (rev 3082) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------- * RangeTest.java * -------------- - * (C) Copyright 2003-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2003-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Sergei Ivanov; @@ -37,7 +37,8 @@ * 14-Aug-2003 : Version 1 (DG); * 18-Dec-2007 : Additional tests from Sergei Ivanov (DG); * 08-Jan-2012 : Added test for combine() method (DG); - * + * 23-Feb-2014 : Added isNaNRange() test (DG); + * */ package org.jfree.data; @@ -78,7 +79,6 @@ */ @Test public void testEquals() { - Range r1 = new Range(0.0, 1.0); Range r2 = new Range(0.0, 1.0); assertEquals(r1, r2); @@ -346,4 +346,12 @@ assertEquals(1.0, rr.getLowerBound(), EPSILON); assertEquals(2.0, rr.getUpperBound(), EPSILON); } + + @Test + public void testIsNaNRange() { + assertTrue(new Range(Double.NaN, Double.NaN).isNaNRange()); + assertFalse(new Range(1.0, 2.0).isNaNRange()); + assertFalse(new Range(Double.NaN, 2.0).isNaNRange()); + assertFalse(new Range(1.0, Double.NaN).isNaNRange()); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 08:23:00
|
Revision: 3081 http://sourceforge.net/p/jfreechart/code/3081 Author: mungady Date: 2014-02-23 08:22:56 +0000 (Sun, 23 Feb 2014) Log Message: ----------- 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/Range.java (isNaNRange): New method. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/Range.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/Range.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/Range.java 2014-02-23 07:02:50 UTC (rev 3080) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/Range.java 2014-02-23 08:22:56 UTC (rev 3081) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ---------- * Range.java * ---------- - * (C) Copyright 2002-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2002-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Chuanhao Chiu; @@ -57,7 +57,8 @@ * 18-Dec-2007 : New methods intersects(Range) and scale(...) thanks to Sergei * Ivanov (DG); * 08-Jan-2012 : New method combineIgnoringNaN() (DG); - * + * 23-Feb-2014 : Added isNaNRange() method (DG); + * */ package org.jfree.data; @@ -225,7 +226,9 @@ } /** - * Combines two ranges. This method has a special handling for Double.NaN. + * Returns a new range that spans both <code>range1</code> and + * <code>range2</code>. This method has a special handling to ignore + * Double.NaN values. * * @param range1 the first range (<code>null</code> permitted). * @param range2 the second range (<code>null</code> permitted). @@ -245,7 +248,7 @@ double u = max(range1.getUpperBound(), range2.getUpperBound()); return new Range(l, u); } - + private static double min(double d1, double d2) { if (Double.isNaN(d1)) { return d2; @@ -416,6 +419,18 @@ } /** + * Returns <code>true</code> if both the lower and upper bounds are + * <code>Double.NaN</code>, and <code>false</code> otherwise. + * + * @return A boolean. + * + * @since 1.0.18 + */ + public boolean isNaNRange() { + return Double.isNaN(this.lower) && Double.isNaN(this.upper); + } + + /** * Returns a hash code. * * @return A hash code. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 07:02:54
|
Revision: 3080 http://sourceforge.net/p/jfreechart/code/3080 Author: mungady Date: 2014-02-23 07:02:50 +0000 (Sun, 23 Feb 2014) Log Message: ----------- 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/time/RegularTimePeriod.java (getMillisecond) : New method. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-23 07:02:38 UTC (rev 3079) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-23 07:02:50 UTC (rev 3080) @@ -1,3 +1,8 @@ +2014-02-23 David Gilbert <dav...@ob...> + + * org/jfree/data/time/RegularTimePeriod.java + (getMillisecond) : New method. + 2014-02-04 David Gilbert <dav...@ob...> GitHub #298 by Simon Legner: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-23 07:02:41
|
Revision: 3079 http://sourceforge.net/p/jfreechart/code/3079 Author: mungady Date: 2014-02-23 07:02:38 +0000 (Sun, 23 Feb 2014) Log Message: ----------- 2014-02-23 David Gilbert <dav...@ob...> * org/jfree/data/time/RegularTimePeriod.java (getMillisecond) : New method. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/RegularTimePeriod.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/RegularTimePeriod.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/RegularTimePeriod.java 2014-02-04 16:26:41 UTC (rev 3078) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/RegularTimePeriod.java 2014-02-23 07:02:38 UTC (rev 3079) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ---------------------- * RegularTimePeriod.java * ---------------------- - * (C) Copyright 2001-2008, by Object Refinery Limited. + * (C) Copyright 2001-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -48,7 +48,8 @@ * 06-Oct-2006 : Deprecated the WORKING_CALENDAR field and several methods, * added new peg() method (DG); * 16-Sep-2008 : Deprecated DEFAULT_TIME_ZONE (DG); - * + * 23-Feb-2014 : Added getMillisecond() method (DG); + * */ package org.jfree.data.time; @@ -342,6 +343,30 @@ } /** + * Returns the millisecond (relative to the epoch) corresponding to the + * specified <code>anchor</code> using the supplied <code>calendar</code> + * (which incorporates a time zone). + * + * @param anchor the anchor (<code>null</code> not permitted). + * @param calendar the calendar (<code>null</code> not permitted). + * + * @return Milliseconds since the epoch. + * + * @since 1.0.18 + */ + public long getMillisecond(TimePeriodAnchor anchor, Calendar calendar) { + if (anchor.equals(TimePeriodAnchor.START)) { + return getFirstMillisecond(calendar); + } else if (anchor.equals(TimePeriodAnchor.MIDDLE)) { + return getMiddleMillisecond(calendar); + } else if (anchor.equals(TimePeriodAnchor.END)) { + return getLastMillisecond(calendar); + } else { + throw new IllegalStateException("Unrecognised anchor: " + anchor); + } + } + + /** * Returns a string representation of the time period. * * @return The string. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-04 16:26:44
|
Revision: 3078 http://sourceforge.net/p/jfreechart/code/3078 Author: mungady Date: 2014-02-04 16:26:41 +0000 (Tue, 04 Feb 2014) Log Message: ----------- 2014-02-04 David Gilbert <dav...@ob...> GitHub #298 by Simon Legner: * org/jfree/chart/axis/CompassFormat.java (CompassFormat()): Delegate to new constructors, (CompassFormat(String, String, String, String)): New constructor, (CompassFormat(String[]): Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-04 16:26:31 UTC (rev 3077) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-02-04 16:26:41 UTC (rev 3078) @@ -1,3 +1,27 @@ +2014-02-04 David Gilbert <dav...@ob...> + + GitHub #298 by Simon Legner: + * org/jfree/chart/axis/CompassFormat.java + (CompassFormat()): Delegate to new constructors, + (CompassFormat(String, String, String, String)): New constructor, + (CompassFormat(String[]): Likewise. + +2014-01-11 David Gilbert <dav...@ob...> + + * org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java + (fillDomainGridBand): Fix rectangle dimension for vertical orientation. + +2014-01-09 David Gilbert <dav...@ob...> + + * org/jfree/data/xy/VectorSeries.java + (add(VectorDataItem, boolean)): New method, + * org/jfree/data/xy/XIntervalSeries.java + (add(XIntervalDataItem, boolean)): New method, + * org/jfree/data/xy/XYIntervalSeries.java + (add(XYIntervalDataItem, boolean)): New method, + * org/jfree/data/xy/YIntervalSeries.java + (add(YIntervalDataItem, boolean)): New method. + 2013-12-05 David Gilbert <dav...@ob...> Patch from Lukasz Rzeszotarski: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-02-04 16:26:36
|
Revision: 3077 http://sourceforge.net/p/jfreechart/code/3077 Author: mungady Date: 2014-02-04 16:26:31 +0000 (Tue, 04 Feb 2014) Log Message: ----------- 2014-02-04 David Gilbert <dav...@ob...> GitHub #298 by Simon Legner: * org/jfree/chart/axis/CompassFormat.java (CompassFormat()): Delegate to new constructors, (CompassFormat(String, String, String, String)): New constructor, (CompassFormat(String[]): Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CompassFormat.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CompassFormat.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CompassFormat.java 2014-01-27 10:45:38 UTC (rev 3076) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CompassFormat.java 2014-02-04 16:26:31 UTC (rev 3077) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,15 +27,17 @@ * ------------------ * CompassFormat.java * ------------------ - * (C) Copyright 2003-2008, by Sylvain Vieujot and Contributors. + * (C) Copyright 2003-2014, by Sylvain Vieujot and Contributors. * * Original Author: Sylvain Vieujot; * Contributor(s): David Gilbert (for Object Refinery Limited); + * Simon Legner (GitHub #298); * * Changes * ------- * 18-Feb-2004 : Version 1 contributed by Sylvain Vieujot (DG); - * + * 04-Feb-2014 : Make direction strings user-definable (SL); + * */ package org.jfree.chart.axis; @@ -43,35 +45,52 @@ import java.text.FieldPosition; import java.text.NumberFormat; import java.text.ParsePosition; +import org.jfree.chart.util.ParamChecks; /** * A formatter that displays numbers as directions. */ public class CompassFormat extends NumberFormat { - /** North. */ - private static final String N = "N"; + /** The directions. */ + public final String[] directions; - /** East. */ - private static final String E = "E"; + /** + * Creates a new formatter using English identifiers. + */ + public CompassFormat() { + this("N", "E", "S", "W"); + } - /** South. */ - private static final String S = "S"; + /** + * Creates a new formatter using the specified identifiers for + * the base wind directions. + * + * @since 1.0.18 + */ + public CompassFormat(String n, String e, String s, String w) { + this(new String[] { + n, n + n + e, n + e, e + n + e, e, e + s + e, s + e, s + s + e, s, + s + s + w, s + w, w + s + w, w, w + n + w, n + w, n + n + w + }); + } - /** West. */ - private static final String W = "W"; - - /** The directions. */ - public static final String[] DIRECTIONS = { - N, N + N + E, N + E, E + N + E, E, E + S + E, S + E, S + S + E, S, - S + S + W, S + W, W + S + W, W, W + N + W, N + W, N + N + W, N - }; - /** - * Creates a new formatter. + * Creates a new formatter using the specified identifiers. + * + * @param directions an array containing 16 strings representing + * the directions of a compass. + * + * @since 1.0.18 */ - public CompassFormat() { + public CompassFormat(String[] directions) { super(); + ParamChecks.nullNotPermitted(directions, "directions"); + if (directions.length != 16) { + throw new IllegalArgumentException("The 'directions' array must " + + "contain exactly 16 elements"); + } + this.directions = directions; } /** @@ -82,14 +101,12 @@ * @return A string. */ public String getDirectionCode(double direction) { - direction = direction % 360; if (direction < 0.0) { direction = direction + 360.0; } int index = ((int) Math.floor(direction / 11.25) + 1) / 2; - return DIRECTIONS[index]; - + return directions[index]; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-01-27 10:45:41
|
Revision: 3076 http://sourceforge.net/p/jfreechart/code/3076 Author: mungady Date: 2014-01-27 10:45:38 +0000 (Mon, 27 Jan 2014) Log Message: ----------- Fix Javadoc typo. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2014-01-11 13:25:52 UTC (rev 3075) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2014-01-27 10:45:38 UTC (rev 3076) @@ -414,7 +414,7 @@ * convenience method that converts the string into an * <code>AttributedString</code> using the current font attributes. * - * @param label the label (<code>null</<code> permitted). + * @param label the label (<code>null</code> permitted). * * @since 1.0.16 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-01-11 13:25:56
|
Revision: 3075 http://sourceforge.net/p/jfreechart/code/3075 Author: mungady Date: 2014-01-11 13:25:52 +0000 (Sat, 11 Jan 2014) Log Message: ----------- 2014-01-11 David Gilbert <dav...@ob...> * org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java (fillDomainGridBand): Fix rectangle dimension for vertical orientation. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2014-01-09 11:33:25 UTC (rev 3074) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2014-01-11 13:25:52 UTC (rev 3075) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------------------------- * AbstractXYItemRenderer.java * --------------------------- - * (C) Copyright 2002-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2002-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Richard Atkinson; @@ -119,6 +119,7 @@ * annotations (DG); * 06-Oct-2011 : Add utility methods to work with 1.4 API in GeneralPath (MK) * 03-Jul-2013 : Use ParamChecks (DG); + * 11-Jan-2014 : Fix error in fillDomainGridBand method (DG); * */ @@ -894,7 +895,7 @@ Rectangle2D band; if (plot.getOrientation() == PlotOrientation.VERTICAL) { band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), - Math.abs(x2 - x1), dataArea.getWidth()); + Math.abs(x2 - x1), dataArea.getHeight()); } else { band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-01-09 11:33:29
|
Revision: 3074 http://sourceforge.net/p/jfreechart/code/3074 Author: mungady Date: 2014-01-09 11:33:25 +0000 (Thu, 09 Jan 2014) Log Message: ----------- 2014-01-09 David Gilbert <dav...@ob...> * org/jfree/data/xy/VectorSeries.java (add(VectorDataItem, boolean)): New method, * org/jfree/data/xy/XIntervalSeries.java (add(XIntervalDataItem, boolean)): New method, * org/jfree/data/xy/XYIntervalSeries.java (add(XYIntervalDataItem, boolean)): New method, * org/jfree/data/xy/YIntervalSeries.java (add(YIntervalDataItem, boolean)): New method. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/VectorSeries.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XIntervalSeries.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XYIntervalSeries.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/YIntervalSeries.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/VectorSeries.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/VectorSeries.java 2013-12-06 08:40:35 UTC (rev 3073) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/VectorSeries.java 2014-01-09 11:33:25 UTC (rev 3074) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ----------------- * VectorSeries.java * ----------------- - * (C) Copyright 2007, 2008, by Object Refinery Limited. + * (C) Copyright 2007-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -40,6 +40,7 @@ * 25-May-2007 : Added remove(int) and clear() methods, and moved from the * experimental to the main source tree (DG); * 27-Nov-2007 : Removed redundant clear() method (DG); + * 09-Jan-2014 : Added add(VectorDataItem, boolean) method (DG); * */ @@ -47,7 +48,6 @@ import org.jfree.data.ComparableObjectItem; import org.jfree.data.ComparableObjectSeries; -import org.jfree.data.general.SeriesChangeEvent; /** * A list of (x,y, deltaX, deltaY) data items. @@ -91,8 +91,21 @@ * @param deltaY the vector y. */ public void add(double x, double y, double deltaX, double deltaY) { - super.add(new VectorDataItem(x, y, deltaX, deltaY), true); + add(new VectorDataItem(x, y, deltaX, deltaY), true); } + + /** + * Adds a data item to the series and, if requested, sends a + * {@link SeriesChangeEvent} to all registered listeners. + * + * @param item the data item (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @since 1.0.18 + */ + public void add(VectorDataItem item, boolean notify) { + super.add(item, notify); + } /** * Removes the item at the specified index and sends a Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XIntervalSeries.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XIntervalSeries.java 2013-12-06 08:40:35 UTC (rev 3073) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XIntervalSeries.java 2014-01-09 11:33:25 UTC (rev 3074) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------------- * XIntervalSeries.java * -------------------- - * (C) Copyright 2006-2008, by Object Refinery Limited. + * (C) Copyright 2006-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,6 +36,7 @@ * ------- * 20-Oct-2006 : Version 1 (DG); * 11-Apr-2008 : Added getXLowValue() and getXHighValue() methods (DG); + * 09-Jan-2014 : Added add(XIntervalDataItem, boolean) method (DG); * */ @@ -80,7 +81,8 @@ } /** - * Adds a data item to the series. + * Adds a data item to the series and sends a {@link SeriesChangeEvent} to + * all registered listeners. * * @param x the x-value. * @param y the y-value. @@ -88,10 +90,23 @@ * @param xHigh the upper bound of the y-interval. */ public void add(double x, double xLow, double xHigh, double y) { - super.add(new XIntervalDataItem(x, xLow, xHigh, y), true); + add(new XIntervalDataItem(x, xLow, xHigh, y), true); } /** + * Adds a data item to the series and, if requested, sends a + * {@link SeriesChangeEvent} to all registered listeners. + * + * @param item the data item (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @since 1.0.18 + */ + public void add(XIntervalDataItem item, boolean notify) { + super.add(item, notify); + } + + /** * Returns the x-value for the specified item. * * @param index the item index. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XYIntervalSeries.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XYIntervalSeries.java 2013-12-06 08:40:35 UTC (rev 3073) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/XYIntervalSeries.java 2014-01-09 11:33:25 UTC (rev 3074) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------------------- * XYIntervalSeries.java * --------------------- - * (C) Copyright 2006-2008, by Object Refinery Limited. + * (C) Copyright 2006-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,6 +36,7 @@ * ------- * 20-Oct-2006 : Version 1 (DG); * 13-Feb-2007 : Added several new accessor methods (DG); + * 09-Jan-2014 : Added add(XYIntervalDataItem, boolean) method (DG); * */ @@ -80,7 +81,8 @@ } /** - * Adds a data item to the series. + * Adds a data item to the series and sends a {@link SeriesChangeEvent} to + * all registered listeners. * * @param x the x-value. * @param xLow the lower bound of the x-interval. @@ -91,8 +93,21 @@ */ public void add(double x, double xLow, double xHigh, double y, double yLow, double yHigh) { - super.add(new XYIntervalDataItem(x, xLow, xHigh, y, yLow, yHigh), true); + add(new XYIntervalDataItem(x, xLow, xHigh, y, yLow, yHigh), true); } + + /** + * Adds a data item to the series and, if requested, sends a + * {@link SeriesChangeEvent} to all registered listeners. + * + * @param item the data item (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @since 1.0.18 + */ + public void add(XYIntervalDataItem item, boolean notify) { + super.add(item, notify); + } /** * Returns the x-value for the specified item. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/YIntervalSeries.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/YIntervalSeries.java 2013-12-06 08:40:35 UTC (rev 3073) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/xy/YIntervalSeries.java 2014-01-09 11:33:25 UTC (rev 3074) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------------- * YIntervalSeries.java * -------------------- - * (C) Copyright 2006-2008, by Object Refinery Limited. + * (C) Copyright 2006-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,6 +36,7 @@ * ------- * 20-Oct-2006 : Version 1 (DG); * 20-Feb-2007 : Added getYHighValue() and getYLowValue() methods (DG); + * 09-Jan-2014 : Added add(YIntervalDataItem, boolean) method (DG); * */ @@ -80,7 +81,8 @@ } /** - * Adds a data item to the series. + * Adds a data item to the series and sends a {@link SeriesChangeEvent} to + * all registered listeners. * * @param x the x-value. * @param y the y-value. @@ -88,8 +90,21 @@ * @param yHigh the upper bound of the y-interval. */ public void add(double x, double y, double yLow, double yHigh) { - super.add(new YIntervalDataItem(x, y, yLow, yHigh), true); + add(new YIntervalDataItem(x, y, yLow, yHigh), true); } + + /** + * Adds a data item to the series and, if requested, sends a + * {@link SeriesChangeEvent} to all registered listeners. + * + * @param item the data item (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @since 1.0.18 + */ + public void add(YIntervalDataItem item, boolean notify) { + super.add(item, notify); + } /** * Returns the x-value for the specified item. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2013-12-06 08:40:38
|
Revision: 3073 http://sourceforge.net/p/jfreechart/code/3073 Author: mungady Date: 2013-12-06 08:40:35 +0000 (Fri, 06 Dec 2013) Log Message: ----------- 2013-12-05 David Gilbert <dav...@ob...> Patch from Lukasz Rzeszotarski: * org/jfree/chart/renderer/xy/XYStepAreaRenderer.java (stepPoint): New field, (XYStepAreaRenderer): Initialise stepPoint; (getStepPoint): New method, (setStepPoint): Likewise, (drawItem): Calculate step point, (equals): Add check for stepPoint attribute. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/renderer/xy/XYStepAreaRendererTest.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/renderer/xy/XYStepAreaRendererTest.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/renderer/xy/XYStepAreaRendererTest.java 2013-12-06 08:39:30 UTC (rev 3072) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/renderer/xy/XYStepAreaRendererTest.java 2013-12-06 08:40:35 UTC (rev 3073) @@ -39,6 +39,7 @@ * testing XYStepAreaRenderer (MR); * 14-Feb-2007 : Extended testEquals() (DG); * 22-Apr-2008 : Added testPublicCloneable (DG); + * 05-Dec-2013 : Add stepPoint to equals() test (DG); * */ @@ -96,6 +97,12 @@ assertFalse(r1.equals(r2)); r2.setRangeBase(-1.0); assertTrue(r1.equals(r2)); + + r1.setStepPoint(0.33); + assertFalse(r1.equals(r2)); + r2.setStepPoint(0.33); + assertTrue(r1.equals(r2)); + } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |