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-08-22 13:25:45
|
Revision: 3297 http://sourceforge.net/p/jfreechart/code/3297 Author: mungady Date: 2014-08-22 13:25:34 +0000 (Fri, 22 Aug 2014) Log Message: ----------- Switch off ChartPanel buffer for improved appearance on retina displays. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/demo/BarChartDemo1.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/demo/BarChartDemo1.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/demo/BarChartDemo1.java 2014-08-04 21:39:37 UTC (rev 3296) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/demo/BarChartDemo1.java 2014-08-22 13:25:34 UTC (rev 3297) @@ -82,7 +82,7 @@ super(title); CategoryDataset dataset = createDataset(); JFreeChart chart = createChart(dataset); - ChartPanel chartPanel = new ChartPanel(chart); + ChartPanel chartPanel = new ChartPanel(chart, false); chartPanel.setFillZoomRectangle(true); chartPanel.setMouseWheelEnabled(true); chartPanel.setPreferredSize(new Dimension(500, 270)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 21:39:43
|
Revision: 3296 http://sourceforge.net/p/jfreechart/code/3296 Author: mungady Date: 2014-08-04 21:39:37 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Update build scripts. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ant/build-fx.xml branches/jfreechart-1.0.x-branch/ant/build-swt.xml branches/jfreechart-1.0.x-branch/ant/build.xml Modified: branches/jfreechart-1.0.x-branch/ant/build-fx.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2014-08-04 21:38:11 UTC (rev 3295) +++ branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2014-08-04 21:39:37 UTC (rev 3296) @@ -20,13 +20,13 @@ <target name="initialise" description="Initialise required settings."> <tstamp /> <property name="jfreechart.name" value="jfreechart" /> - <property name="jfreechart.version" value="1.0.19-fx" /> + <property name="jfreechart.version" value="1.0.20-fx-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.23" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreesvg.name" value="jfreesvg" /> - <property name="jfreesvg.version" value="2.0" /> + <property name="jfreesvg.version" value="2.1" /> <property name="orsonpdf.name" value="orsonpdf" /> <property name="orsonpdf.version" value="1.6-eval" /> <property name="orsoncharts.version" value="1.4-eval" /> Modified: branches/jfreechart-1.0.x-branch/ant/build-swt.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build-swt.xml 2014-08-04 21:38:11 UTC (rev 3295) +++ branches/jfreechart-1.0.x-branch/ant/build-swt.xml 2014-08-04 21:39:37 UTC (rev 3296) @@ -4,7 +4,7 @@ <target name="initialise" description="Initialise required settings."> <tstamp /> <property name="jfreechart.name" value="jfreechart" /> - <property name="jfreechart.version" value="1.0.19" /> + <property name="jfreechart.version" value="1.0.20-pre" /> <property name="jcommon.name" value="jcommon" /> <property name="jcommon.version" value="1.0.23" /> <property name="builddir" value="${basedir}/build" /> Modified: branches/jfreechart-1.0.x-branch/ant/build.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build.xml 2014-08-04 21:38:11 UTC (rev 3295) +++ branches/jfreechart-1.0.x-branch/ant/build.xml 2014-08-04 21:39:37 UTC (rev 3296) @@ -20,13 +20,13 @@ <target name="initialise" description="Initialise required settings."> <tstamp /> <property name="jfreechart.name" value="jfreechart" /> - <property name="jfreechart.version" value="1.0.19" /> + <property name="jfreechart.version" value="1.0.20-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.23" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreesvg.name" value="jfreesvg" /> - <property name="jfreesvg.version" value="2.0" /> + <property name="jfreesvg.version" value="2.1" /> <property name="orsonpdf.name" value="orsonpdf" /> <property name="orsonpdf.version" value="1.6-eval" /> <property name="orsoncharts.version" value="1.4-eval-nofx" /> @@ -248,6 +248,11 @@ </fileset> </copy> + <copy todir="${basedir}/distribution/svg"> + <fileset dir="${basedir}/svg"> + </fileset> + </copy> + <copy todir="${basedir}/distribution/docfiles"> <fileset dir="${basedir}/docfiles"> </fileset> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 21:38:21
|
Revision: 3295 http://sourceforge.net/p/jfreechart/code/3295 Author: mungady Date: 2014-08-04 21:38:11 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Add JavaScript support files for enhanced SVG export (work in progress). Added Paths: ----------- branches/jfreechart-1.0.x-branch/svg/ branches/jfreechart-1.0.x-branch/svg/EQTBarChartDemo1.html branches/jfreechart-1.0.x-branch/svg/js/ branches/jfreechart-1.0.x-branch/svg/js/README.txt branches/jfreechart-1.0.x-branch/svg/js/build.sh branches/jfreechart-1.0.x-branch/svg/js/jfreechart_utils.js branches/jfreechart-1.0.x-branch/svg/js/src/ branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValueLabels.js branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValuesDataset.js branches/jfreechart-1.0.x-branch/svg/js/src/Utils.js branches/jfreechart-1.0.x-branch/svg/lib/ branches/jfreechart-1.0.x-branch/svg/lib/jfreechart_utils.js Added: branches/jfreechart-1.0.x-branch/svg/EQTBarChartDemo1.html =================================================================== --- branches/jfreechart-1.0.x-branch/svg/EQTBarChartDemo1.html (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/EQTBarChartDemo1.html 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> +<head> +<title>EQTBarChartDemo1</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<script src="lib/opentip-native.js"></script><link href="css/opentip.css" rel="stylesheet" type="text/css" /><script src="lib/jfreechart_utils.js"></script></head> +<body> +<h1>EQTBarChartDemo1</h1> +<p>Click on an item in the chart or just hover and look at the tooltip (the reference is a string in JSON format that should contain enough information to identify the chart element):</p> + <script type="application/javascript"> + function barChartData() { + return {"columnKeys": ["Warm-up", "Test"], "rows": [["JFreeSVG", [7445.0, 4297.0]], ["Batik", [24448.0, 21022.0]]]} + } + </script> + <script type="application/javascript"> + // wait until all the resources are loaded + window.addEventListener("load", initialise, false); + function initialise() { + var barSVG = document.getElementById("chart1"); + barSVG.onclick = handleClick; + } + function handleClick(evt) { + var element = evt.target; + var ref = jfc.Utils.findChartRef(element); + var chartId = jfc.Utils.findChartId(element); + alert('You clicked on the item ' + ref + ' for the chart [' + chartId + ']'); + } +</script> +<p> +<svg id="chart1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:jfreesvg="http://www.jfree.org/jfreesvg/svg" width="600" height="370" text-rendering="auto" shape-rendering="auto"> +<defs><linearGradient id="defs2_gp0" x1="107.3" y1="0" x2="114" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,85,85);"/><stop offset="100%" style="stop-color: rgb(255,255,255);"/></linearGradient> +<linearGradient id="defs2_gp13" x1="506" y1="0" x2="512" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,255,255);"/><stop offset="100%" style="stop-color: rgb(85,85,255);"/></linearGradient> +<linearGradient id="defs2_gp14" x1="512" y1="0" x2="550" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(85,85,255);"/><stop offset="100%" style="stop-color: rgb(121,121,255);"/></linearGradient> +<linearGradient id="defs2_gp8" x1="385.6" y1="0" x2="392" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,85,85);"/><stop offset="100%" style="stop-color: rgb(255,255,255);"/></linearGradient> +<linearGradient id="defs2_gp6" x1="234" y1="0" x2="272" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(85,85,255);"/><stop offset="100%" style="stop-color: rgb(121,121,255);"/></linearGradient> +<linearGradient id="defs2_gp10" x1="398" y1="0" x2="436" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,85,85);"/><stop offset="100%" style="stop-color: rgb(255,121,121);"/></linearGradient> +<linearGradient id="defs2_gp2" x1="120" y1="0" x2="158" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,85,85);"/><stop offset="100%" style="stop-color: rgb(255,121,121);"/></linearGradient> +<linearGradient id="defs2_gp9" x1="392" y1="0" x2="398" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,255,255);"/><stop offset="100%" style="stop-color: rgb(255,85,85);"/></linearGradient> +<linearGradient id="defs2_gp7" x1="272" y1="0" x2="284.4" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(121,121,255);"/><stop offset="100%" style="stop-color: rgb(85,85,255);"/></linearGradient> +<linearGradient id="defs2_gp11" x1="436" y1="0" x2="448.85" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,121,121);"/><stop offset="100%" style="stop-color: rgb(255,85,85);"/></linearGradient> +<linearGradient id="defs2_gp3" x1="158" y1="0" x2="170.55" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,121,121);"/><stop offset="100%" style="stop-color: rgb(255,85,85);"/></linearGradient> +<linearGradient id="defs2_gp15" x1="550" y1="0" x2="562.7" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(121,121,255);"/><stop offset="100%" style="stop-color: rgb(85,85,255);"/></linearGradient> +<linearGradient id="defs2_gp12" x1="499.45" y1="0" x2="506" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(85,85,255);"/><stop offset="100%" style="stop-color: rgb(255,255,255);"/></linearGradient> +<linearGradient id="defs2_gp1" x1="114" y1="0" x2="120" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,255,255);"/><stop offset="100%" style="stop-color: rgb(255,85,85);"/></linearGradient> +<linearGradient id="defs2_gp4" x1="221.15" y1="0" x2="227" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(85,85,255);"/><stop offset="100%" style="stop-color: rgb(255,255,255);"/></linearGradient> +<linearGradient id="defs2_gp5" x1="227" y1="0" x2="234" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color: rgb(255,255,255);"/><stop offset="100%" style="stop-color: rgb(85,85,255);"/></linearGradient> +<clipPath id="defs2_clip-0"><path d="M 0 0 L 600 0 L 600 370 L 0 370 L 0 0 M 0 0"/></clipPath> +<clipPath id="defs2_clip-1"><path d="M 203.55 164.45 L 203.55 764.45 L -166.45 764.45 L -166.45 164.45 L 203.55 164.45 M 203.55 164.45"/></clipPath> +<clipPath id="defs2_clip-2"><path d="M 82 51 L 82 317 L 588 317 L 588 51 M 82 51"/></clipPath> +</defs> +<g id="chart1" jfreesvg:ref="JFREECHART_TOP_LEVEL"><rect x="0" y="0" width="600" height="370" style="fill: rgb(255,255,255); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="137.5" y="21.01" style="fill: rgb(0,0,0); fill-opacity: 1.0; font-family: Tahoma; font-size: 20px; font-weight: bold; " clip-path="url(#defs2_clip-0)">Performance: JFreeSVG vs Batik</text></g><rect x="244.5" y="348.52" width="111" height="20.48" style="fill: rgb(255,255,255); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g style="fill: rgb(255,85,85); fill-opacity: 1.0; stroke: none" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"><path d="M 247.5 354.76 L 255.5 354.76 L 255.5 362.76 L 247.5 362.76 L 247.5 354.76 M 247.5 354.76"/></g><g transform="matrix(1,0,0,1,0,0)"><text x="259.5" y="363.52" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">JFreeSVG</text></g><g style="fill: rgb(85,85,255); fill-opacity: 1.0; stroke: none" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"><path d="M 314.5 354.76 L 322.5 354.76 L 322.5 362.76 L 314.5 362.76 L 314.5 354.76 M 314.5 354.76"/></g><g transform="matrix(1,0,0,1,0,0)"><text x="326.5" y="363.52" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">Batik</text></g><g transform="matrix(1,0,0,1,0,0)"><text x="56" y="38.74" style="fill: rgb(0,0,0); fill-opacity: 1.0; font-family: sans-serif; font-size: 12px; font-weight: bold; " clip-path="url(#defs2_clip-0)">Time to generate 1000 charts in SVG format (lower bars = better performance)</text></g><rect x="82" y="51" width="506" height="266" style="fill: rgb(192,192,192); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><line x1="82" y1="321" x2="588" y2="321" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><line x1="195.85" y1="321" x2="195.85" y2="321" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><line x1="195.85" y1="321" x2="195.85" y2="323" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><line x1="474.15" y1="321" x2="474.15" y2="321" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><line x1="474.15" y1="321" x2="474.15" y2="323" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="171.35" y="339.01" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">Warm-up</text></g><g transform="matrix(1,0,0,1,0,0)"><text x="463.15" y="339.01" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">Test</text></g><line x1="78" y1="51" x2="78" y2="317" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="65" y="321.76" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">0</text></g><line x1="76" y1="317" x2="78" y2="317" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="40" y="301.04" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">2,000</text></g><line x1="76" y1="296.28" x2="78" y2="296.28" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="40" y="280.32" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">4,000</text></g><line x1="76" y1="275.55" x2="78" y2="275.55" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="40" y="259.59" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">6,000</text></g><line x1="76" y1="254.83" x2="78" y2="254.83" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="40" y="238.87" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">8,000</text></g><line x1="76" y1="234.1" x2="78" y2="234.1" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="218.14" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">10,000</text></g><line x1="76" y1="213.38" x2="78" y2="213.38" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="197.42" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">12,000</text></g><line x1="76" y1="192.65" x2="78" y2="192.65" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="176.69" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">14,000</text></g><line x1="76" y1="171.93" x2="78" y2="171.93" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="155.97" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">16,000</text></g><line x1="76" y1="151.21" x2="78" y2="151.21" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="135.25" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">18,000</text></g><line x1="76" y1="130.48" x2="78" y2="130.48" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="114.52" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">20,000</text></g><line x1="76" y1="109.76" x2="78" y2="109.76" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="93.8" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">22,000</text></g><line x1="76" y1="89.03" x2="78" y2="89.03" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(1,0,0,1,0,0)"><text x="33" y="73.07" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 12px; " clip-path="url(#defs2_clip-0)">24,000</text></g><line x1="76" y1="68.31" x2="78" y2="68.31" style="stroke-width: 0.5;stroke: rgb(128,128,128);stroke-opacity: 1.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/><g transform="matrix(0,-1,1,0,-164.449219,203.550781)"><text x="-22.95" y="189.56" style="fill: rgb(64,64,64); fill-opacity: 1.0; font-family: Tahoma; font-size: 14px; font-weight: bold; " clip-path="url(#defs2_clip-1)">Milliseconds</text></g><line x1="82" y1="317" x2="588" y2="317" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="296.28" x2="588" y2="296.28" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="275.55" x2="588" y2="275.55" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="254.83" x2="588" y2="254.83" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="234.1" x2="588" y2="234.1" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="213.38" x2="588" y2="213.38" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="192.65" x2="588" y2="192.65" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="171.93" x2="588" y2="171.93" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="151.21" x2="588" y2="151.21" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="130.48" x2="588" y2="130.48" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="109.76" x2="588" y2="109.76" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="89.03" x2="588" y2="89.03" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><line x1="82" y1="68.31" x2="588" y2="68.31" style="stroke-width: 0.5;stroke: rgb(255,255,255);stroke-opacity: 1.0;stroke-dasharray: 2.0, 2.0;shape-rendering:crispEdges;" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><g jfreesvg:ref="{"rowKey": "JFreeSVG", "columnKey": "Warm-up"}"><rect x="107.3" y="239.85" width="6.7" height="77.15" style="fill: url(#defs2_gp0); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="114" y="239.85" width="6" height="77.15" style="fill: url(#defs2_gp1); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="120" y="239.85" width="38" height="77.15" style="fill: url(#defs2_gp2); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="158" y="239.85" width="12.55" height="77.15" style="fill: url(#defs2_gp3); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/></g> +<g jfreesvg:ref="{"rowKey": "Batik", "columnKey": "Warm-up"}"><rect x="221.15" y="63.67" width="5.85" height="253.33" style="fill: url(#defs2_gp4); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="227" y="63.67" width="7" height="253.33" style="fill: url(#defs2_gp5); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="234" y="63.67" width="38" height="253.33" style="fill: url(#defs2_gp6); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="272" y="63.67" width="12.4" height="253.33" style="fill: url(#defs2_gp7); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/></g> +<g jfreesvg:ref="{"rowKey": "JFreeSVG", "columnKey": "Test"}"><rect x="385.6" y="272.47" width="6.4" height="44.53" style="fill: url(#defs2_gp8); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="392" y="272.47" width="6" height="44.53" style="fill: url(#defs2_gp9); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="398" y="272.47" width="38" height="44.53" style="fill: url(#defs2_gp10); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="436" y="272.47" width="12.85" height="44.53" style="fill: url(#defs2_gp11); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/></g> +<g jfreesvg:ref="{"rowKey": "Batik", "columnKey": "Test"}"><rect x="499.45" y="99.17" width="6.55" height="217.83" style="fill: url(#defs2_gp12); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="506" y="99.17" width="6" height="217.83" style="fill: url(#defs2_gp13); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="512" y="99.17" width="38" height="217.83" style="fill: url(#defs2_gp14); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/><rect x="550" y="99.17" width="12.7" height="217.83" style="fill: url(#defs2_gp15); fill-opacity: 1.0" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-2)"/></g> +<rect x="82" y="51" width="506" height="266" style="stroke-width: 0.5;stroke: rgb(0,0,0);stroke-opacity: 1.0;shape-rendering:crispEdges;; fill: none" transform="matrix(1,0,0,1,0,0)" clip-path="url(#defs2_clip-0)"/></g> +</svg> +</p> +</body> +</html> Added: branches/jfreechart-1.0.x-branch/svg/js/README.txt =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/README.txt (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/README.txt 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,8 @@ +JavaScript Utilities +-------------------- + +This directory contains some JavaScript utility code that can be used when exporting charts to SVG format with JFreeSVG. The build.sh script will build the library, but note that it requires the Google Closure Compiler jar file to be on the classpath (please edit the script accordingly). + +https://developers.google.com/closure/compiler/ + +Look in the '???' directory (open ???.html) to see a demo that uses this JavaScript code. Added: branches/jfreechart-1.0.x-branch/svg/js/build.sh =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/build.sh (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/build.sh 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,7 @@ +#!/bin/bash + +java -jar ~/jars/compiler.jar --warning_level VERBOSE --compilation_level WHITESPACE_ONLY \ +--js src/Utils.js \ +--js src/KeyedValuesDataset.js \ +--js src/KeyedValueLabels.js \ +--js_output_file jfreechart_utils.js \ No newline at end of file Property changes on: branches/jfreechart-1.0.x-branch/svg/js/build.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/jfreechart-1.0.x-branch/svg/js/jfreechart_utils.js =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/jfreechart_utils.js (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/jfreechart_utils.js 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,9 @@ +var jfc;if(!jfc)jfc={};jfc.Utils={};jfc.Utils.makeArrayOf=function(value,length){var arr=[],i=length;while(i--)arr[i]=value;return arr};jfc.Utils.findChartRef=function(element){var id=element.getAttribute("jfreesvg:ref");var found=false;var current=element;while(!found){current=current.parentNode;if(current!=null){id=current.getAttribute("jfreesvg:ref");found=id!=null}else found=true}return id}; +jfc.Utils.findChartId=function(element){var id=null;var found=false;var current=element;while(!found){current=current.parentNode;if(current!=null){var ref=current.getAttribute("jfreesvg:ref");if(ref=="JFREECHART_TOP_LEVEL"){found=true;id=current.getAttribute("id")}}else found=true}return id};if(!jfc)jfc={};orsoncharts.KeyedValuesDataset=function(){if(!(this instanceof jfc.KeyedValuesDataset))return new orsoncharts.KeyedValuesDataset;this.data=[];this.listeners=[]};orsoncharts.KeyedValuesDataset.prototype.itemCount=function(){return this.data.length};orsoncharts.KeyedValuesDataset.prototype.isEmpty=function(){return this.data.length===0};orsoncharts.KeyedValuesDataset.prototype.key=function(index){return this.data[index][0]};orsoncharts.KeyedValuesDataset.prototype.keys=function(){return this.data.map(function(d){return d[0]})}; +orsoncharts.KeyedValuesDataset.prototype.indexOf=function(sectionKey){var arrayLength=this.data.length;for(var i=0;i<arrayLength;i++)if(this.data[i][0]===sectionKey)return i;return-1};orsoncharts.KeyedValuesDataset.prototype.valueByIndex=function(index){return this.data[index][1]};orsoncharts.KeyedValuesDataset.prototype.valueByKey=function(sectionKey){var sectionIndex=this.indexOf(sectionKey);if(sectionIndex<0)return null;return this.valueByIndex(sectionIndex)}; +orsoncharts.KeyedValuesDataset.prototype.addListener=function(listenerMethod){this.listeners.push(listenerMethod)};orsoncharts.KeyedValuesDataset.prototype.removeListener=function(listenerMethod){var i=this.listeners.indexOf(listenerMethod);if(i>=0)this.listeners.splice(i,1)};orsoncharts.KeyedValuesDataset.prototype.notifyListeners=function(){};orsoncharts.KeyedValuesDataset.prototype.add=function(sectionKey,value){this.data.push([sectionKey,value])}; +orsoncharts.KeyedValuesDataset.prototype.remove=function(sectionKey){if(!sectionKey)throw new Error("The 'sectionKey' must be defined.");var i=this.indexOf(sectionKey);if(i<0)throw new Error("The sectionKey '"+sectionKey.toString()+"' is not recognised.");this.data.splice(i,1)};orsoncharts.KeyedValuesDataset.prototype.dataFromJSON=function(jsonStr){this.data=JSON.parse(jsonStr);this.notifyListeners()}; +orsoncharts.KeyedValuesDataset.prototype.removeByIndex=function(itemIndex){this.data.splice(itemIndex,1)};orsoncharts.KeyedValuesDataset.prototype.totalForDataset=function(dataset){var total=0;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)total=total+v}return total}; +orsoncharts.KeyedValuesDataset.prototype.minForDataset=function(dataset){var min=null;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)if(min)min=Math.min(min,v);else min=v}return min};orsoncharts.KeyedValuesDataset.prototype.maxForDataset=function(dataset){var max=null;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)if(max)max=Math.max(max,v);else max=v}return max}; +orsoncharts.KeyedValuesDataset.prototype.total=function(){return this.totalForDataset(this)};orsoncharts.KeyedValuesDataset.prototype.min=function(){return this.minForDataset(this)};orsoncharts.KeyedValuesDataset.prototype.max=function(){return this.maxForDataset(this)};if(!jfc)jfc={};jfc.KeyedValueLabels=function(){if(!(this instanceof orsoncharts.KeyedValueLabels))return new orsoncharts.KeyedValueLabels;this.format="{K} = {V}";this.valueDP=2;this.percentDP=2}; +jfc.KeyedValueLabels.prototype.itemLabel=function(keyedValues,itemIndex){var labelStr=new String(this.format);var keyStr=keyedValues.key(itemIndex);var value=keyedValues.valueByIndex(itemIndex);var valueStr=value.toFixed(this.valueDP);var total=keyedValues.total();var percentStr=(value/total*100).toFixed(this.percentDP);labelStr=labelStr.replace(/{K}/g,keyStr);labelStr=labelStr.replace(/{V}/g,valueStr);labelStr=labelStr.replace(/{P}/g,percentStr);return labelStr}; Added: branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValueLabels.js =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValueLabels.js (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValueLabels.js 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,36 @@ +/* + * JFreeChart + * ---------- + * Copyright (C) 2014 Object Refinery Limited. + */ + +"use strict"; + +if (!jfc) jfc = {}; + +/** + * Constructor for a new KeyedValueLabels instance + * @constructor + */ +jfc.KeyedValueLabels = function() { + if (!(this instanceof orsoncharts.KeyedValueLabels)) { + return new orsoncharts.KeyedValueLabels(); + } + this.format = "{K} = {V}"; + this.valueDP = 2; + this.percentDP = 2; +}; + +// Generates a label for an item in a KeyedValuesDataset. +jfc.KeyedValueLabels.prototype.itemLabel = function(keyedValues, itemIndex) { + var labelStr = new String(this.format); + var keyStr = keyedValues.key(itemIndex); + var value = keyedValues.valueByIndex(itemIndex); + var valueStr = value.toFixed(this.valueDP); + var total = keyedValues.total(); + var percentStr = (value / total * 100).toFixed(this.percentDP); + labelStr = labelStr.replace(/{K}/g, keyStr); + labelStr = labelStr.replace(/{V}/g, valueStr); + labelStr = labelStr.replace(/{P}/g, percentStr); + return labelStr; +}; Added: branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValuesDataset.js =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValuesDataset.js (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/src/KeyedValuesDataset.js 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2014 Object Refinery Limited + */ + +"use strict"; + +if (!jfc) jfc = {}; + +/** + * Constructor for a new KeyedValuesDataset + * @constructor + */ +orsoncharts.KeyedValuesDataset = function() { + if (!(this instanceof jfc.KeyedValuesDataset)) { + return new orsoncharts.KeyedValuesDataset(); + } + this.data = []; + this.listeners = []; +}; + +// returns the number of items in the dataset +orsoncharts.KeyedValuesDataset.prototype.itemCount = function() { + return this.data.length; +}; + +// Returns true if the dataset contains no items and false otherwise +orsoncharts.KeyedValuesDataset.prototype.isEmpty = function() { + return this.data.length === 0; +}; + +// returns the section key for the item with the specified index. +orsoncharts.KeyedValuesDataset.prototype.key = function(index) { + return this.data[index][0]; +}; + +// Returns a new array containing all the keys for the dataset. +orsoncharts.KeyedValuesDataset.prototype.keys = function() { + return this.data.map(function(d) { return d[0]; }); +}; + +// returns the index of the item with the specified key, or -1 +orsoncharts.KeyedValuesDataset.prototype.indexOf = function(sectionKey) { + var arrayLength = this.data.length; + for (var i = 0; i < arrayLength; i++) { + if (this.data[i][0] === sectionKey) { + return i; + } + } + return -1; +}; + +// returns the value for the item with the specified index. +orsoncharts.KeyedValuesDataset.prototype.valueByIndex = function(index) { + return this.data[index][1]; +}; + +// returns the value for the item with the specified key +orsoncharts.KeyedValuesDataset.prototype.valueByKey = function(sectionKey) { + var sectionIndex = this.indexOf(sectionKey); + if (sectionIndex < 0) return null; + return this.valueByIndex(sectionIndex); +}; + +// Adds a listener to the dataset (the listener method will be called whenever +// the dataset is modified) +orsoncharts.KeyedValuesDataset.prototype.addListener = function(listenerMethod) { + this.listeners.push(listenerMethod); +}; + +// Deregisters the specified listener so that it no longer receives +// notification of dataset changes +orsoncharts.KeyedValuesDataset.prototype.removeListener = function(listenerMethod) { + var i = this.listeners.indexOf(listenerMethod); + if (i >= 0) { + this.listeners.splice(i, 1); + } +}; + +// Notifies all registered listeners that there has been a change to this dataset +orsoncharts.KeyedValuesDataset.prototype.notifyListeners = function() { + // TODO: call each listenerMethod +}; + +// adds the specified (key, value) pair to the dataset or, if the key exists +// already, updates the value +orsoncharts.KeyedValuesDataset.prototype.add = function(sectionKey, value) { + this.data.push([sectionKey, value]); +}; + +// removes the item with the specified key +orsoncharts.KeyedValuesDataset.prototype.remove = function(sectionKey) { + if (!sectionKey) throw new Error("The 'sectionKey' must be defined."); + var i = this.indexOf(sectionKey); + if (i < 0) throw new Error("The sectionKey '" + sectionKey.toString() + + "' is not recognised."); + this.data.splice(i, 1); +}; + +// sets the data array based on the supplied JSON string +orsoncharts.KeyedValuesDataset.prototype.dataFromJSON = function(jsonStr) { + this.data = JSON.parse(jsonStr); + this.notifyListeners(); +}; + +orsoncharts.KeyedValuesDataset.prototype.removeByIndex = function(itemIndex) { + this.data.splice(itemIndex, 1); +}; + +// returns the total of all non-null values for the specified dataset +orsoncharts.KeyedValuesDataset.prototype.totalForDataset = function(dataset) { + var total = 0.0; + var itemCount = dataset.itemCount(); + for (var i = 0; i < itemCount; i++) { + var v = dataset.valueByIndex(i); + if (v) { + total = total + v; + } + } + return total; +}; + +// returns the minimum value for the specified dataset +orsoncharts.KeyedValuesDataset.prototype.minForDataset = function(dataset) { + var min = null; + var itemCount = dataset.itemCount(); + for (var i = 0; i < itemCount; i++) { + var v = dataset.valueByIndex(i); + if (v) { + if (min) { + min = Math.min(min, v); + } else { + min = v; + } + } + } + return min; +}; + +// returns the maximum value for the specified dataset +orsoncharts.KeyedValuesDataset.prototype.maxForDataset = function(dataset) { + var max = null; + var itemCount = dataset.itemCount(); + for (var i = 0; i < itemCount; i++) { + var v = dataset.valueByIndex(i); + if (v) { + if (max) { + max = Math.max(max, v); + } else { + max = v; + } + } + } + return max; +}; + +// returns the total of all values in this dataset (ignoring null values) +orsoncharts.KeyedValuesDataset.prototype.total = function() { + return this.totalForDataset(this); +}; + +// returns the minimum value in this dataset (ignoring null values) +orsoncharts.KeyedValuesDataset.prototype.min = function() { + return this.minForDataset(this); +}; + +// returns the maximum value in this dataset (ignoring null values) +orsoncharts.KeyedValuesDataset.prototype.max = function() { + return this.maxForDataset(this); +}; + Added: branches/jfreechart-1.0.x-branch/svg/js/src/Utils.js =================================================================== --- branches/jfreechart-1.0.x-branch/svg/js/src/Utils.js (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/js/src/Utils.js 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2014 Object Refinery Limited + */ + +var jfc; +if (!jfc) jfc = {}; + +jfc.Utils = {}; + +jfc.Utils.makeArrayOf = function(value, length) { + var arr = [], i = length; + while (i--) { + arr[i] = value; + } + return arr; +}; + +// returns the chart entity reference for this element +jfc.Utils.findChartRef = function(element) { + var id = element.getAttribute("jfreesvg:ref"); + var found = false; + var current = element; + while (!found) { + current = current.parentNode; + if (current != null) { + id = current.getAttribute("jfreesvg:ref"); + found = (id != null); + } else { + found = true; + } + } + return id; +} + +// find the chart id by finding the group that is written for the entire chart +jfc.Utils.findChartId = function(element) { + var id = null; + var found = false; + var current = element; + while (!found) { + current = current.parentNode; + if (current != null) { + var ref = current.getAttribute("jfreesvg:ref"); + if (ref == 'JFREECHART_TOP_LEVEL') { + found = true; + id = current.getAttribute("id"); + } + } else { + found = true; + } + } + return id; +} \ No newline at end of file Added: branches/jfreechart-1.0.x-branch/svg/lib/jfreechart_utils.js =================================================================== --- branches/jfreechart-1.0.x-branch/svg/lib/jfreechart_utils.js (rev 0) +++ branches/jfreechart-1.0.x-branch/svg/lib/jfreechart_utils.js 2014-08-04 21:38:11 UTC (rev 3295) @@ -0,0 +1,9 @@ +var jfc;if(!jfc)jfc={};jfc.Utils={};jfc.Utils.makeArrayOf=function(value,length){var arr=[],i=length;while(i--)arr[i]=value;return arr};jfc.Utils.findChartRef=function(element){var id=element.getAttribute("jfreesvg:ref");var found=false;var current=element;while(!found){current=current.parentNode;if(current!=null){id=current.getAttribute("jfreesvg:ref");found=id!=null}else found=true}return id}; +jfc.Utils.findChartId=function(element){var id=null;var found=false;var current=element;while(!found){current=current.parentNode;if(current!=null){var ref=current.getAttribute("jfreesvg:ref");if(ref=="JFREECHART_TOP_LEVEL"){found=true;id=current.getAttribute("id")}}else found=true}return id};if(!jfc)jfc={};orsoncharts.KeyedValuesDataset=function(){if(!(this instanceof jfc.KeyedValuesDataset))return new orsoncharts.KeyedValuesDataset;this.data=[];this.listeners=[]};orsoncharts.KeyedValuesDataset.prototype.itemCount=function(){return this.data.length};orsoncharts.KeyedValuesDataset.prototype.isEmpty=function(){return this.data.length===0};orsoncharts.KeyedValuesDataset.prototype.key=function(index){return this.data[index][0]};orsoncharts.KeyedValuesDataset.prototype.keys=function(){return this.data.map(function(d){return d[0]})}; +orsoncharts.KeyedValuesDataset.prototype.indexOf=function(sectionKey){var arrayLength=this.data.length;for(var i=0;i<arrayLength;i++)if(this.data[i][0]===sectionKey)return i;return-1};orsoncharts.KeyedValuesDataset.prototype.valueByIndex=function(index){return this.data[index][1]};orsoncharts.KeyedValuesDataset.prototype.valueByKey=function(sectionKey){var sectionIndex=this.indexOf(sectionKey);if(sectionIndex<0)return null;return this.valueByIndex(sectionIndex)}; +orsoncharts.KeyedValuesDataset.prototype.addListener=function(listenerMethod){this.listeners.push(listenerMethod)};orsoncharts.KeyedValuesDataset.prototype.removeListener=function(listenerMethod){var i=this.listeners.indexOf(listenerMethod);if(i>=0)this.listeners.splice(i,1)};orsoncharts.KeyedValuesDataset.prototype.notifyListeners=function(){};orsoncharts.KeyedValuesDataset.prototype.add=function(sectionKey,value){this.data.push([sectionKey,value])}; +orsoncharts.KeyedValuesDataset.prototype.remove=function(sectionKey){if(!sectionKey)throw new Error("The 'sectionKey' must be defined.");var i=this.indexOf(sectionKey);if(i<0)throw new Error("The sectionKey '"+sectionKey.toString()+"' is not recognised.");this.data.splice(i,1)};orsoncharts.KeyedValuesDataset.prototype.dataFromJSON=function(jsonStr){this.data=JSON.parse(jsonStr);this.notifyListeners()}; +orsoncharts.KeyedValuesDataset.prototype.removeByIndex=function(itemIndex){this.data.splice(itemIndex,1)};orsoncharts.KeyedValuesDataset.prototype.totalForDataset=function(dataset){var total=0;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)total=total+v}return total}; +orsoncharts.KeyedValuesDataset.prototype.minForDataset=function(dataset){var min=null;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)if(min)min=Math.min(min,v);else min=v}return min};orsoncharts.KeyedValuesDataset.prototype.maxForDataset=function(dataset){var max=null;var itemCount=dataset.itemCount();for(var i=0;i<itemCount;i++){var v=dataset.valueByIndex(i);if(v)if(max)max=Math.max(max,v);else max=v}return max}; +orsoncharts.KeyedValuesDataset.prototype.total=function(){return this.totalForDataset(this)};orsoncharts.KeyedValuesDataset.prototype.min=function(){return this.minForDataset(this)};orsoncharts.KeyedValuesDataset.prototype.max=function(){return this.maxForDataset(this)};if(!jfc)jfc={};jfc.KeyedValueLabels=function(){if(!(this instanceof orsoncharts.KeyedValueLabels))return new orsoncharts.KeyedValueLabels;this.format="{K} = {V}";this.valueDP=2;this.percentDP=2}; +jfc.KeyedValueLabels.prototype.itemLabel=function(keyedValues,itemIndex){var labelStr=new String(this.format);var keyStr=keyedValues.key(itemIndex);var value=keyedValues.valueByIndex(itemIndex);var valueStr=value.toFixed(this.valueDP);var total=keyedValues.total();var percentStr=(value/total*100).toFixed(this.percentDP);labelStr=labelStr.replace(/{K}/g,keyStr);labelStr=labelStr.replace(/{V}/g,valueStr);labelStr=labelStr.replace(/{P}/g,percentStr);return labelStr}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 21:36:45
|
Revision: 3294 http://sourceforge.net/p/jfreechart/code/3294 Author: mungady Date: 2014-08-04 21:36:37 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Update JFreeSVG version. Added Paths: ----------- branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.jar Removed Paths: ------------- branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar Deleted: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar =================================================================== (Binary files differ) Added: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.jar =================================================================== (Binary files differ) Index: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.jar =================================================================== --- branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.jar 2014-08-04 21:36:07 UTC (rev 3293) +++ branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.jar 2014-08-04 21:36:37 UTC (rev 3294) Property changes on: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.1.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-08-04 21:36:14
|
Revision: 3293 http://sourceforge.net/p/jfreechart/code/3293 Author: mungady Date: 2014-08-04 21:36:07 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> * org/jfree/chart/JFreeChart.java (id): New field, (elementHinting): Likewise, (JFreeChart): Initialise new fields, (getID): New method, (setID): Likewise, (getElementHinting): New method, (setElementHinting): Likewise, (draw): Add rendering hints, * org/jfree/chart/plot/Plot.java (chart): New field, (Plot): Initialise new field, (getChart): New method, (setChart): Likewise, (fetchElementHinting): New method, * org/jfree/chart/renderer/RendererState.java (elementHinting): New field, (RendererState): Initialise new field, (getElementHinting): New method, (setElementHinting): Likewise, * org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (initialise): Fetch element hinting flag from chart, (beginElementGroup): New method, (endElementGroup): Likewise, * org/jfree/chart/renderer/category/BarRenderer.java (drawItem): Add element hints, * org/jfree/data/ItemKey.java: New file, * org/jfree/data/KeyedValues2DItemKey.java * org/jfree/data/json/JSONUtils.java: New file, * org/jfree/data/json/impl/JSONArray.java: New file, * org/jfree/data/json/impl/JSONAware.java: New file, * org/jfree/data/json/impl/JSONObject.java: New file, * org/jfree/data/json/impl/JSONStreamAware.java: New file, * org/jfree/data/json/impl/JSONValue.java: New file. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/JFreeChart.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/RendererState.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/BarRenderer.java Added Paths: ----------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/ItemKey.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues2DItemKey.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/JSONUtils.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONArray.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONAware.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONObject.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONStreamAware.java branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONValue.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/JFreeChart.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/JFreeChart.java 2014-08-04 21:29:35 UTC (rev 3292) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/JFreeChart.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -177,8 +177,10 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.ResourceBundle; import javax.swing.ImageIcon; @@ -293,6 +295,9 @@ */ private transient RenderingHints renderingHints; + /** The chart id (optional, will be used by JFreeSVG export). */ + private String id; + /** A flag that controls whether or not the chart border is drawn. */ private boolean borderVisible; @@ -341,6 +346,14 @@ */ private boolean notify; + /** + * A flag that controls whether or not rendering hints that identify + * chart element should be added during rendering. This defaults to false + * and it should only be enabled if the output target will use the hints. + * JFreeSVG is one output target that supports these hints. + */ + private boolean elementHinting; + /** * Creates a new chart based on the supplied plot. The chart will have * a legend added automatically, but no title (although you can easily add @@ -393,7 +406,9 @@ boolean createLegend) { ParamChecks.nullNotPermitted(plot, "plot"); - + this.id = null; + plot.setChart(this); + // create storage for listeners... this.progressListeners = new EventListenerList(); this.changeListeners = new EventListenerList(); @@ -444,10 +459,61 @@ this.backgroundImage = DEFAULT_BACKGROUND_IMAGE; this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT; this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA; - } /** + * Returns the ID for the chart. + * + * @return The ID for the chart (possibly {@code null}). + * + * @since 1.0.20 + */ + public String getID() { + return this.id; + } + + /** + * Sets the ID for the chart. + * + * @param id the id ({@code null} permitted). + * + * @since 1.0.20 + */ + public void setID(String id) { + this.id = id; + } + + /** + * Returns the flag that controls whether or not rendering hints + * ({@link ChartHints#KEY_BEGIN_ELEMENT} and + * {@link ChartHints#KEY_END_ELEMENT}) that identify chart elements are + * added during rendering. The default value is {@link false}. + * + * @return A boolean. + * + * @see #setElementHinting(boolean) + * @since 1.0.20 + */ + public boolean getElementHinting() { + return this.elementHinting; + } + + /** + * Sets the flag that controls whether or not rendering hints + * ({@link ChartHints#KEY_BEGIN_ELEMENT} and + * {@link ChartHints#KEY_END_ELEMENT}) that identify chart elements are + * added during rendering. + * + * @param hinting the new flag value. + * + * @see #getElementHinting() + * @since 1.0.20 + */ + public void setElementHinting(boolean hinting) { + this.elementHinting = hinting; + } + + /** * Returns the collection of rendering hints for the chart. * * @return The rendering hints for the chart (never <code>null</code>). @@ -1142,6 +1208,15 @@ notifyListeners(new ChartProgressEvent(this, this, ChartProgressEvent.DRAWING_STARTED, 0)); + if (this.elementHinting) { + Map m = new HashMap<String, String>(); + if (this.id != null) { + m.put("id", this.id); + } + m.put("ref", "JFREECHART_TOP_LEVEL"); + g2.setRenderingHint(ChartHints.KEY_BEGIN_ELEMENT, m); + } + EntityCollection entities = null; // record the chart area, if info is requested... if (info != null) { @@ -1227,8 +1302,10 @@ plotInfo = info.getPlotInfo(); } this.plot.draw(g2, plotArea, anchor, null, plotInfo); - g2.setClip(savedClip); + if (this.elementHinting) { + g2.setRenderingHint(ChartHints.KEY_END_ELEMENT, Boolean.TRUE); + } notifyListeners(new ChartProgressEvent(this, this, ChartProgressEvent.DRAWING_FINISHED, 100)); Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java 2014-08-04 21:29:35 UTC (rev 3292) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -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 @@ * --------- * Plot.java * --------- - * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Sylvain Vieujot; @@ -238,6 +238,15 @@ public static final Shape DEFAULT_LEGEND_ITEM_CIRCLE = new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0); + /** + * The chart that the plot is assigned to. It can be {@code null} if the + * plot is not assigned to a chart yet, or if the plot is a subplot of a + * another plot. + * + * @since 1.0.20 + */ + private JFreeChart chart; + /** The parent plot (<code>null</code> if this is the root plot). */ private Plot parent; @@ -306,7 +315,7 @@ * Creates a new plot. */ protected Plot() { - + this.chart = null; this.parent = null; this.insets = DEFAULT_INSETS; this.backgroundPaint = DEFAULT_BACKGROUND_PAINT; @@ -325,8 +334,51 @@ this.notify = true; this.listenerList = new EventListenerList(); - } + + /** + * Returns the chart that this plot is assigned to. This method can + * return {@code null} if the plot is not yet assigned to a plot, or if the + * plot is a subplot of another plot. + * + * @return The chart (possibly {@code null}). + * + * @since 1.0.20 + */ + public JFreeChart getChart() { + return this.chart; + } + + /** + * Sets the chart that the plot is assigned to. This method is not + * intended for external use. + * + * @param chart the chart ({@code null} permitted). + * + * @since 1.0.20 + */ + public void setChart(JFreeChart chart) { + this.chart = chart; + } + + /** + * Fetches the element hinting flag from the chart that this plot is + * assigned to. If the plot is not assigned (directly or indirectly) to + * a chart instance, this method will return {@code false}. + * + * @return A boolean. + * + * @since 1.0.20 + */ + public boolean fetchElementHintingFlag() { + if (this.parent != null) { + return this.parent.fetchElementHintingFlag(); + } + if (this.chart != null) { + return this.chart.getElementHinting(); + } + return false; + } /** * Returns the dataset group for the plot (not currently used). Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/RendererState.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/RendererState.java 2014-08-04 21:29:35 UTC (rev 3292) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/RendererState.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -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 @@ * ------------------ * RendererState.java * ------------------ - * (C) Copyright 2003-2008, by Object Refinery Limited. + * (C) Copyright 2003-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -53,6 +53,13 @@ /** The plot rendering info. */ private PlotRenderingInfo info; + + /** + * A flag that indicates whether or not rendering hints should be added to + * identify chart elements. It is initialised from the corresponding flag + * in the JFreeChart instance. + */ + private boolean elementHinting; /** * Creates a new state object. @@ -61,7 +68,31 @@ */ public RendererState(PlotRenderingInfo info) { this.info = info; + this.elementHinting = false; } + + /** + * Returns the flag that controls whether or not the renderer should + * add rendering hints to the output that identify chart elements. + * + * @return A boolean. + * + * @since 1.0.20 + */ + public boolean getElementHinting() { + return this.elementHinting; + } + + /** + * Sets the elementHinting flag. + * + * @param hinting the new flag value. + * + * @since 1.0.20 + */ + public void setElementHinting(boolean hinting) { + this.elementHinting = hinting; + } /** * Returns the plot rendering info. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2014-08-04 21:29:35 UTC (rev 3292) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -130,6 +130,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.jfree.chart.ChartHints; import org.jfree.chart.LegendItem; import org.jfree.chart.LegendItemCollection; import org.jfree.chart.axis.CategoryAxis; @@ -156,6 +157,7 @@ import org.jfree.chart.util.CloneUtils; import org.jfree.chart.util.ParamChecks; import org.jfree.chart.util.TextUtils; +import org.jfree.data.ItemKey; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.DatasetUtilities; @@ -603,6 +605,7 @@ this.columnCount = 0; } CategoryItemRendererState state = createState(info); + state.setElementHinting(plot.fetchElementHintingFlag()); int[] visibleSeriesTemp = new int[this.rowCount]; int visibleSeriesCount = 0; for (int row = 0; row < this.rowCount; row++) { @@ -619,6 +622,35 @@ } /** + * Adds a {@code KEY_BEGIN_ELEMENT} hint to the graphics target. This + * hint is recognised by <b>JFreeSVG</b>. + * + * @param g2 the graphics target ({@code null} not permitted). + * @param key the key ({@code null} not permitted). + * + * @see #endElementGroup(java.awt.Graphics2D) + * @since 1.0.20 + */ + protected void beginElementGroup(Graphics2D g2, ItemKey key) { + ParamChecks.nullNotPermitted(key, "key"); + Map m = new HashMap(1); + m.put("ref", key.toJSONString()); + g2.setRenderingHint(ChartHints.KEY_BEGIN_ELEMENT, m); + } + + /** + * Adds a {@code KEY_END_ELEMENT} hint to the graphics target. + * + * @param g2 the graphics target ({@code null} not permitted). + * + * @see #beginElementGroup(java.awt.Graphics2D, org.jfree.data.ItemKey) + * @since 1.0.20 + */ + protected void endElementGroup(Graphics2D g2) { + g2.setRenderingHint(ChartHints.KEY_END_ELEMENT, Boolean.TRUE); + } + + /** * Returns the range of values the renderer requires to display all the * items from the specified dataset. * @@ -1680,7 +1712,7 @@ this.legendItemURLGenerator = generator; fireChangeEvent(); } - + /** * Adds an entity with the specified hotspot. * Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/BarRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/BarRenderer.java 2014-08-04 21:29:35 UTC (rev 3292) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/BarRenderer.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -90,6 +90,7 @@ * 14-Jan-2009 : Added support for seriesVisible flags (PK); * 03-Feb-2009 : Added defaultShadowsVisible flag - see patch 2511330 (PK); * 03-Jul-2013 : Use ParamChecks (DG); + * 04-Aug-2014 : Add element hinting for JFreeSVG (DG); * */ @@ -122,6 +123,7 @@ import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.util.ParamChecks; +import org.jfree.data.KeyedValues2DItemKey; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.io.SerialUtilities; @@ -1056,12 +1058,20 @@ bar = new Rectangle2D.Double(barW0, barL0 - barL0Adj, state.getBarWidth(), barLength + barLengthAdj); } + if (state.getElementHinting()) { + KeyedValues2DItemKey key = new KeyedValues2DItemKey( + dataset.getRowKey(row), dataset.getColumnKey(column)); + beginElementGroup(g2, key); + } if (getShadowsVisible()) { this.barPainter.paintBarShadow(g2, this, row, column, bar, barBase, true); } this.barPainter.paintBar(g2, this, row, column, bar, barBase); - + if (state.getElementHinting()) { + endElementGroup(g2); + } + CategoryItemLabelGenerator generator = getItemLabelGenerator(row, column); if (generator != null && isItemLabelVisible(row, column)) { @@ -1082,7 +1092,7 @@ } } - + /** * Calculates the available space for each series. * Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/ItemKey.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/ItemKey.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/ItemKey.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,57 @@ +/* =========================================================== + * 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.] + * + * ------------ + * ItemKey.java + * ------------ + * (C) Copyright 2014, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * Changes: + * -------- + * 01-Aug-2014 : Version 1 (DG); + * + */ + +package org.jfree.data; + +/** + * A key that references a single data item in a dataset. + * + * @since 1.0.20 + */ +public interface ItemKey { + + /** + * Returns a JSON formatted string representing the key. + * + * @return A JSON formatted string. + */ + String toJSONString(); + +} Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues2DItemKey.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues2DItemKey.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues2DItemKey.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,158 @@ +/* =========================================================== + * 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.] + * + * ------------------------- + * KeyedValues2DItemKey.java + * ------------------------- + * (C) Copyright 2014, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * Changes: + * -------- + * 01-Aug-2014 : Version 1 (DG); + * + */ + +package org.jfree.data; + +import java.io.Serializable; +import org.jfree.chart.util.ParamChecks; +import org.jfree.util.ObjectUtilities; + +/** + * An object that references one data item in a {@link KeyedValues3D} data + * structure. Instances of this class are immutable (subject to the caller + * using series, row and column keys that are immutable). + * + * @since 1.3 + */ +public class KeyedValues2DItemKey<R extends Comparable<R>, + C extends Comparable<C>> implements ItemKey, + Comparable<KeyedValues2DItemKey<R, C>>, Serializable { + + /** The row key. */ + R rowKey; + + /** The column key. */ + C columnKey; + + /** + * Creates a new instance. + * + * @param rowKey the row key (<code>null</code> not permitted). + * @param columnKey the column key (<code>null</code> not permitted). + */ + public KeyedValues2DItemKey(R rowKey, C columnKey) { + ParamChecks.nullNotPermitted(rowKey, "rowKey"); + ParamChecks.nullNotPermitted(columnKey, "columnKey"); + this.rowKey = rowKey; + this.columnKey = columnKey; + } + + /** + * Returns the row key. + * + * @return The row key (never <code>null</code>). + */ + public R getRowKey() { + return this.rowKey; + } + + /** + * Returns the column key. + * + * @return The column key (never <code>null</code>). + */ + public C getColumnKey() { + return this.columnKey; + } + + @Override + public int compareTo(KeyedValues2DItemKey<R, C> key) { + int result = this.rowKey.compareTo(key.rowKey); + if (result == 0) { + result = this.columnKey.compareTo(key.columnKey); + } + return result; + } + + /** + * Tests this key for equality with an arbitrary object. + * + * @param obj the object (<code>null</code> permitted). + * + * @return A boolean. + */ + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof KeyedValues2DItemKey)) { + return false; + } + KeyedValues2DItemKey that = (KeyedValues2DItemKey) obj; + if (!this.rowKey.equals(that.rowKey)) { + return false; + } + if (!this.columnKey.equals(that.columnKey)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 17 * hash + ObjectUtilities.hashCode(this.rowKey); + hash = 17 * hash + ObjectUtilities.hashCode(this.columnKey); + return hash; + } + + @Override + public String toJSONString() { + StringBuilder sb = new StringBuilder(); + sb.append("{\"rowKey\": \"").append(this.rowKey.toString()); + sb.append("\", "); + sb.append("\"columnKey\": \"").append(this.columnKey.toString()); + sb.append("\"}"); + return sb.toString(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Values2DItemKey[row="); + sb.append(rowKey.toString()).append(",column="); + sb.append(columnKey.toString()); + sb.append("]"); + return sb.toString(); + } + +} + Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/JSONUtils.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/JSONUtils.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/JSONUtils.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,201 @@ +/* =========================================================== + * 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.] + * + * -------------- + * JSONUtils.java + * -------------- + * (C) Copyright 2014, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * Changes: + * -------- + * 04-Aug-2014 : Version 1 (DG); + * + */ + +package org.jfree.data.json; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Iterator; +import java.util.List; +import org.jfree.chart.util.ParamChecks; +import org.jfree.data.KeyedValues; +import org.jfree.data.KeyedValues2D; +import org.jfree.data.category.CategoryDataset; +import org.jfree.data.general.PieDataset; +import org.jfree.data.json.impl.JSONValue; + +/** + * A utility class that can read and write data in specific JSON formats. + * + * @since 1.0.20 + */ +public class JSONUtils { + + /** + * Returns a string containing the data in JSON format. The format is + * an array of arrays, where each sub-array represents one data value. + * The sub-array should contain two items, first the item key as a string + * and second the item value as a number. For example: + * {@code [["Key A", 1.0], ["Key B", 2.0]]} + * <br><br> + * Note that this method can be used with instances of {@link PieDataset}. + * + * @param data the data ({@code null} not permitted). + * + * @return A string in JSON format. + */ + public static String writeKeyedValues(KeyedValues data) { + ParamChecks.nullNotPermitted(data, "data"); + StringWriter sw = new StringWriter(); + try { + writeKeyedValues(data, sw); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + return sw.toString(); + } + + /** + * Writes the data in JSON format to the supplied writer. + * <br><br> + * Note that this method can be used with instances of {@link PieDataset}. + * + * @param data the data ({@code null} not permitted). + * @param writer the writer ({@code null} not permitted). + * + * @throws IOException if there is an I/O problem. + */ + public static void writeKeyedValues(KeyedValues data, Writer writer) + throws IOException { + ParamChecks.nullNotPermitted(data, "data"); + ParamChecks.nullNotPermitted(writer, "writer"); + writer.write("["); + boolean first = true; + Iterator iterator = data.getKeys().iterator(); + while (iterator.hasNext()) { + Comparable key = (Comparable) iterator.next(); + if (!first) { + writer.write(", "); + } else { + first = false; + } + writer.write("["); + writer.write(JSONValue.toJSONString(key.toString())); + writer.write(", "); + writer.write(JSONValue.toJSONString(data.getValue(key))); + writer.write("]"); + } + writer.write("]"); + } + + /** + * Returns a string containing the data in JSON format. The format is... + * <br><br> + * Note that this method can be used with instances of + * {@link CategorDataset}. + * + * @param data the data ({@code null} not permitted). + * + * @return A string in JSON format. + */ + public static String writeKeyedValues2D(KeyedValues2D data) { + ParamChecks.nullNotPermitted(data, "data"); + StringWriter sw = new StringWriter(); + try { + writeKeyedValues2D(data, sw); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + return sw.toString(); + } + + /** + * Writes the data in JSON format to the supplied writer. + * <br><br> + * Note that this method can be used with instances of + * {@link CategoryDataset}. + * + * @param data the data ({@code null} not permitted). + * @param writer the writer ({@code null} not permitted). + * + * @throws IOException if there is an I/O problem. + */ + public static void writeKeyedValues2D(KeyedValues2D data, Writer writer) + throws IOException { + ParamChecks.nullNotPermitted(data, "data"); + ParamChecks.nullNotPermitted(writer, "writer"); + List<Comparable<?>> columnKeys = data.getColumnKeys(); + List<Comparable<?>> rowKeys = data.getRowKeys(); + writer.write("{"); + if (!columnKeys.isEmpty()) { + writer.write("\"columnKeys\": ["); + boolean first = true; + for (Comparable<?> columnKey : columnKeys) { + if (!first) { + writer.write(", "); + } else { + first = false; + } + writer.write(JSONValue.toJSONString(columnKey.toString())); + } + writer.write("]"); + } + if (!rowKeys.isEmpty()) { + writer.write(", \"rows\": ["); + boolean firstRow = true; + for (Comparable<?> rowKey : rowKeys) { + if (!firstRow) { + writer.write(", ["); + } else { + writer.write("["); + firstRow = false; + } + // write the row data + writer.write(JSONValue.toJSONString(rowKey.toString())); + writer.write(", ["); + boolean first = true; + for (Comparable<?> columnKey : columnKeys) { + if (!first) { + writer.write(", "); + } else { + first = false; + } + writer.write(JSONValue.toJSONString(data.getValue(rowKey, + columnKey))); + } + writer.write("]]"); + } + writer.write("]"); + } + writer.write("}"); + } + +} Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONArray.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONArray.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONArray.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,158 @@ +/* =========================================================== + * 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 + * + * JSON.simple + * ----------- + * The code in this file originates from the JSON.simple project by + * FangYidong<fan...@ya...>: + * + * https://code.google.com/p/json-simple/ + * + * which is licensed under the Apache Software License version 2.0. + * + * It has been modified locally and repackaged under + * org.jfree.data.json.impl.* to avoid conflicts with any other version that + * may be present on the classpath. + * + */ + +package org.jfree.data.json.impl; + +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * A JSON array. + * <br><br> + * This class is for internal use by Orson Charts, it is not + * part of the supported API and you should not call it directly. If you need + * JSON support in your project you should include JSON.simple + * (https://code.google.com/p/json-simple/) or some other JSON library directly + * in your project. + */ +public class JSONArray extends ArrayList implements List, JSONAware, + JSONStreamAware { + + private static final long serialVersionUID = 3957988303675231981L; + + /** + * Encode a list into JSON text and write it to out. + * If this list is also a {@link JSONStreamAware} or a {@link JSONAware}, + * <code>JSONStreamAware</code> and <code>JSONAware</code> specific + * behaviours will be ignored at this top level. + * + * @see com.orsoncharts.util.json.JSONValue#writeJSONString(Object, Writer) + * + * @param list the list (<code>null</code> permitted). + * @param out the output writer (<code>null</code> not permitted). + * + * @throws IOException if there is an I/O problem. + */ + public static void writeJSONString(List list, Writer out) + throws IOException { + if (list == null) { + out.write("null"); + return; + } + + boolean first = true; + Iterator iter = list.iterator(); + out.write('['); + while (iter.hasNext()) { + if (first) { + first = false; + } + else { + out.write(','); + } + + Object value = iter.next(); + if (value == null) { + out.write("null"); + continue; + } + JSONValue.writeJSONString(value, out); + } + out.write(']'); + } + + /** + * Writes this array to the specified output writer. + * + * @param out the output writer (<code>null</code> not permitted). + * + * @throws IOException if there is an I/O problem. + */ + @Override + public void writeJSONString(Writer out) throws IOException { + writeJSONString(this, out); + } + + /** + * Convert a list to JSON text. The result is a JSON array. + * If this list is also a {@link JSONAware}, {@link JSONAware} specific + * behaviours will be omitted at this top level. + * + * @see com.orsoncharts.util.json.JSONValue#toJSONString(Object) + * + * @param list the list (<code>null</code> permitted). + * + * @return JSON text, or "null" if list is null. + */ + public static String toJSONString(List list){ + if (list == null) { + return "null"; + } + + boolean first = true; + StringBuilder sb = new StringBuilder(); + Iterator iter = list.iterator(); + sb.append('['); + while (iter.hasNext()) { + if (first) { + first = false; + } + else { + sb.append(','); + } + + Object value = iter.next(); + if (value == null) { + sb.append("null"); + continue; + } + sb.append(JSONValue.toJSONString(value)); + } + sb.append(']'); + return sb.toString(); + } + + /** + * Returns a JSON string representation of this list. + * + * @return A string. + */ + @Override + public String toJSONString(){ + return toJSONString(this); + } + + /** + * Returns a string representation of this list. + * + * @return A string. + */ + @Override + public String toString() { + return toJSONString(); + } + +} Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONAware.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONAware.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONAware.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,46 @@ +/* =========================================================== + * 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 + * + * JSON.simple + * ----------- + * The code in this file originates from the JSON.simple project by + * FangYidong<fan...@ya...>: + * + * https://code.google.com/p/json-simple/ + * + * which is licensed under the Apache Software License version 2.0. + * + * It has been modified locally and repackaged under + * org.jfree.data.json.impl.* to avoid conflicts with any other version that + * may be present on the classpath. + * + */ + +package org.jfree.data.json.impl; + + +/** + * Classes that support customized output of JSON text shall implement this + * interface. + * <br><br> + * This class is for internal use by JFreeChart, it is not + * part of the supported API and you should not call it directly. If you need + * JSON support in your project you should include JSON.simple + * (https://code.google.com/p/json-simple/) or some other JSON library directly + * in your project. + */ +public interface JSONAware { + + /** + * Returns a JSON string representing the object. + * + * @return A JSON string. + */ + String toJSONString(); + +} Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONObject.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONObject.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONObject.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,187 @@ +/* =========================================================== + * 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 + * + * JSON.simple + * ----------- + * The code in this file originates from the JSON.simple project by + * FangYidong<fan...@ya...>: + * + * https://code.google.com/p/json-simple/ + * + * which is licensed under the Apache Software License version 2.0. + * + * It has been modified locally and repackaged under + * org.jfree.data.json.impl.* to avoid conflicts with any other version that + * may be present on the classpath. + * + */ + +package org.jfree.data.json.impl; + + +import java.io.IOException; +import java.io.Writer; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * A JSON object. Key value pairs are unordered. + */ +public class JSONObject extends HashMap implements Map, JSONAware, + JSONStreamAware { + + private static final long serialVersionUID = -503443796854799292L; + + /** + * Encode a map into JSON text and write it to out. + * If this map is also a {@link JSONAware} or {@link JSONStreamAware}, + * <code>JSONAware</code> or <code>JSONStreamAware</code> specific + * behaviours will be ignored at this top level. + * + * @see com.orsoncharts.util.json.JSONValue#writeJSONString(Object, Writer) + * + * @param map the map to write (<code>null</code> permitted). + * @param out the output writer (<code>null</code> not permitted). + * + * @throws IOException if there is an I/O problem. + */ + public static void writeJSONString(Map map, Writer out) throws IOException { + if (map == null) { + out.write("null"); + return; + } + boolean first = true; + Iterator iter = map.entrySet().iterator(); + out.write('{'); + while (iter.hasNext()) { + if (first) { + first = false; + } + else { + out.write(','); + } + Map.Entry entry = (Map.Entry) iter.next(); + out.write('\"'); + out.write(JSONValue.escape(String.valueOf(entry.getKey()))); + out.write('\"'); + out.write(':'); + JSONValue.writeJSONString(entry.getValue(), out); + } + out.write('}'); + } + + /** + * Writes a JSON string representing this object instance to the specified + * output writer. + * + * @param out the output writer (<code>null</code> not permitted). + * + * @throws IOException if there is an I/O problem. + */ + @Override + public void writeJSONString(Writer out) throws IOException { + writeJSONString(this, out); + } + + /** + * Convert a map to JSON text. The result is a JSON object. + * If this map is also a {@link JSONAware}, <code>JSONAware</code> specific + * behaviours will be omitted at this top level. + * + * @see com.orsoncharts.util.json.JSONValue#toJSONString(Object) + * + * @param map the map (<code>null</code> permitted). + * + * @return JSON text, or "null" if map is null. + */ + public static String toJSONString(Map map){ + if (map == null) { + return "null"; + } + + StringBuffer sb = new StringBuffer(); + boolean first = true; + Iterator iter = map.entrySet().iterator(); + + sb.append('{'); + while (iter.hasNext()) { + if (first) { + first = false; + } + else { + sb.append(','); + } + + Map.Entry entry = (Map.Entry) iter.next(); + toJSONString(String.valueOf(entry.getKey()), entry.getValue(), sb); + } + sb.append('}'); + return sb.toString(); + } + + /** + * Returns a JSON string representing this object. + * + * @return A JSON string. + */ + @Override + public String toJSONString(){ + return toJSONString(this); + } + + /** + * Writes a key and value to a JSON string. + * + * @param key the key (<code>null</code> permitted). + * @param value the value (<code>null</code> permitted). + * @param sb a string buffer (<code>null</code> not permitted). + * + * @return A JSON string fragment representing the key and value. + */ + private static String toJSONString(String key, Object value, + StringBuffer sb) { + sb.append('\"'); + if (key == null) { + sb.append("null"); + } + else { + JSONValue.escape(key, sb); + } + sb.append('\"').append(':'); + + sb.append(JSONValue.toJSONString(value)); + + return sb.toString(); + } + + /** + * Returns a string representation of this object. + * + * @return A string. + */ + @Override + public String toString(){ + return toJSONString(); + } + + /** + * Returns a JSON string fragment containing the key and value. + * + * @param key the key (<code>null</code> permitted). + * @param value the value (<code>null</code> permitted). + * + * @return A JSON string fragment. + */ + public static String toString(String key, Object value){ + StringBuffer sb = new StringBuffer(); + toJSONString(key, value, sb); + return sb.toString(); + } +} + Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONStreamAware.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONStreamAware.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONStreamAware.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,46 @@ +/* =========================================================== + * 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 + * + * JSON.simple + * ----------- + * The code in this file originates from the JSON.simple project by + * FangYidong<fan...@ya...>: + * + * https://code.google.com/p/json-simple/ + * + * which is licensed under the Apache Software License version 2.0. + * + * It has been modified locally and repackaged under + * org.jfree.data.json.impl.* to avoid conflicts with any other version that + * may be present on the classpath. + * + */ + +package org.jfree.data.json.impl; + + +import java.io.IOException; +import java.io.Writer; + +/** + * Beans that support customized output of JSON text to a writer shall implement this interface. + * @author FangYidong<fan...@ya...> + */ +public interface JSONStreamAware { + + /** + * write JSON string to out. + * + * @param out the output writer. + * + * @throws IOException if there is an I/O problem. + */ + void writeJSONString(Writer out) throws IOException; + +} + Added: branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONValue.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONValue.java (rev 0) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/json/impl/JSONValue.java 2014-08-04 21:36:07 UTC (rev 3293) @@ -0,0 +1,338 @@ +/* =========================================================== + * 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 + * + * JSON.simple + * ----------- + * The code in this file originates from the JSON.simple project by + * FangYidong<fan...@ya...>: + * + * https://code.google.com/p/json-simple/ + * + * which is licensed under the Apache Software License version 2.0. + * + * It has been modified locally and repackaged under + * org.jfree.data.json.impl.* to avoid conflicts with any other version that + * may be present on the classpath. + * + */ + +package org.jfree.data.json.impl; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.Writer; +import java.util.List; +import java.util.Map; + +/** + * Utility methods for JSON values. + */ +public class JSONValue { + +// /** +// * Parse JSON text into java object from the input source. +// * Please use parseWithException() if you don't want to ignore the +// * exception. +// * +// * @see com.orsoncharts.util.json.parser.JSONParser#parse(Reader) +// * @see #parseWithException(Reader) +// * +// * @param in the input reader. +// * @return Instance of the following: +// * com.orsoncharts.util.json.JSONObject, +// * com.orsoncharts.util.json.JSONArray, +// * java.lang.String, +// * java.lang.Number, +// * java.lang.Boolean, +// * null +// */ +// public static Object parse(Reader in){ +// try { +// JSONParser parser = new JSONParser(); +// return parser.parse(in); +// } +// catch (Exception e) { +// return null; +// } +// } +// +// /** +// * Parses an object from a string. +// * +// * @param s the string. +// * +// * @return An object. +// */ +// public static Object parse(String s){ +// StringReader in = new StringReader(s); +// return parse(in); +// } +// +// /** +// * Parse JSON text into java object from the input source. +// * +// * @see com.orsoncharts.util.json.parser.JSONParser +// * +// * @param in the input reader (<code>null</code> not permitted). +// * +// * @return Instance of the following: +// * com.orsoncharts.util.json.JSONObject, +// * com.orsoncharts.util.json.JSONArray, +// * java.lang.String, +// * java.lang.Number, +// * java.lang.Boolean, +// * null +// * +// * @throws IOException if there is an I/O problem. +// * @throws ParseException if there is a parsing problem. +// */ +// public static Object parseWithException(Reader in) throws IOException, +// ParseException{ +// JSONParser parser = new JSONParser(); +// return parser.parse(in); +// } +// +// /** +// * Parses an object from a JSON string. +// * +// * @param s the string. +// * +// * @return An object. +// * +// * @throws ParseException if there is a parsing problem. +// */ +// public static Object parseWithException(String s) throws ParseException{ +// JSONParser parser = new JSONParser(); +// return parser.parse(s); +// } + + /** + * Encode an object into JSON text and write it to out. + * <p> + * If this object is a <code>Map</code> or a <code>List</code>, and it's + * also a {@link JSONStreamAware} or a {@link JSONAware}, + * <code>JSONStreamAware</code> or <code>JSONAware</code> will be + * considered firstly. + * <p> + * DO NOT call this method from writeJSONString(Writer) of a class that + * implements both JSONStreamAware and (Map or List) with + * "this" as the first parameter, use JSONObject.writeJSONString(Map, + * Writer) or JSONArray.writeJSONString(List, Writer) instead. + * + * @see com.orsoncharts.util.json.JSONObject#writeJSONString(Map, Writer) + * @see com.orsoncharts.util.json.JSONArray#writeJSONString(List, Writer) + * + * @param value the value. + * @param out the output writer. + * @throws IOException if there is an I/O problem. + */ + public static void writeJSONString(Object value, Writer out) + throws IOException { + if (value == null) { + out.write("null"); + return; + } + + if (value instanceof String) { + out.write('\"'); + out.write(escape((String) value)); + out.write('\"'); + return; + } + + if (value instanceof Double) { + if(((Double) value).isInfinite() || ((Double) value).isNaN()) { + out.write("null"); + } + else { + out.write(value.toString()); + } + return; + } + + if (value instanceof Float) { + if (((Float) value).isInfinite() || ((Float) value).isNaN()) { + out.write("null"); + } + else { + out.write(value.toString()); + } + return; + } + + if (value instanceof Number) { + out.write(value.toString()); + return; + } + + if (value instanceof Boolean) { + out.write(value.toString()); + return; + } + + if ((value instanceof JSONStreamAware)) { + ((JSONStreamAware) value).writeJSONString(out); + return; + } + + if ((value instanceof JSONAware)) { + out.write(((JSONAware) value).toJSONString()); + return; + } + + if (value instanceof Map) { + JSONObject.writeJSONString((Map) value, out); + return; + } + + if (value instanceof List) { + JSONArray.writeJSONString((List) value, out); + return; + } + + out.write(value.toString()); + } + + /** + * Convert an object to JSON text. + * <p> + * If this object is a Map or a List, and it's also a JSONAware, JSONAware + * will be considered firstly. + * <p> + * DO NOT call this method from toJSONString() of a class that implements + * both JSONAware and Map or List with + * "this" as the parameter, use JSONObject.toJSONString(Map) or + * JSONArray.toJSONString(List) instead. + * + * @see com.orsoncharts.util.json.JSONObject#toJSONString(Map) + * @see com.orsoncharts.util.json.JSONArray#toJSONString(List) + * + * @param value the value. + * @return JSON text, or "null" if value is null or it's an NaN or an INF + * number. + */ + public static String toJSONString(Object value){ + if (value == null) { + return "null"; + } + + if (value instanceof String) { + return "\"" + escape((String) value) + "\""; + } + + if (value instanceof Double){ + if(((Double) value).isInfinite() || ((Double) value).isNaN()) { + return "null"; + } + else { + return value.toString(); + } + } + + if (value instanceof Float) { + if (((Float) value).isInfinite() || ((Float) value).isNaN()) { + return "null"; + } + else { + return value.toString(); + } + } + + if (value instanceof Number) { + return value.toString(); + } + + if (value instanceof Boolean) { + return value.toString(); + } + + if ((value instanceof JSONAware)) { + return ((JSONAware) value).toJSONString(); + } + + if (value instanceof Map) { + return JSONObject.toJSONString((Map) value); + } + + if (value instanceof List) { + return JSONArray.toJSONString((List) value); + } + + return value.toString(); + } + + /** + * Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters + * (U+0000 through U+001F). + * + * @param s the string to be escaped (<code>null</code> permitted). + * + * @return A string. + */ + public static String escape(String s) { + if (s == null) { + return null; + } + StringBuffer sb = new StringBuffer(); + escape(s, sb); + return sb.toString(); + } + + /** + * @param s - Must not be null. + * @param sb + */ + static void escape(String s, StringBuffer sb) { + for(int i = 0; i < s.length(); i++) { + char ch = s.charAt(i); + switch(ch){ + case '"': + sb.append("\\\""); + break; + case '\\': + sb.append("\\\\"); + break; + case '\b': + sb.append("\\b"); + break; + case '\f': + sb.append("\\f"); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\t': + sb.append("\\t"); + break; + case '/': + sb.append("\\/"); + break; + default: + //Reference: http://www.unicode.org/versions/Unicode5.1.0/ + if ((ch >= '\u0000' && ch <= '\u001F') + || (ch >= '\u007F' && ch <= '\u009F') + || (ch >= '\u2000' && ch <= '\u20FF')) { + String ss = Integer.toHexString(ch); + sb.append("\\u"); + for (int k = 0; k < 4 - ss.length(); k++) { + sb.append('0'); + } + sb.append(ss.toUpperCase()); + } + else { + sb.append(ch); + } + } + }//for + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 21:29:46
|
Revision: 3292 http://sourceforge.net/p/jfreechart/code/3292 Author: mungady Date: 2014-08-04 21:29:35 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Javadoc updates. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues.java 2014-08-04 08:44:29 UTC (rev 3291) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/KeyedValues.java 2014-08-04 21:29:35 UTC (rev 3292) @@ -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 @@ * ---------------- * KeyedValues.java * ---------------- - * (C) Copyright 2002-2008, by Object Refinery Limited. + * (C) Copyright 2002-2014, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -48,7 +48,7 @@ /** * An ordered list of (key, value) items where the keys are unique and - * non-<code>null</code>. + * non-{@code null}. * * @see Values * @see DefaultKeyedValues @@ -60,12 +60,12 @@ * that some implementations allow re-ordering of the data items, so the * result may be transient. * - * @param index the item index (in the range <code>0</code> to - * <code>getItemCount() - 1</code>). + * @param index the item index (in the range {@code 0} to + * {@code getItemCount() - 1}). * - * @return The key (never <code>null</code>). + * @return The key (never {@code null}). * - * @throws IndexOutOfBoundsException if <code>index</code> is not in the + * @throws IndexOutOfBoundsException if {@code index} is not in the * specified range. */ public Comparable getKey(int index); @@ -73,12 +73,11 @@ /** * Returns the index for a given key. * - * @param key the key (<code>null</code> not permitted). + * @param key the key ({@code null} not permitted). * - * @return The index, or <code>-1</code> if the key is unrecognised. + * @return The index, or {@code -1} if the key is unrecognised. * - * @throws IllegalArgumentException if <code>key</code> is - * <code>null</code>. + * @throws IllegalArgumentException if {@code key} is {@code null}. */ public int getIndex(Comparable key); @@ -88,7 +87,7 @@ * reason, the key order is important - this method should return the keys * in order. The returned list may be unmodifiable. * - * @return The keys (never <code>null</code>). + * @return The keys (never {@code null}). */ public List getKeys(); @@ -97,7 +96,7 @@ * * @param key the key. * - * @return The value (possibly <code>null</code>). + * @return The value (possibly {@code null}). * * @throws UnknownKeyException if the key is not recognised. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:44:39
|
Revision: 3291 http://sourceforge.net/p/jfreechart/code/3291 Author: mungady Date: 2014-08-04 08:44:29 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Merge changes from FXGraphics2D project. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2014-08-04 08:29:45 UTC (rev 3290) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2014-08-04 08:44:29 UTC (rev 3291) @@ -140,6 +140,9 @@ private Font font = new Font("SansSerif", Font.PLAIN, 12); + private final FontRenderContext fontRenderContext = new FontRenderContext( + null, false, true); + private AffineTransform transform = new AffineTransform(); /** The background color, presently ignored. */ @@ -543,7 +546,7 @@ * Maps a line join code from AWT to the corresponding JavaFX * StrokeLineJoin enum value. * - * @param c the line join code. + * @param j the line join code. * * @return A JavaFX line join value. */ @@ -826,7 +829,7 @@ */ @Override public FontRenderContext getFontRenderContext() { - return this.fmImage.createGraphics().getFontRenderContext(); + return this.fontRenderContext; } /** @@ -1505,14 +1508,20 @@ * @return {@code true} if the image is drawn. */ @Override - public boolean drawImage(Image img, int x, int y, int width, int height, - ImageObserver observer) { - BufferedImage img2 = new BufferedImage(width, height, + public boolean drawImage(final Image img, int x, int y, int width, + int height, ImageObserver observer) { + final BufferedImage buffered; + if (img instanceof BufferedImage) { + buffered = (BufferedImage) img; + } else { + buffered = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - Graphics2D g2 = img2.createGraphics(); - g2.drawImage(img, 0, 0, width, height, null); - javafx.scene.image.WritableImage fxImage = SwingFXUtils.toFXImage(img2, - null); + final Graphics2D g2 = buffered.createGraphics(); + g2.drawImage(img, 0, 0, width, height, null); + g2.dispose(); + } + javafx.scene.image.WritableImage fxImage = SwingFXUtils.toFXImage( + buffered, null); this.gc.drawImage(fxImage, x, y, width, height); return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:29:49
|
Revision: 3290 http://sourceforge.net/p/jfreechart/code/3290 Author: mungady Date: 2014-08-04 08:29:45 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: * org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java (drawItem): Restrict entity hotspot to within the plot area 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-08-04 08:29:24 UTC (rev 3289) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-08-04 08:29:45 UTC (rev 3290) @@ -1,8 +1,14 @@ 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: + * org/jfree/chart/renderer/xy/XYAreaRenderer.java + (drawItem): Restrict entity hotspot to within the plot area, + * org/jfree/chart/renderer/xy/XYAreaRenderer2.java + (drawItem): Restrict entity hotspot to within the plot area, + * org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java + (drawItem): Restrict entity hotspot to within the plot area, * org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java - (drawItem): Correct the entity hotspot. + (drawItem): Restrict entity hotspot to within the plot area. ---------- JFREECHART 1.0.19 RELEASED ------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:29:30
|
Revision: 3289 http://sourceforge.net/p/jfreechart/code/3289 Author: mungady Date: 2014-08-04 08:29:24 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: * org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java (drawItem): Restrict entity hotspot to within the plot area Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer2.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer.java 2014-08-04 08:09:35 UTC (rev 3288) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer.java 2014-08-04 08:29:24 UTC (rev 3289) @@ -34,6 +34,7 @@ * Richard Atkinson; * Christian W. Zuckschwerdt; * Martin Krauskopf; + * Ulrich Voigt (patch #312); * * Changes: * -------- @@ -80,7 +81,7 @@ * the paint under the series (DG); * 06-Oct-2011 : Avoid GeneralPath methods requiring Java 1.5 (MK); * 03-Jul-2013 : Use ParamChecks (DG); - * + * 04-Aug-2014 : Restrict entity hotspot to plot area (patch #312) (UV); */ package org.jfree.chart.renderer.xy; @@ -192,7 +193,7 @@ /** * The shape used to represent an area in each legend item (this should - * never be <code>null</code>). + * never be {@code null}). */ private transient Shape legendArea; @@ -230,14 +231,12 @@ /** * Constructs a new renderer. To specify the type of renderer, use one of - * the constants: <code>SHAPES</code>, <code>LINES</code>, - * <code>SHAPES_AND_LINES</code>, <code>AREA</code> or - * <code>AREA_AND_SHAPES</code>. + * the constants: {@code SHAPES}, {@code LINES}, {@code SHAPES_AND_LINES}, + * {@code AREA} or {@code AREA_AND_SHAPES}. * * @param type the type of renderer. - * @param toolTipGenerator the tool tip generator to use - * (<code>null</code> permitted). - * @param urlGenerator the URL generator (<code>null</code> permitted). + * @param toolTipGenerator the tool tip generator ({@code null} permitted). + * @param urlGenerator the URL generator ({@code null} permitted). */ public XYAreaRenderer(int type, XYToolTipGenerator toolTipGenerator, XYURLGenerator urlGenerator) { @@ -279,7 +278,7 @@ /** * Returns true if shapes are being plotted by the renderer. * - * @return <code>true</code> if shapes are being plotted by the renderer. + * @return {@code true} if shapes are being plotted by the renderer. */ public boolean getPlotShapes() { return this.plotShapes; @@ -288,7 +287,7 @@ /** * Returns true if lines are being plotted by the renderer. * - * @return <code>true</code> if lines are being plotted by the renderer. + * @return {@code true} if lines are being plotted by the renderer. */ public boolean getPlotLines() { return this.plotLines; @@ -297,7 +296,7 @@ /** * Returns true if Area is being plotted by the renderer. * - * @return <code>true</code> if Area is being plotted by the renderer. + * @return {@code true} if Area is being plotted by the renderer. */ public boolean getPlotArea() { return this.plotArea; @@ -331,7 +330,7 @@ /** * Returns the shape used to represent an area in the legend. * - * @return The legend area (never <code>null</code>). + * @return The legend area (never {@code null}). */ public Shape getLegendArea() { return this.legendArea; @@ -341,7 +340,7 @@ * Sets the shape used as an area in each legend item and sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param area the area (<code>null</code> not permitted). + * @param area the area ({@code null} not permitted). */ public void setLegendArea(Shape area) { ParamChecks.nullNotPermitted(area, "area"); @@ -378,7 +377,7 @@ /** * Returns the gradient paint transformer. * - * @return The gradient paint transformer (never <code>null</code>). + * @return The gradient paint transformer (never {@code null}). * * @since 1.0.14 */ @@ -390,7 +389,7 @@ * Sets the gradient paint transformer and sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param transformer the transformer (<code>null</code> not permitted). + * @param transformer the transformer ({@code null} not permitted). * * @since 1.0.14 */ @@ -485,7 +484,7 @@ * @param series the series index (zero-based). * @param item the item index (zero-based). * @param crosshairState crosshair information for the plot - * (<code>null</code> permitted). + * ({@code null} permitted). * @param pass the pass index. */ @Override @@ -537,45 +536,23 @@ double transZero = rangeAxis.valueToJava2D(0.0, dataArea, plot.getRangeAxisEdge()); - GeneralPath hotspot = new GeneralPath(); - if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { - moveTo(hotspot, transZero, ((transX0 + transX1) / 2.0)); - lineTo(hotspot, ((transY0 + transY1) / 2.0), - ((transX0 + transX1) / 2.0)); - lineTo(hotspot, transY1, transX1); - lineTo(hotspot, ((transY1 + transY2) / 2.0), - ((transX1 + transX2) / 2.0)); - lineTo(hotspot, transZero, ((transX1 + transX2) / 2.0)); - } - else { // vertical orientation - moveTo(hotspot, ((transX0 + transX1) / 2.0), transZero); - lineTo(hotspot, ((transX0 + transX1) / 2.0), - ((transY0 + transY1) / 2.0)); - lineTo(hotspot, transX1, transY1); - lineTo(hotspot, ((transX1 + transX2) / 2.0), - ((transY1 + transY2) / 2.0)); - lineTo(hotspot, ((transX1 + transX2) / 2.0), transZero); - } - hotspot.closePath(); if (item == 0) { // create a new area polygon for the series areaState.area = new GeneralPath(); // the first point is (x, 0) double zero = rangeAxis.valueToJava2D(0.0, dataArea, plot.getRangeAxisEdge()); - if (plot.getOrientation() == PlotOrientation.VERTICAL) { + if (plot.getOrientation().isVertical()) { moveTo(areaState.area, transX1, zero); - } - else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { + } else if (plot.getOrientation().isHorizontal()) { moveTo(areaState.area, zero, transX1); } } // Add each point to Area (x, y) - if (plot.getOrientation() == PlotOrientation.VERTICAL) { + if (plot.getOrientation().isVertical()) { lineTo(areaState.area, transX1, transY1); - } - else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { + } else if (plot.getOrientation().isHorizontal()) { lineTo(areaState.area, transY1, transX1); } @@ -591,8 +568,7 @@ if (orientation == PlotOrientation.VERTICAL) { shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1); - } - else if (orientation == PlotOrientation.HORIZONTAL) { + } else if (orientation == PlotOrientation.HORIZONTAL) { shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1); } @@ -603,8 +579,7 @@ if (item > 0) { if (plot.getOrientation() == PlotOrientation.VERTICAL) { areaState.line.setLine(transX0, transY0, transX1, transY1); - } - else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { + } else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { areaState.line.setLine(transY0, transX0, transY1, transX1); } g2.draw(areaState.line); @@ -619,8 +594,7 @@ // Add the last point (x,0) lineTo(areaState.area, transX1, transZero); areaState.area.closePath(); - } - else if (orientation == PlotOrientation.HORIZONTAL) { + } else if (orientation == PlotOrientation.HORIZONTAL) { // Add the last point (x,0) lineTo(areaState.area, transZero, transX1); areaState.area.closePath(); @@ -677,7 +651,29 @@ // collect entity and tool tip information... EntityCollection entities = state.getEntityCollection(); if (entities != null) { - addEntity(entities, hotspot, dataset, series, item, 0.0, 0.0); + GeneralPath hotspot = new GeneralPath(); + if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { + moveTo(hotspot, transZero, ((transX0 + transX1) / 2.0)); + lineTo(hotspot, ((transY0 + transY1) / 2.0), ((transX0 + transX1) / 2.0)); + lineTo(hotspot, transY1, transX1); + lineTo(hotspot, ((transY1 + transY2) / 2.0), ((transX1 + transX2) / 2.0)); + lineTo(hotspot, transZero, ((transX1 + transX2) / 2.0)); + } else { // vertical orientation + moveTo(hotspot, ((transX0 + transX1) / 2.0), transZero); + lineTo(hotspot, ((transX0 + transX1) / 2.0), ((transY0 + transY1) / 2.0)); + lineTo(hotspot, transX1, transY1); + lineTo(hotspot, ((transX1 + transX2) / 2.0), ((transY1 + transY2) / 2.0)); + lineTo(hotspot, ((transX1 + transX2) / 2.0), transZero); + } + hotspot.closePath(); + + // limit the entity hotspot area to the data area + Area dataAreaHotspot = new Area(hotspot); + dataAreaHotspot.intersect(new Area(dataArea)); + + if (dataAreaHotspot.isEmpty() == false) { + addEntity(entities, dataAreaHotspot, dataset, series, item, 0.0, 0.0); + } } } Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer2.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer2.java 2014-08-04 08:09:35 UTC (rev 3288) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/XYAreaRenderer2.java 2014-08-04 08:29:24 UTC (rev 3289) @@ -34,6 +34,7 @@ * Richard Atkinson; * Christian W. Zuckschwerdt; * Martin Krauskopf; + * Ulrich Voigt (patch #312); * * Changes: * -------- @@ -78,6 +79,7 @@ * 17-Jun-2008 : Apply legend font and paint attributes (DG); * 06-Oct-2011 : Avoid GeneralPath methods requiring Java 1.5 (MK); * 03-Jul-2013 : Use ParamChecks (DG); + * 04-Aug-2014 : Restrict entity hotspot to plot area (patch #312) (UV); * */ @@ -87,6 +89,7 @@ import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; +import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; import java.io.IOException; @@ -130,7 +133,7 @@ /** * The shape used to represent an area in each legend item (this should - * never be <code>null</code>). + * never be {@code null}). */ private transient Shape legendArea; @@ -144,9 +147,9 @@ /** * Constructs a new renderer. * - * @param labelGenerator the tool tip generator to use. <code>null</code> - * is none. - * @param urlGenerator the URL generator (null permitted). + * @param labelGenerator the tool tip generator to use ({@code null} + * permitted). + * @param urlGenerator the URL generator ({@code null} permitted). */ public XYAreaRenderer2(XYToolTipGenerator labelGenerator, XYURLGenerator urlGenerator) { @@ -206,7 +209,7 @@ /** * Returns the shape used to represent an area in the legend. * - * @return The legend area (never <code>null</code>). + * @return The legend area (never {@code null}). * * @see #setLegendArea(Shape) */ @@ -218,7 +221,7 @@ * Sets the shape used as an area in each legend item and sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param area the area (<code>null</code> not permitted). + * @param area the area ({@code null} not permitted). * * @see #getLegendArea() */ @@ -289,7 +292,7 @@ * @param series the series index (zero-based). * @param item the item index (zero-based). * @param crosshairState crosshair information for the plot - * (<code>null</code> permitted). + * ({@code null} permitted). * @param pass the pass index. */ @Override @@ -386,19 +389,25 @@ if (state.getInfo() != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { - String tip = null; - XYToolTipGenerator generator = getToolTipGenerator(series, - item); - if (generator != null) { - tip = generator.generateToolTip(dataset, series, item); + // limit the entity hotspot area to the data area + Area dataAreaHotspot = new Area(hotspot); + dataAreaHotspot.intersect(new Area(dataArea)); + if (!dataAreaHotspot.isEmpty()) { + String tip = null; + XYToolTipGenerator generator = getToolTipGenerator(series, + item); + if (generator != null) { + tip = generator.generateToolTip(dataset, series, item); + } + String url = null; + if (getURLGenerator() != null) { + url = getURLGenerator().generateURL(dataset, series, + item); + } + XYItemEntity entity = new XYItemEntity(dataAreaHotspot, + dataset, series, item, tip, url); + entities.add(entity); } - String url = null; - if (getURLGenerator() != null) { - url = getURLGenerator().generateURL(dataset, series, item); - } - XYItemEntity entity = new XYItemEntity(hotspot, dataset, - series, item, tip, url); - entities.add(entity); } } @@ -407,7 +416,7 @@ /** * Tests this renderer for equality with an arbitrary object. * - * @param obj the object (<code>null</code> not permitted). + * @param obj the object ({@code null} not permitted). * * @return A boolean. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:09:40
|
Revision: 3288 http://sourceforge.net/p/jfreechart/code/3288 Author: mungady Date: 2014-08-04 08:09:35 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: * org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java (drawItem): Restrict entity hotspot to within the plot area Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java 2014-08-04 08:04:51 UTC (rev 3287) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java 2014-08-04 08:09:35 UTC (rev 3288) @@ -32,6 +32,7 @@ * Original Author: Richard Atkinson; * Contributor(s): Christian W. Zuckschwerdt; * David Gilbert (for Object Refinery Limited); + * Ulrich Voigt (patch #312); * * Changes: * -------- @@ -63,6 +64,7 @@ * 22-Mar-2007 : Fire change events in setShapePaint() and setShapeStroke() * methods (DG); * 20-Apr-2007 : Updated getLegendItem() for renderer change (DG); + * 04-Aug-2014 : Fix entity hotspot (patch #312) (UV); * */ @@ -74,6 +76,7 @@ import java.awt.Polygon; import java.awt.Shape; import java.awt.Stroke; +import java.awt.geom.Area; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import java.io.IOException; @@ -246,14 +249,12 @@ /** * Constructs a new renderer. To specify the type of renderer, use one of - * the constants: <code>SHAPES</code>, <code>LINES</code>, - * <code>SHAPES_AND_LINES</code>, <code>AREA</code> or - * <code>AREA_AND_SHAPES</code>. + * the constants: {@code SHAPES}, {@code LINES}, {@code SHAPES_AND_LINES}, + * {@code AREA} or {@code AREA_AND_SHAPES}. * * @param type the type of renderer. - * @param labelGenerator the tool tip generator to use (<code>null</code> - * is none). - * @param urlGenerator the URL generator (<code>null</code> permitted). + * @param labelGenerator the tool tip generator ({@code null} permitted). + * @param urlGenerator the URL generator ({@code null} permitted). */ public StackedXYAreaRenderer(int type, XYToolTipGenerator labelGenerator, XYURLGenerator urlGenerator) { @@ -261,10 +262,10 @@ } /** - * Returns the paint used for rendering shapes, or <code>null</code> if + * Returns the paint used for rendering shapes, or {@code null} if * using series paints. * - * @return The paint (possibly <code>null</code>). + * @return The paint (possibly {@code null}). * * @see #setShapePaint(Paint) */ @@ -276,7 +277,7 @@ * Sets the paint for rendering shapes and sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param shapePaint the paint (<code>null</code> permitted). + * @param shapePaint the paint ({@code null} permitted). * * @see #getShapePaint() */ @@ -289,7 +290,7 @@ * Returns the stroke used for rendering shapes, or <code>null</code> if * using series strokes. * - * @return The stroke (possibly <code>null</code>). + * @return The stroke (possibly {@code null}). * * @see #setShapeStroke(Stroke) */ @@ -301,7 +302,7 @@ * Sets the stroke for rendering shapes and sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param shapeStroke the stroke (<code>null</code> permitted). + * @param shapeStroke the stroke ({@code null} permitted). * * @see #getShapeStroke() */ @@ -350,12 +351,12 @@ * Returns the range of values the renderer requires to display all the * items from the specified dataset. * - * @param dataset the dataset (<code>null</code> permitted). + * @param dataset the dataset ({@code null} permitted). * * @return The range ([0.0, 0.0] if the dataset contains no values, and - * <code>null</code> if the dataset is <code>null</code>). + * {@code null} if the dataset is {@code null}). * - * @throws ClassCastException if <code>dataset</code> is not an instance + * @throws ClassCastException if {@code dataset} is not an instance * of {@link TableXYDataset}. */ @Override @@ -584,20 +585,26 @@ if (state.getInfo() != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null && shape != null && !nullPoint) { - String tip = null; - XYToolTipGenerator generator - = getToolTipGenerator(series, item); - if (generator != null) { - tip = generator.generateToolTip(dataset, series, item); + // limit the entity hotspot area to the data area + Area dataAreaHotspot = new Area(shape); + dataAreaHotspot.intersect(new Area(dataArea)); + if (!dataAreaHotspot.isEmpty()) { + String tip = null; + XYToolTipGenerator generator = getToolTipGenerator( + series, item); + if (generator != null) { + tip = generator.generateToolTip(dataset, series, + item); + } + String url = null; + if (getURLGenerator() != null) { + url = getURLGenerator().generateURL(dataset, series, + item); + } + XYItemEntity entity = new XYItemEntity(dataAreaHotspot, + dataset, series, item, tip, url); + entities.add(entity); } - String url = null; - if (getURLGenerator() != null) { - url = getURLGenerator().generateURL(dataset, series, - item); - } - XYItemEntity entity = new XYItemEntity(shape, dataset, - series, item, tip, url); - entities.add(entity); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:04:58
|
Revision: 3287 http://sourceforge.net/p/jfreechart/code/3287 Author: mungady Date: 2014-08-04 08:04:51 +0000 (Mon, 04 Aug 2014) Log Message: ----------- Header update. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java 2014-08-04 08:00:06 UTC (rev 3286) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java 2014-08-04 08:04:51 UTC (rev 3287) @@ -31,7 +31,7 @@ * * Original Author: David Gilbert (for Object Refinery Limited), based on * the StackedXYAreaRenderer class by Richard Atkinson; - * Contributor(s): -; + * Contributor(s): Ulrich Voigt (patch #312); * * Changes: * -------- @@ -51,6 +51,7 @@ * Clayton) (DG); * 30-Nov-2006 : Added accessor methods for the roundXCoordinates flag (DG); * 02-Jun-2008 : Fixed bug with PlotOrientation.HORIZONTAL (DG); + * 04-Aug-2014 : Fix entity hotspot (patch 312) (UV); * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 08:00:20
|
Revision: 3286 http://sourceforge.net/p/jfreechart/code/3286 Author: mungady Date: 2014-08-04 08:00:06 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: * org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java (drawItem): Correct the entity hotspot. 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-08-04 07:59:53 UTC (rev 3285) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-08-04 08:00:06 UTC (rev 3286) @@ -1,3 +1,11 @@ +2014-08-04 David Gilbert <dav...@ob...> + + Patch #312 by Ulrich Voigt: + * org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java + (drawItem): Correct the entity hotspot. + +---------- JFREECHART 1.0.19 RELEASED ------------------------ + 2014-07-29 David Gilbert <dav...@ob...> * org/jfree/chart/axis/Axis.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-08-04 07:59:58
|
Revision: 3285 http://sourceforge.net/p/jfreechart/code/3285 Author: mungady Date: 2014-08-04 07:59:53 +0000 (Mon, 04 Aug 2014) Log Message: ----------- 2014-08-04 David Gilbert <dav...@ob...> Patch #312 by Ulrich Voigt: * org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java (drawItem): Correct the entity hotspot. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java 2014-07-31 12:32:18 UTC (rev 3284) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java 2014-08-04 07:59:53 UTC (rev 3285) @@ -58,7 +58,7 @@ import java.awt.Graphics2D; import java.awt.Paint; -import java.awt.Shape; +import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; import java.io.Serializable; @@ -114,9 +114,9 @@ /** * Constructs a new renderer. * - * @param labelGenerator the tool tip generator to use. <code>null</code> - * is none. - * @param urlGenerator the URL generator (<code>null</code> permitted). + * @param labelGenerator the tool tip generator to use ({@code null} + * permitted). + * @param urlGenerator the URL generator ({@code null} permitted). */ public StackedXYAreaRenderer2(XYToolTipGenerator labelGenerator, XYURLGenerator urlGenerator) { @@ -158,10 +158,10 @@ * Returns the range of values the renderer requires to display all the * items from the specified dataset. * - * @param dataset the dataset (<code>null</code> permitted). + * @param dataset the dataset ({@code null} permitted). * - * @return The range (or <code>null</code> if the dataset is - * <code>null</code> or empty). + * @return The range (or {@code null} if the dataset is {@code null} or + * empty). */ @Override public Range findRangeBounds(XYDataset dataset) { @@ -218,7 +218,6 @@ int series, int item, CrosshairState crosshairState, int pass) { // setup for collecting optional entity info... - Shape entityArea; EntityCollection entities = null; if (info != null) { entities = info.getOwner().getEntityCollection(); @@ -300,22 +299,19 @@ left.lineTo(transX1, transStack1); left.lineTo(transXLeft, transStackLeft); left.lineTo(transXLeft, transYLeft); - } - else { + } else { left.moveTo(transY1, transX1); left.lineTo(transStack1, transX1); left.lineTo(transStackLeft, transXLeft); left.lineTo(transYLeft, transXLeft); } left.closePath(); - } - else { + } else { if (orientation == PlotOrientation.VERTICAL) { left.moveTo(transX1, transStack1); left.lineTo(transX1, transY1); left.lineTo(transXLeft, transStackLeft); - } - else { + } else { left.moveTo(transStack1, transX1); left.lineTo(transY1, transX1); left.lineTo(transStackLeft, transXLeft); @@ -335,8 +331,7 @@ right.lineTo(transX1, transY1); right.lineTo(transXRight, transYRight); right.lineTo(transXRight, transStackRight); - } - else { + } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transYRight, transXRight); @@ -349,8 +344,7 @@ right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transStackRight); - } - else { + } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transStackRight, transXRight); @@ -372,15 +366,13 @@ left.moveTo(transX1, transStack1); left.lineTo(transX1, transY1); left.lineTo(transXLeft, transStackLeft); - } - else { + } else { left.moveTo(transStack1, transX1); left.lineTo(transY1, transX1); left.lineTo(transStackLeft, transXLeft); } left.clone(); - } - else { + } else { double yleft = (y0 + y1) / 2.0 + stackLeft[0]; float transYLeft = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1); @@ -389,8 +381,7 @@ left.lineTo(transX1, transStack1); left.lineTo(transXLeft, transStackLeft); left.lineTo(transXLeft, transYLeft); - } - else { + } else { left.moveTo(transY1, transX1); left.lineTo(transStack1, transX1); left.lineTo(transStackLeft, transXLeft); @@ -407,15 +398,13 @@ right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transStackRight); - } - else { + } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transStackRight, transXRight); } right.closePath(); - } - else { + } else { double yright = (y1 + y2) / 2.0 + stackRight[0]; float transYRight = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1); @@ -424,8 +413,7 @@ right.lineTo(transX1, transY1); right.lineTo(transXRight, transYRight); right.lineTo(transXRight, transStackRight); - } - else { + } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transYRight, transXRight); @@ -445,27 +433,30 @@ // add an entity for the item... if (entities != null) { - GeneralPath gp = new GeneralPath(left); - gp.append(right, false); - entityArea = gp; - addEntity(entities, entityArea, dataset, series, item, - transX1, transY1); + // Create the entity area and limit it to the data area + Area dataAreaHotspot = new Area(left); + dataAreaHotspot.add(new Area(right)); + dataAreaHotspot.intersect(new Area(dataArea)); + + if (!dataAreaHotspot.isEmpty()) { + addEntity(entities, dataAreaHotspot, dataset, series, item, + transX1, transY1); + } } - } /** * Calculates the stacked values (one positive and one negative) of all - * series up to, but not including, <code>series</code> for the specified - * item. It returns [0.0, 0.0] if <code>series</code> is the first series. + * series up to, but not including, {@code series} for the specified + * item. It returns [0.0, 0.0] if {@code series} is the first series. * - * @param dataset the dataset (<code>null</code> not permitted). + * @param dataset the dataset ({@code null} not permitted). * @param series the series index. * @param index the item index. * * @return An array containing the cumulative negative and positive values - * for all series values up to but excluding <code>series</code> - * for <code>index</code>. + * for all series values up to but excluding {@code series} + * for {@code index}. */ private double[] getStackValues(TableXYDataset dataset, int series, int index) { @@ -530,7 +521,7 @@ /** * Tests this renderer for equality with an arbitrary object. * - * @param obj the object (<code>null</code> permitted). + * @param obj the object ({@code null} permitted). * * @return A boolean. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 12:32:26
|
Revision: 3284 http://sourceforge.net/p/jfreechart/code/3284 Author: mungady Date: 2014-07-31 12:32:18 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Exclude demo files from Maven build. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/pom.xml Modified: branches/jfreechart-1.0.x-branch/pom.xml =================================================================== --- branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 11:53:49 UTC (rev 3283) +++ branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 12:32:18 UTC (rev 3284) @@ -126,6 +126,7 @@ <target>${project.target.level}</target> <encoding>${project.build.sourceEncoding}</encoding> <excludes> + <exclude>org/jfree/chart/demo/**</exclude> <exclude>org/jfree/chart/fx/**</exclude> </excludes> </configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 11:53:53
|
Revision: 3283 http://sourceforge.net/p/jfreechart/code/3283 Author: mungady Date: 2014-07-31 11:53:49 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Set release version. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/pom.xml Modified: branches/jfreechart-1.0.x-branch/pom.xml =================================================================== --- branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 11:51:16 UTC (rev 3282) +++ branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 11:53:49 UTC (rev 3283) @@ -10,7 +10,7 @@ <artifactId>jfreechart</artifactId> <groupId>org.jfree</groupId> - <version>1.0.19-SNAPSHOT</version> + <version>1.0.19</version> <packaging>jar</packaging> <!-- this is required to host it on Sonatype's OSSRH --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 11:51:24
|
Revision: 3282 http://sourceforge.net/p/jfreechart/code/3282 Author: mungady Date: 2014-07-31 11:51:16 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Mention JSFreeChart. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/README.txt Modified: branches/jfreechart-1.0.x-branch/README.txt =================================================================== --- branches/jfreechart-1.0.x-branch/README.txt 2014-07-31 11:44:15 UTC (rev 3281) +++ branches/jfreechart-1.0.x-branch/README.txt 2014-07-31 11:51:16 UTC (rev 3282) @@ -179,9 +179,9 @@ If there are other items that you think should be listed here, please post a bug report. --------------- +--------------- 10. WHAT's NEW --------------- +--------------- A list of changes in recent versions: 1.0.19 : (31-Jul-2014) @@ -192,7 +192,10 @@ - FastScatterPlot panning direction is corrected; - added rendering hints to sharpen gridlines and borders in most output formats; - - JFreeSVG updated to version 2.0. + - JFreeSVG updated to version 2.0; + - included a preview of JSFreeChart, a 2D chart library written in + JavaScript that is conceptually similar to JFreeChart but runs + directly in a web browser. 1.0.18 : (3-Jul-2014) - added JavaFX support via FXGraphics2D; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 11:44:24
|
Revision: 3281 http://sourceforge.net/p/jfreechart/code/3281 Author: mungady Date: 2014-07-31 11:44:15 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Delete empty folders. Removed Paths: ------------- branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/annotations/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/axis/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/plot/dial/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/renderer/junit/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/renderer/xy/junit/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/title/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/chart/util/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/data/ branches/jfreechart-1.0.x-branch/experimental/org/jfree/experimental/swt/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 10:24:01
|
Revision: 3280 http://sourceforge.net/p/jfreechart/code/3280 Author: mungady Date: 2014-07-31 10:23:53 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Update Ant build scripts for release. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ant/build-fx.xml branches/jfreechart-1.0.x-branch/ant/build-swt.xml branches/jfreechart-1.0.x-branch/ant/build.xml Modified: branches/jfreechart-1.0.x-branch/ant/build-fx.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2014-07-31 10:14:25 UTC (rev 3279) +++ branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2014-07-31 10:23:53 UTC (rev 3280) @@ -23,10 +23,10 @@ <property name="jfreechart.version" value="1.0.19-fx" /> <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.22" /> + <property name="jcommon.version" value="1.0.23" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreesvg.name" value="jfreesvg" /> - <property name="jfreesvg.version" value="1.9" /> + <property name="jfreesvg.version" value="2.0" /> <property name="orsonpdf.name" value="orsonpdf" /> <property name="orsonpdf.version" value="1.6-eval" /> <property name="orsoncharts.version" value="1.4-eval" /> @@ -58,7 +58,8 @@ debug="on" deprecation="false" source="${src.version}" - target="${target.version}"> + target="${target.version}" + includeantruntime="false"> <classpath refid="build.classpath" /> <include name="org/jfree/**"/> </javac> @@ -128,7 +129,8 @@ debug="on" deprecation="false" source="${src.version}" - target="${target.version}"> + target="${target.version}" + includeantruntime="false"> <classpath refid="build.experimental.classpath" /> <include name="org/jfree/experimental/**"/> <exclude name="org/jfree/experimental/**/junit/*"/> @@ -339,7 +341,8 @@ target="1.6" debug="true" deprecation="false" - optimize="false"> + optimize="false" + includeantruntime="false"> <classpath> <path refid="build.classpath"/> <pathelement location="${junit.jar}"/> Modified: branches/jfreechart-1.0.x-branch/ant/build-swt.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build-swt.xml 2014-07-31 10:14:25 UTC (rev 3279) +++ branches/jfreechart-1.0.x-branch/ant/build-swt.xml 2014-07-31 10:23:53 UTC (rev 3280) @@ -6,7 +6,7 @@ <property name="jfreechart.name" value="jfreechart" /> <property name="jfreechart.version" value="1.0.19" /> <property name="jcommon.name" value="jcommon" /> - <property name="jcommon.version" value="1.0.22" /> + <property name="jcommon.version" value="1.0.23" /> <property name="builddir" value="${basedir}/build" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreechart.jar" value="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar"/> @@ -33,7 +33,8 @@ debug="on" deprecation="on" source="1.6" - target="1.6"> + target="1.6" + includeantruntime="false"> <classpath refid="build.classpath" /> <include name="org/jfree/experimental/swt/**/*.java"/> </javac> @@ -61,7 +62,8 @@ debug="on" deprecation="on" source="1.6" - target="1.6"> + target="1.6" + includeantruntime="false"> <classpath refid="build.classpath" /> <include name="org/jfree/experimental/chart/**/*.java"/> </javac> Modified: branches/jfreechart-1.0.x-branch/ant/build.xml =================================================================== --- branches/jfreechart-1.0.x-branch/ant/build.xml 2014-07-31 10:14:25 UTC (rev 3279) +++ branches/jfreechart-1.0.x-branch/ant/build.xml 2014-07-31 10:23:53 UTC (rev 3280) @@ -23,10 +23,10 @@ <property name="jfreechart.version" value="1.0.19" /> <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.22" /> + <property name="jcommon.version" value="1.0.23" /> <property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/> <property name="jfreesvg.name" value="jfreesvg" /> - <property name="jfreesvg.version" value="1.9" /> + <property name="jfreesvg.version" value="2.0" /> <property name="orsonpdf.name" value="orsonpdf" /> <property name="orsonpdf.version" value="1.6-eval" /> <property name="orsoncharts.version" value="1.4-eval-nofx" /> @@ -58,7 +58,8 @@ debug="on" deprecation="false" source="${src.version}" - target="${target.version}"> + target="${target.version}" + includeantruntime="false"> <classpath refid="build.classpath" /> <include name="org/jfree/**"/> <exclude name="org/jfree/chart/fx/**"/> @@ -122,7 +123,8 @@ debug="on" deprecation="false" source="${src.version}" - target="${target.version}"> + target="${target.version}" + includeantruntime="false"> <classpath refid="build.experimental.classpath" /> <include name="org/jfree/experimental/**"/> <exclude name="org/jfree/experimental/**/junit/*"/> @@ -355,7 +357,8 @@ target="1.6" debug="true" deprecation="false" - optimize="false"> + optimize="false" + includeantruntime="false"> <classpath> <path refid="build.classpath"/> <pathelement location="${junit.jar}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 10:14:35
|
Revision: 3279 http://sourceforge.net/p/jfreechart/code/3279 Author: mungady Date: 2014-07-31 10:14:25 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Update JCommon and JFreeSVG versions. Added Paths: ----------- branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar Removed Paths: ------------- branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.22.jar branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.9.jar Deleted: branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.22.jar =================================================================== (Binary files differ) Added: branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar =================================================================== (Binary files differ) Index: branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar =================================================================== --- branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar 2014-07-31 10:05:20 UTC (rev 3278) +++ branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar 2014-07-31 10:14:25 UTC (rev 3279) Property changes on: branches/jfreechart-1.0.x-branch/lib/jcommon-1.0.23.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: branches/jfreechart-1.0.x-branch/lib/jfreesvg-1.9.jar =================================================================== (Binary files differ) Added: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar =================================================================== (Binary files differ) Index: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar =================================================================== --- branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar 2014-07-31 10:05:20 UTC (rev 3278) +++ branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.jar 2014-07-31 10:14:25 UTC (rev 3279) Property changes on: branches/jfreechart-1.0.x-branch/lib/jfreesvg-2.0.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-07-31 10:05:23
|
Revision: 3278 http://sourceforge.net/p/jfreechart/code/3278 Author: mungady Date: 2014-07-31 10:05:20 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Preview of JSFreeChart. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/NEWS Modified: branches/jfreechart-1.0.x-branch/NEWS =================================================================== --- branches/jfreechart-1.0.x-branch/NEWS 2014-07-31 09:56:07 UTC (rev 3277) +++ branches/jfreechart-1.0.x-branch/NEWS 2014-07-31 10:05:20 UTC (rev 3278) @@ -15,7 +15,11 @@ - added rendering hints to sharpen gridlines and borders in most output formats; - JFreeSVG updated to version 2.0. +In this release, we have also provided a preview of JSFreeChart, a free 2D +chart library written in JavaScript that is conceptually similar to JFreeChart +but runs directly in browsers. + JFreeChart 1.0.18 ----------------- 3 July 2014 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 09:56:24
|
Revision: 3277 http://sourceforge.net/p/jfreechart/code/3277 Author: mungady Date: 2014-07-31 09:56:07 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Preview of JSFreeChart. Added Paths: ----------- branches/jfreechart-1.0.x-branch/jsfreechart/ branches/jfreechart-1.0.x-branch/jsfreechart/BarChartDemo.html branches/jfreechart-1.0.x-branch/jsfreechart/LineChartDemo.html branches/jfreechart-1.0.x-branch/jsfreechart/README.txt branches/jfreechart-1.0.x-branch/jsfreechart/ScatterChartDemo.html branches/jfreechart-1.0.x-branch/jsfreechart/lib/ branches/jfreechart-1.0.x-branch/jsfreechart/lib/gpl-3.0.txt branches/jfreechart-1.0.x-branch/jsfreechart/lib/jsfreechart.js Added: branches/jfreechart-1.0.x-branch/jsfreechart/BarChartDemo.html =================================================================== --- branches/jfreechart-1.0.x-branch/jsfreechart/BarChartDemo.html (rev 0) +++ branches/jfreechart-1.0.x-branch/jsfreechart/BarChartDemo.html 2014-07-31 09:56:07 UTC (rev 3277) @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<html> + <head> + <title>Bar Chart Demo</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <script type="text/javascript" src="lib/jsfreechart.js"></script> + <style> + .chart_container { height: 100%; width: 100%; } + body { margin: 0; border: 2px; padding: 5px; } + .row, .col { overflow: hidden; position: absolute; } + .row { left: 0; right: 0; } + .col { top: 0; bottom: 0; } + .scroll-x { overflow-x: none; } + .scroll-y { overflow-y: none; } + + .header.row { height: 105px; top: 0; } + .body.row { top: 105px; bottom: 50px; } + .footer.row { height: 50px; bottom: 0; } + </style> + </head> + <body onload="installChart();"> + <script type="application/javascript"> + function installChart() { + var dataset = new jsfc.KeyedValues2DDataset(); + dataset.add("Warm-up", "JFreeSVG", 7445); + dataset.add("Warm-up", "Batik", 24448); + dataset.add("Test", "JFreeSVG", 4297); + dataset.add("Test", "Batik", 21022); + var chart = jsfc.Charts.createBarChart("Performance: JFreeSVG vs Batik", + "Time to generate 1000 charts in SVG (lower bars = better performance)", + dataset, null, "Milliseconds"); + chart.setSize(600, 400); + var svg = document.getElementById("chart_svg"); + document.chartManager = new jsfc.ChartManager(svg, chart); + document.chartManager.refreshDisplay(); + var win = document.defaultView || document.parentWindow; + win.onresize = resize; + }; + function resize(evt) { + var element = document.getElementById("bar_chart_1"); + var w = Math.max(300, element.clientWidth); + var h = Math.max(200, element.clientHeight); + document.chartManager.getChart().setSize(w, h); + document.chartManager.refreshDisplay(); + } + + </script> + <div class="header row"> + <h4>Resizing Chart Demo:</h4> + <p>In this demo we have a chart that resizes according to the resizing + of its container.</p> + </div> + <div class="body row scroll-x scroll-y"> + <div id="bar_chart_1" class="chart_container"> + <svg id="chart_svg" width="100%" height="100%"></svg> + </div> + </div> + <div class="footer row"> + <p id="debug">This is a footer, part of the HTML not the chart.</p> + </div> + </body> +</html> Added: branches/jfreechart-1.0.x-branch/jsfreechart/LineChartDemo.html =================================================================== --- branches/jfreechart-1.0.x-branch/jsfreechart/LineChartDemo.html (rev 0) +++ branches/jfreechart-1.0.x-branch/jsfreechart/LineChartDemo.html 2014-07-31 09:56:07 UTC (rev 3277) @@ -0,0 +1,372 @@ + <!DOCTYPE html> +<html> + <head> + <title>Line Plot drawn to a 2D context</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <script type="text/javascript" src="lib/jsfreechart.js"></script> + <style> + .chart_container { height: 100%; width: 100%; } + body { margin: 0; border: 2px; padding: 5px; } + .row, .col { overflow: hidden; position: absolute; } + .row { left: 0; right: 0; } + .col { top: 0; bottom: 0; } + .scroll-x { overflow-x: none; } + .scroll-y { overflow-y: none; } + + .header.row { height: 75px; top: 0; } + .body.row { top: 75px; bottom: 50px;} + .footer.row { height: 50px; bottom: 0; } + </style> + </head> + <body onload="installChart();"> + <script type="application/javascript"> + function installChart() { + var dataset = new jsfc.StandardXYDataset(); + + var JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, + JUL = 6, AUG = 7, SEP = 8, OCT = 9, NOV = 10, DEC = 11; + + dataset.add("Indicator Price", new Date(2010, JAN).getTime(), 126.80); + dataset.add("Indicator Price", new Date(2010, FEB).getTime(), 123.37); + dataset.add("Indicator Price", new Date(2010, MAR).getTime(), 125.30); + dataset.add("Indicator Price", new Date(2010, APR).getTime(), 126.89); + dataset.add("Indicator Price", new Date(2010, MAY).getTime(), 128.10); + dataset.add("Indicator Price", new Date(2010, JUN).getTime(), 142.20); + dataset.add("Indicator Price", new Date(2010, JUL).getTime(), 153.41); + dataset.add("Indicator Price", new Date(2010, AUG).getTime(), 157.46); + dataset.add("Indicator Price", new Date(2010, SEP).getTime(), 163.61); + dataset.add("Indicator Price", new Date(2010, OCT).getTime(), 161.56); + dataset.add("Indicator Price", new Date(2010, NOV).getTime(), 173.90); + dataset.add("Indicator Price", new Date(2010, DEC).getTime(), 184.26); + dataset.add("Indicator Price", new Date(2011, JAN).getTime(), 197.35); + dataset.add("Indicator Price", new Date(2011, FEB).getTime(), 216.03); + dataset.add("Indicator Price", new Date(2011, MAR).getTime(), 224.33); + dataset.add("Indicator Price", new Date(2011, APR).getTime(), 231.24); + dataset.add("Indicator Price", new Date(2011, MAY).getTime(), 227.97); + dataset.add("Indicator Price", new Date(2011, JUN).getTime(), 215.58); + dataset.add("Indicator Price", new Date(2011, JUL).getTime(), 210.36); + dataset.add("Indicator Price", new Date(2011, AUG).getTime(), 212.19); + dataset.add("Indicator Price", new Date(2011, SEP).getTime(), 213.04); + dataset.add("Indicator Price", new Date(2011, OCT).getTime(), 193.90); + dataset.add("Indicator Price", new Date(2011, NOV).getTime(), 193.66); + dataset.add("Indicator Price", new Date(2011, DEC).getTime(), 189.02); + dataset.add("Indicator Price", new Date(2012, JAN).getTime(), 188.90); + dataset.add("Indicator Price", new Date(2012, FEB).getTime(), 182.29); + dataset.add("Indicator Price", new Date(2012, MAR).getTime(), 167.77); + dataset.add("Indicator Price", new Date(2012, APR).getTime(), 160.46); + dataset.add("Indicator Price", new Date(2012, MAY).getTime(), 157.68); + dataset.add("Indicator Price", new Date(2012, JUN).getTime(), 145.31); + dataset.add("Indicator Price", new Date(2012, JUL).getTime(), 159.07); + dataset.add("Indicator Price", new Date(2012, AUG).getTime(), 148.50); + dataset.add("Indicator Price", new Date(2012, SEP).getTime(), 151.28); + dataset.add("Indicator Price", new Date(2012, OCT).getTime(), 147.12); + dataset.add("Indicator Price", new Date(2012, NOV).getTime(), 136.35); + dataset.add("Indicator Price", new Date(2012, DEC).getTime(), 131.31); + dataset.add("Indicator Price", new Date(2013, JAN).getTime(), 135.38); + dataset.add("Indicator Price", new Date(2013, FEB).getTime(), 131.51); + dataset.add("Indicator Price", new Date(2013, MAR).getTime(), 131.38); + + dataset.add("Columbian Milds", new Date(2010, JAN).getTime(), 207.51); + dataset.add("Columbian Milds", new Date(2010, FEB).getTime(), 204.71); + dataset.add("Columbian Milds", new Date(2010, MAR).getTime(), 205.71); + dataset.add("Columbian Milds", new Date(2010, APR).getTime(), 200.00); + dataset.add("Columbian Milds", new Date(2010, MAY).getTime(), 200.54); + dataset.add("Columbian Milds", new Date(2010, JUN).getTime(), 224.49); + dataset.add("Columbian Milds", new Date(2010, JUL).getTime(), 235.52); + dataset.add("Columbian Milds", new Date(2010, AUG).getTime(), 243.98); + dataset.add("Columbian Milds", new Date(2010, SEP).getTime(), 247.77); + dataset.add("Columbian Milds", new Date(2010, OCT).getTime(), 230.02); + dataset.add("Columbian Milds", new Date(2010, NOV).getTime(), 244.02); + dataset.add("Columbian Milds", new Date(2010, DEC).getTime(), 261.97); + dataset.add("Columbian Milds", new Date(2011, JAN).getTime(), 279.88); + dataset.add("Columbian Milds", new Date(2011, FEB).getTime(), 296.44); + dataset.add("Columbian Milds", new Date(2011, MAR).getTime(), 300.68); + dataset.add("Columbian Milds", new Date(2011, APR).getTime(), 312.95); + dataset.add("Columbian Milds", new Date(2011, MAY).getTime(), 302.17); + dataset.add("Columbian Milds", new Date(2011, JUN).getTime(), 287.95); + dataset.add("Columbian Milds", new Date(2011, JUL).getTime(), 285.21); + dataset.add("Columbian Milds", new Date(2011, AUG).getTime(), 286.97); + dataset.add("Columbian Milds", new Date(2011, SEP).getTime(), 287.54); + dataset.add("Columbian Milds", new Date(2011, OCT).getTime(), 257.66); + dataset.add("Columbian Milds", new Date(2011, NOV).getTime(), 256.99); + dataset.add("Columbian Milds", new Date(2011, DEC).getTime(), 251.60); + dataset.add("Columbian Milds", new Date(2012, JAN).getTime(), 255.91); + dataset.add("Columbian Milds", new Date(2012, FEB).getTime(), 244.14); + dataset.add("Columbian Milds", new Date(2012, MAR).getTime(), 222.84); + dataset.add("Columbian Milds", new Date(2012, APR).getTime(), 214.46); + dataset.add("Columbian Milds", new Date(2012, MAY).getTime(), 207.32); + dataset.add("Columbian Milds", new Date(2012, JUN).getTime(), 184.67); + dataset.add("Columbian Milds", new Date(2012, JUL).getTime(), 202.56); + dataset.add("Columbian Milds", new Date(2012, AUG).getTime(), 187.14); + dataset.add("Columbian Milds", new Date(2012, SEP).getTime(), 190.10); + dataset.add("Columbian Milds", new Date(2012, OCT).getTime(), 181.39); + dataset.add("Columbian Milds", new Date(2012, NOV).getTime(), 170.08); + dataset.add("Columbian Milds", new Date(2012, DEC).getTime(), 164.40); + dataset.add("Columbian Milds", new Date(2013, JAN).getTime(), 169.19); + dataset.add("Columbian Milds", new Date(2013, FEB).getTime(), 161.70); + dataset.add("Columbian Milds", new Date(2013, MAR).getTime(), 161.53); + + dataset.add("Other Milds", new Date(2010, JAN).getTime(), 158.90); + dataset.add("Other Milds", new Date(2010, FEB).getTime(), 157.86); + dataset.add("Other Milds", new Date(2010, MAR).getTime(), 164.50); + dataset.add("Other Milds", new Date(2010, APR).getTime(), 169.55); + dataset.add("Other Milds", new Date(2010, MAY).getTime(), 173.38); + dataset.add("Other Milds", new Date(2010, JUN).getTime(), 190.90); + dataset.add("Other Milds", new Date(2010, JUL).getTime(), 203.21); + dataset.add("Other Milds", new Date(2010, AUG).getTime(), 211.59); + dataset.add("Other Milds", new Date(2010, SEP).getTime(), 222.71); + dataset.add("Other Milds", new Date(2010, OCT).getTime(), 217.64); + dataset.add("Other Milds", new Date(2010, NOV).getTime(), 233.48); + dataset.add("Other Milds", new Date(2010, DEC).getTime(), 248.17); + dataset.add("Other Milds", new Date(2011, JAN).getTime(), 263.77); + dataset.add("Other Milds", new Date(2011, FEB).getTime(), 287.89); + dataset.add("Other Milds", new Date(2011, MAR).getTime(), 292.07); + dataset.add("Other Milds", new Date(2011, APR).getTime(), 300.12); + dataset.add("Other Milds", new Date(2011, MAY).getTime(), 291.09); + dataset.add("Other Milds", new Date(2011, JUN).getTime(), 274.98); + dataset.add("Other Milds", new Date(2011, JUL).getTime(), 268.02); + dataset.add("Other Milds", new Date(2011, AUG).getTime(), 270.44); + dataset.add("Other Milds", new Date(2011, SEP).getTime(), 274.88); + dataset.add("Other Milds", new Date(2011, OCT).getTime(), 247.82); + dataset.add("Other Milds", new Date(2011, NOV).getTime(), 245.09); + dataset.add("Other Milds", new Date(2011, DEC).getTime(), 236.71); + dataset.add("Other Milds", new Date(2012, JAN).getTime(), 237.21); + dataset.add("Other Milds", new Date(2012, FEB).getTime(), 224.16); + dataset.add("Other Milds", new Date(2012, MAR).getTime(), 201.26); + dataset.add("Other Milds", new Date(2012, APR).getTime(), 191.45); + dataset.add("Other Milds", new Date(2012, MAY).getTime(), 184.65); + dataset.add("Other Milds", new Date(2012, JUN).getTime(), 168.69); + dataset.add("Other Milds", new Date(2012, JUL).getTime(), 190.45); + dataset.add("Other Milds", new Date(2012, AUG).getTime(), 174.82); + dataset.add("Other Milds", new Date(2012, SEP).getTime(), 178.98); + dataset.add("Other Milds", new Date(2012, OCT).getTime(), 173.32); + dataset.add("Other Milds", new Date(2012, NOV).getTime(), 159.91); + dataset.add("Other Milds", new Date(2012, DEC).getTime(), 152.74); + dataset.add("Other Milds", new Date(2013, JAN).getTime(), 157.29); + dataset.add("Other Milds", new Date(2013, FEB).getTime(), 149.46); + dataset.add("Other Milds", new Date(2013, MAR).getTime(), 149.78); + + dataset.add("Brazilian Naturals", new Date(2010, JAN).getTime(), 131.67); + dataset.add("Brazilian Naturals", new Date(2010, FEB).getTime(), 124.57); + dataset.add("Brazilian Naturals", new Date(2010, MAR).getTime(), 126.21); + dataset.add("Brazilian Naturals", new Date(2010, APR).getTime(), 126.07); + dataset.add("Brazilian Naturals", new Date(2010, MAY).getTime(), 127.45); + dataset.add("Brazilian Naturals", new Date(2010, JUN).getTime(), 143.20); + dataset.add("Brazilian Naturals", new Date(2010, JUL).getTime(), 156.87); + dataset.add("Brazilian Naturals", new Date(2010, AUG).getTime(), 163.21); + dataset.add("Brazilian Naturals", new Date(2010, SEP).getTime(), 175.15); + dataset.add("Brazilian Naturals", new Date(2010, OCT).getTime(), 175.38); + dataset.add("Brazilian Naturals", new Date(2010, NOV).getTime(), 190.62); + dataset.add("Brazilian Naturals", new Date(2010, DEC).getTime(), 204.25); + dataset.add("Brazilian Naturals", new Date(2011, JAN).getTime(), 219.77); + dataset.add("Brazilian Naturals", new Date(2011, FEB).getTime(), 247.00); + dataset.add("Brazilian Naturals", new Date(2011, MAR).getTime(), 260.98); + dataset.add("Brazilian Naturals", new Date(2011, APR).getTime(), 273.40); + dataset.add("Brazilian Naturals", new Date(2011, MAY).getTime(), 268.66); + dataset.add("Brazilian Naturals", new Date(2011, JUN).getTime(), 250.59); + dataset.add("Brazilian Naturals", new Date(2011, JUL).getTime(), 245.69); + dataset.add("Brazilian Naturals", new Date(2011, AUG).getTime(), 249.83); + dataset.add("Brazilian Naturals", new Date(2011, SEP).getTime(), 255.64); + dataset.add("Brazilian Naturals", new Date(2011, OCT).getTime(), 234.28); + dataset.add("Brazilian Naturals", new Date(2011, NOV).getTime(), 236.75); + dataset.add("Brazilian Naturals", new Date(2011, DEC).getTime(), 228.79); + dataset.add("Brazilian Naturals", new Date(2012, JAN).getTime(), 228.21); + dataset.add("Brazilian Naturals", new Date(2012, FEB).getTime(), 215.40); + dataset.add("Brazilian Naturals", new Date(2012, MAR).getTime(), 192.03); + dataset.add("Brazilian Naturals", new Date(2012, APR).getTime(), 180.90); + dataset.add("Brazilian Naturals", new Date(2012, MAY).getTime(), 174.17); + dataset.add("Brazilian Naturals", new Date(2012, JUN).getTime(), 156.17); + dataset.add("Brazilian Naturals", new Date(2012, JUL).getTime(), 175.98); + dataset.add("Brazilian Naturals", new Date(2012, AUG).getTime(), 160.05); + dataset.add("Brazilian Naturals", new Date(2012, SEP).getTime(), 166.53); + dataset.add("Brazilian Naturals", new Date(2012, OCT).getTime(), 161.20); + dataset.add("Brazilian Naturals", new Date(2012, NOV).getTime(), 148.25); + dataset.add("Brazilian Naturals", new Date(2012, DEC).getTime(), 140.69); + dataset.add("Brazilian Naturals", new Date(2013, JAN).getTime(), 145.17); + dataset.add("Brazilian Naturals", new Date(2013, FEB).getTime(), 136.63); + dataset.add("Brazilian Naturals", new Date(2013, MAR).getTime(), 133.61); + + dataset.add("Robustas", new Date(2010, JAN).getTime(), 69.92); + dataset.add("Robustas", new Date(2010, FEB).getTime(), 67.88); + dataset.add("Robustas", new Date(2010, MAR).getTime(), 67.25); + dataset.add("Robustas", new Date(2010, APR).getTime(), 71.59); + dataset.add("Robustas", new Date(2010, MAY).getTime(), 70.70); + dataset.add("Robustas", new Date(2010, JUN).getTime(), 76.92); + dataset.add("Robustas", new Date(2010, JUL).getTime(), 85.27); + dataset.add("Robustas", new Date(2010, AUG).getTime(), 82.68); + dataset.add("Robustas", new Date(2010, SEP).getTime(), 81.28); + dataset.add("Robustas", new Date(2010, OCT).getTime(), 85.27); + dataset.add("Robustas", new Date(2010, NOV).getTime(), 92.04); + dataset.add("Robustas", new Date(2010, DEC).getTime(), 94.09); + dataset.add("Robustas", new Date(2011, JAN).getTime(), 101.09); + dataset.add("Robustas", new Date(2011, FEB).getTime(), 109.35); + dataset.add("Robustas", new Date(2011, MAR).getTime(), 118.13); + dataset.add("Robustas", new Date(2011, APR).getTime(), 117.37); + dataset.add("Robustas", new Date(2011, MAY).getTime(), 121.98); + dataset.add("Robustas", new Date(2011, JUN).getTime(), 117.95); + dataset.add("Robustas", new Date(2011, JUL).getTime(), 112.73); + dataset.add("Robustas", new Date(2011, AUG).getTime(), 112.07); + dataset.add("Robustas", new Date(2011, SEP).getTime(), 106.06); + dataset.add("Robustas", new Date(2011, OCT).getTime(), 98.10); + dataset.add("Robustas", new Date(2011, NOV).getTime(), 97.24); + dataset.add("Robustas", new Date(2011, DEC).getTime(), 98.41); + dataset.add("Robustas", new Date(2012, JAN).getTime(), 96.72); + dataset.add("Robustas", new Date(2012, FEB).getTime(), 101.93); + dataset.add("Robustas", new Date(2012, MAR).getTime(), 103.57); + dataset.add("Robustas", new Date(2012, APR).getTime(), 101.80); + dataset.add("Robustas", new Date(2012, MAY).getTime(), 106.88); + dataset.add("Robustas", new Date(2012, JUN).getTime(), 105.70); + dataset.add("Robustas", new Date(2012, JUL).getTime(), 107.06); + dataset.add("Robustas", new Date(2012, AUG).getTime(), 106.52); + dataset.add("Robustas", new Date(2012, SEP).getTime(), 104.95); + dataset.add("Robustas", new Date(2012, OCT).getTime(), 104.47); + dataset.add("Robustas", new Date(2012, NOV).getTime(), 97.67); + dataset.add("Robustas", new Date(2012, DEC).getTime(), 96.59); + dataset.add("Robustas", new Date(2013, JAN).getTime(), 99.69); + dataset.add("Robustas", new Date(2013, FEB).getTime(), 104.03); + dataset.add("Robustas", new Date(2013, MAR).getTime(), 106.26); + + dataset.add("Futures (London)", new Date(2010, JAN).getTime(), 62.66); + dataset.add("Futures (London)", new Date(2010, FEB).getTime(), 60.37); + dataset.add("Futures (London)", new Date(2010, MAR).getTime(), 58.64); + dataset.add("Futures (London)", new Date(2010, APR).getTime(), 62.21); + dataset.add("Futures (London)", new Date(2010, MAY).getTime(), 62.46); + dataset.add("Futures (London)", new Date(2010, JUN).getTime(), 69.72); + dataset.add("Futures (London)", new Date(2010, JUL).getTime(), 78.17); + dataset.add("Futures (London)", new Date(2010, AUG).getTime(), 78.42); + dataset.add("Futures (London)", new Date(2010, SEP).getTime(), 75.87); + dataset.add("Futures (London)", new Date(2010, OCT).getTime(), 80.08); + dataset.add("Futures (London)", new Date(2010, NOV).getTime(), 86.40); + dataset.add("Futures (London)", new Date(2010, DEC).getTime(), 88.70); + dataset.add("Futures (London)", new Date(2011, JAN).getTime(), 96.02); + dataset.add("Futures (London)", new Date(2011, FEB).getTime(), 104.53); + dataset.add("Futures (London)", new Date(2011, MAR).getTime(), 111.36); + dataset.add("Futures (London)", new Date(2011, APR).getTime(), 111.34); + dataset.add("Futures (London)", new Date(2011, MAY).getTime(), 116.76); + dataset.add("Futures (London)", new Date(2011, JUN).getTime(), 110.51); + dataset.add("Futures (London)", new Date(2011, JUL).getTime(), 103.36); + dataset.add("Futures (London)", new Date(2011, AUG).getTime(), 102.71); + dataset.add("Futures (London)", new Date(2011, SEP).getTime(), 96.10); + dataset.add("Futures (London)", new Date(2011, OCT).getTime(), 88.64); + dataset.add("Futures (London)", new Date(2011, NOV).getTime(), 85.78); + dataset.add("Futures (London)", new Date(2011, DEC).getTime(), 87.65); + dataset.add("Futures (London)", new Date(2012, JAN).getTime(), 84.19); + dataset.add("Futures (London)", new Date(2012, FEB).getTime(), 88.69); + dataset.add("Futures (London)", new Date(2012, MAR).getTime(), 91.37); + dataset.add("Futures (London)", new Date(2012, APR).getTime(), 91.81); + dataset.add("Futures (London)", new Date(2012, MAY).getTime(), 96.82); + dataset.add("Futures (London)", new Date(2012, JUN).getTime(), 94.75); + dataset.add("Futures (London)", new Date(2012, JUL).getTime(), 96.14); + dataset.add("Futures (London)", new Date(2012, AUG).getTime(), 96.12); + dataset.add("Futures (London)", new Date(2012, SEP).getTime(), 94.65); + dataset.add("Futures (London)", new Date(2012, OCT).getTime(), 94.66); + dataset.add("Futures (London)", new Date(2012, NOV).getTime(), 87.32); + dataset.add("Futures (London)", new Date(2012, DEC).getTime(), 85.94); + dataset.add("Futures (London)", new Date(2013, JAN).getTime(), 88.85); + dataset.add("Futures (London)", new Date(2013, FEB).getTime(), 94.41); + dataset.add("Futures (London)", new Date(2013, MAR).getTime(), 97.22); + + dataset.add("Futures (New York)", new Date(2010, JAN).getTime(), 142.76); + dataset.add("Futures (New York)", new Date(2010, FEB).getTime(), 134.35); + dataset.add("Futures (New York)", new Date(2010, MAR).getTime(), 134.97); + dataset.add("Futures (New York)", new Date(2010, APR).getTime(), 135.12); + dataset.add("Futures (New York)", new Date(2010, MAY).getTime(), 135.81); + dataset.add("Futures (New York)", new Date(2010, JUN).getTime(), 152.36); + dataset.add("Futures (New York)", new Date(2010, JUL).getTime(), 165.23); + dataset.add("Futures (New York)", new Date(2010, AUG).getTime(), 175.10); + dataset.add("Futures (New York)", new Date(2010, SEP).getTime(), 187.80); + dataset.add("Futures (New York)", new Date(2010, OCT).getTime(), 190.43); + dataset.add("Futures (New York)", new Date(2010, NOV).getTime(), 206.92); + dataset.add("Futures (New York)", new Date(2010, DEC).getTime(), 221.51); + dataset.add("Futures (New York)", new Date(2011, JAN).getTime(), 238.05); + dataset.add("Futures (New York)", new Date(2011, FEB).getTime(), 261.41); + dataset.add("Futures (New York)", new Date(2011, MAR).getTime(), 274.10); + dataset.add("Futures (New York)", new Date(2011, APR).getTime(), 285.58); + dataset.add("Futures (New York)", new Date(2011, MAY).getTime(), 277.72); + dataset.add("Futures (New York)", new Date(2011, JUN).getTime(), 262.52); + dataset.add("Futures (New York)", new Date(2011, JUL).getTime(), 255.90); + dataset.add("Futures (New York)", new Date(2011, AUG).getTime(), 260.39); + dataset.add("Futures (New York)", new Date(2011, SEP).getTime(), 261.39); + dataset.add("Futures (New York)", new Date(2011, OCT).getTime(), 236.74); + dataset.add("Futures (New York)", new Date(2011, NOV).getTime(), 235.25); + dataset.add("Futures (New York)", new Date(2011, DEC).getTime(), 227.23); + dataset.add("Futures (New York)", new Date(2012, JAN).getTime(), 227.50); + dataset.add("Futures (New York)", new Date(2012, FEB).getTime(), 212.09); + dataset.add("Futures (New York)", new Date(2012, MAR).getTime(), 188.78); + dataset.add("Futures (New York)", new Date(2012, APR).getTime(), 181.75); + dataset.add("Futures (New York)", new Date(2012, MAY).getTime(), 176.50); + dataset.add("Futures (New York)", new Date(2012, JUN).getTime(), 159.93); + dataset.add("Futures (New York)", new Date(2012, JUL).getTime(), 183.20); + dataset.add("Futures (New York)", new Date(2012, AUG).getTime(), 169.77); + dataset.add("Futures (New York)", new Date(2012, SEP).getTime(), 175.36); + dataset.add("Futures (New York)", new Date(2012, OCT).getTime(), 170.43); + dataset.add("Futures (New York)", new Date(2012, NOV).getTime(), 155.72); + dataset.add("Futures (New York)", new Date(2012, DEC).getTime(), 149.58); + dataset.add("Futures (New York)", new Date(2013, JAN).getTime(), 154.28); + dataset.add("Futures (New York)", new Date(2013, FEB).getTime(), 144.89); + dataset.add("Futures (New York)", new Date(2013, MAR).getTime(), 141.43); + + var plot = new jsfc.XYPlot(dataset); + var xAxis = plot.getXAxis(); + var yAxis = plot.getYAxis(); + //plot.xAxis.label = "x-axis"; + xAxis.labelFont = new jsfc.Font("sans-serif", 12, true); + xAxis.tickLabelFont = new jsfc.Font("sans-serif", 10); + xAxis.setTickLabelFormatOverride(new jsfc.DateFormat("mmm-yyyy")); + yAxis.setLabel("US cents/lb"); + yAxis.labelFont = new jsfc.Font("sans-serif", 12, true); + yAxis.tickLabelFont = new jsfc.Font("sans-serif", 10); + + var renderer = new jsfc.XYLineRenderer(plot); + var colors = [new jsfc.Color(255, 0, 0)]; + colors.push(new jsfc.Color(24, 123, 58)); + colors.push(new jsfc.Color(149, 201, 136)); + colors.push(new jsfc.Color(1, 62, 29)); + colors.push(new jsfc.Color(81, 176, 86)); + colors.push(new jsfc.Color(0, 55, 122)); + colors.push(new jsfc.Color(0, 92, 165)); + renderer.setLineColorSource(new jsfc.ColorSource(colors)); + plot.setRenderer(renderer); + plot.setAxisOffsets(new jsfc.Insets(4, 4, 4, 4)); + var chart = new jsfc.Chart(plot); + var titleAnchor = new jsfc.Anchor2D(jsfc.RefPt2D.TOP_LEFT); + chart.setTitleAnchor(titleAnchor); + chart.setTitle("International Coffee Organisation: Coffee Prices", + "Source: http://www.ico.org/historical/2010-19/PDF/HIST-PRICES.pdf", + titleAnchor); + //var canvas = document.getElementById("chart_canvas"); + chart.setSize(600, 400); + var svg = document.getElementById("chart_svg"); + chartManager = new jsfc.ChartManager(svg, chart); + chartManager.refreshDisplay(); + //var ctx = canvas.getContext('2d'); + var win = document.defaultView || document.parentWindow; + win.onresize = resize; + + }; + function resize(evt) { + var element = document.getElementById("scatter_chart_1"); + var w = Math.max(300, element.clientWidth); + var h = Math.max(200, element.clientHeight); + chartManager.getChart().setSize(w, h); + chartManager.refreshDisplay(); + } + + + </script> + <div class="header row"> + <h4>Resizing Chart Demo:</h4> + <p>In this demo we have a chart that resizes according to the resizing + of its container.</p> + </div> + <div class="body row scroll-x scroll-y"> + <div id="scatter_chart_1" class="chart_container"> + <svg id="chart_svg" width="100%" height="100%"></svg> + </div> + </div> + <div class="footer row"> + <p id="debug">This is a footer, part of the HTML not the chart.</p> + </div> + </body> +</html> Added: branches/jfreechart-1.0.x-branch/jsfreechart/README.txt =================================================================== --- branches/jfreechart-1.0.x-branch/jsfreechart/README.txt (rev 0) +++ branches/jfreechart-1.0.x-branch/jsfreechart/README.txt 2014-07-31 09:56:07 UTC (rev 3277) @@ -0,0 +1,25 @@ +JSFreeChart +----------- + +This folder contains a preview of JSFreeChart, a free 2D chart library written +in JavaScript. To see how it works, simply open one of the HTML files in a +browser. JSFreeChart features: + + - multiple chart types supported out-of-the-box: bar charts (regular and + stacked), scatter plots, line charts and histograms; + - clean separation between data sources and the presentation layer with + dataset interfaces (with standard implementations provided); + - interactivity with built-in panning, zooming and selection; + - a flexible architecture; + - complete source code freely available; + +For the latest information about JSFreeChart, please refer to the home page at: + + http://www.jfree.org/jsfreechart + +JSFreeChart has been developed by Object Refinery Ltd +(http://www.object-refinery.com) in collaboration with KNIME.com AG +(https://www.knime.org/). + +David Gilbert +Object Refinery Limited Added: branches/jfreechart-1.0.x-branch/jsfreechart/ScatterChartDemo.html =================================================================== --- branches/jfreechart-1.0.x-branch/jsfreechart/ScatterChartDemo.html (rev 0) +++ branches/jfreechart-1.0.x-branch/jsfreechart/ScatterChartDemo.html 2014-07-31 09:56:07 UTC (rev 3277) @@ -0,0 +1,87 @@ +<!DOCTYPE html> +<html> + <head> + <title>Scatter Plot drawn to a 2D context</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <script src="lib/jsfreechart.js"></script> + </head> + <body onload="installChart();"> + <script type="application/javascript"> + function updateShow() { + var checkBox = document.getElementById("showcb"); + if (checkBox.checked) { + var snapCheckBox = document.getElementById("snapcb"); + document.crosshairHandler = new jsfc.XYCrosshairHandler(document.chartManager); + document.crosshairHandler.setSnapToItem(snapCheckBox.checked); + document.chartManager.addAuxiliaryHandler(document.crosshairHandler); + } else { + document.chartManager.removeAuxiliaryHandler(document.crosshairHandler); + document.crosshairHandler = null; + } + } + function updateSnap() { + var checkBox = document.getElementById("snapcb"); + if (document.crosshairHandler) { + document.crosshairHandler.setSnapToItem(checkBox.checked); + } + } + function installChart() { + var dataset = new jsfc.StandardXYDataset(); + var factor = 1; + for (var i = 0; i < 20; i++) { + dataset.add("Series 1", Math.random() * factor, Math.random() * factor); + dataset.add("Series 2", Math.random() * factor, Math.random() *factor); + dataset.add("Series 3", Math.random() * factor, Math.random() *factor); + dataset.add("Series 4", Math.random() * factor, Math.random() *factor); + dataset.add("Series 5", Math.random() * factor, Math.random() *factor); + dataset.add("Series 6", Math.random() * factor, Math.random() *factor); + dataset.add("Series 7", Math.random() * factor, Math.random() *factor); + dataset.add("Series 8", Math.random() * factor, Math.random() *factor); + dataset.add("Series 9", Math.random() * factor, Math.random() *factor); + dataset.add("Series 10", Math.random() * factor, Math.random() *factor); + } + var itemKey = dataset.getItemKey(0, 1); + dataset.setItemProperty("Series 1", itemKey, "color", "#FF0000"); + + var plot = new jsfc.XYPlot(dataset); + plot.setAxisOffsets(new jsfc.Insets(4, 4, 4, 4)); + var xAxis = plot.getXAxis(); + var yAxis = plot.getYAxis(); + xAxis.setLabel("x-axis"); + xAxis.labelFont = new jsfc.Font("sans-serif", 12, true); + xAxis.tickLabelFont = new jsfc.Font("sans-serif", 10); + yAxis.setLabel("y-axis"); + yAxis.labelFont = new jsfc.Font("sans-serif", 12, true); + yAxis.tickLabelFont = new jsfc.Font("sans-serif", 10); + + plot.renderer = new jsfc.ScatterRenderer(plot); + var chart = new jsfc.Chart(plot); + var titleAnchor = new jsfc.Anchor2D(jsfc.RefPt2D.TOP_LEFT); + chart.setTitleAnchor(titleAnchor); + chart.setTitle("Scatter Chart in SVG", "http://www.jfree.org/", + titleAnchor); + chart.setSize(600, 400); + var svg = document.getElementById("chart_svg"); + var manager = new jsfc.ChartManager(svg, chart); + document.chartManager = manager; + + // add a mouse handler to draw crosshairs + //var crosshairHandler = new jsfc.CrosshairHandler(manager); + //document.chartManager.addAuxiliaryHandler(crosshairHandler); + var modifiers = new jsfc.Modifier(false, false, true, false); + var selectHandler = new jsfc.PolygonSelectionHandler(manager, modifiers); + manager.addLiveHandler(selectHandler); + document.chartManager.refreshDisplay(); + }; + + </script> + <h4>Scatter Chart with Crosshairs:</h4> + <p>In this demo we have a scatter chart with crosshairs. Click and drag the mouse pointer to select a region to zoom. Hold the ALT-key and drag the mouse pointer to pan. Hold the META key and drag the mouse pointer to define a selection region.</p> + <input id="showcb" type="checkbox" onchange="updateShow()" />Show crosshairs? + <input id="snapcb" type="checkbox" onchange="updateSnap()" />Snap to data points? + <div id="scatter_chart_1" class="chart_container"> + <svg id="chart_svg" width="600px" height="400px"></svg> + </div> + </body> +</html> Added: branches/jfreechart-1.0.x-branch/jsfreechart/lib/gpl-3.0.txt =================================================================== --- branches/jfreechart-1.0.x-branch/jsfreechart/lib/gpl-3.0.txt (rev 0) +++ branches/jfreechart-1.0.x-branch/jsfreechart/lib/gpl-3.0.txt 2014-07-31 09:56:07 UTC (rev 3277) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not s... [truncated message content] |
From: <mu...@us...> - 2014-07-31 08:38:33
|
Revision: 3276 http://sourceforge.net/p/jfreechart/code/3276 Author: mungady Date: 2014-07-31 08:38:25 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Updates for 1.0.19 release Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog branches/jfreechart-1.0.x-branch/NEWS branches/jfreechart-1.0.x-branch/README.txt Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2014-07-31 08:30:10 UTC (rev 3275) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2014-07-31 08:38:25 UTC (rev 3276) @@ -1,3 +1,28 @@ +2014-07-29 David Gilbert <dav...@ob...> + + * org/jfree/chart/axis/Axis.java + (drawAxisLine): Add rendering hint, + * org/jfree/chart/axis/CategoryAxis.java + (drawTickMarks): Add rendering hint, + * org/jfree/chart/axis/ValueAxis.java + (drawAxisLine): Add rendering hint, + (drawTickMarksAndLabels): Likewise, + * org/jfree/chart/block/LineBorder.java + (draw): Add rendering hint, + * org/jfree/chart/plot/FastScatterPlot.java + (drawDomainGridlines): Add rendering hint, + (drawRangeGridlines): Likewise, + * org/jfree/chart/plot/Plot.java + (drawOutline): Add rendering hint, + * org/jfree/chart/plot/XYPlot.java + (drawDomainCrosshair): Add rendering hint, + (drawRangeCrosshair): Likewise, + * org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java + (drawRangeLine): Add rendering hint, + * org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java + (drawDomainLine): Add rendering hint, + (drawRangeLine): Likewise. + 2014-07-21 David Gilbert <dav...@ob...> * org/jfree/chart/fx/FXGraphics2D.java Modified: branches/jfreechart-1.0.x-branch/NEWS =================================================================== --- branches/jfreechart-1.0.x-branch/NEWS 2014-07-31 08:30:10 UTC (rev 3275) +++ branches/jfreechart-1.0.x-branch/NEWS 2014-07-31 08:38:25 UTC (rev 3276) @@ -1,3 +1,21 @@ +JFreeChart 1.0.19 +----------------- +31 July 2014 + +This maintenance release corrects some issues in the new JavaFX support that +was added in the 1.0.18 release, as well as some general issues. + +Bug Fixes: + +- fixed clipping issues for combined plots in JavaFX; +- fix a memory leak in the new JavaFX ChartCanvas class; +- CombinedDomainXYPlot and CombinedRangeXYPlot now take into account the + pannable flags in the subplots; +- FastScatterPlot panning direction is corrected; +- added rendering hints to sharpen gridlines and borders in most output formats; +- JFreeSVG updated to version 2.0. + + JFreeChart 1.0.18 ----------------- 3 July 2014 Modified: branches/jfreechart-1.0.x-branch/README.txt =================================================================== --- branches/jfreechart-1.0.x-branch/README.txt 2014-07-31 08:30:10 UTC (rev 3275) +++ branches/jfreechart-1.0.x-branch/README.txt 2014-07-31 08:38:25 UTC (rev 3276) @@ -1,8 +1,8 @@ ******************************** -* JFREECHART: Version 1.0.18 * +* JFREECHART: Version 1.0.19 * ******************************** -3 July 2014 +31 July 2014 (C)opyright 2000-2014, by Object Refinery Limited and Contributors. @@ -11,7 +11,8 @@ ----------------- JFreeChart is a free chart library for the Java(tm) platform. It runs on the Java 2 Platform (JRE 1.6.0 or later) and uses the Java 2D API for -drawing. +drawing. There is also JavaFX support available, but requiring JDK 1.8.0 or +later. JFreeChart is licensed under the terms of the GNU Lesser General Public Licence (LGPL). A copy of the licence is included in the @@ -38,8 +39,8 @@ 3. DOCUMENTATION ----------------- You can download installation instructions -(jfreechart-1.0.18-install.pdf) from the JFreeChart home -page or the project page on SourceForge. +(jfreechart-1.0.19-install.pdf) from the JFreeChart home page or the project +page on SourceForge. Further documentation for JFreeChart (the JFreeChart Developer Guide) is available to purchase from by Object Refinery Limited, a company owned and @@ -65,9 +66,9 @@ JavaFX support (and you will need to rebuild the library using the ant/build-fx.xml script). -(b) JCommon - version 1.0.0 or later. The runtime jar file (version 1.0.22) -is included in the JFreeChart distribution. You can obtain the complete -source code for JCommon from: +(b) JCommon - the runtime jar file (version 1.0.23) is included in the +JFreeChart distribution. You can obtain the complete source code for JCommon +from: http://www.jfree.org/jcommon/ @@ -115,30 +116,53 @@ use this script as it includes certain files (for example, .properties files) that you MUST have in the jar file for JFreeChart to function correctly. +----------------- +7. MAVEN POM.XML +----------------- +A Maven pom.xml is included in the distribution, and you can use this to +build JFreeChart *without* JavaFX support. If you want to include the JavaFX +support classes, you'll need to modify the pom.xml file accordingly. + +Both JFreeChart and JCommon are available on the Central Repository: + +<dependency> + <groupId>org.jfree</groupId> + <artifactId>jfreechart</artifactId> + <version>1.0.19</version> +</dependency> + +<dependency> + <groupId>org.jfree</groupId> + <artifactId>jcommon</artifactId> + <version>1.0.23</version> +</dependency> + ------------------------ -7. THE DEMO APPLICATION +8. THE DEMO APPLICATION ------------------------ A demo application that shows a selection of the charts that can be generated is included in the JFreeChart distribution. To run the demo (using JDK 1.6.0 or later), use the following command: - java -jar jfreechart-1.0.18-demo.jar + java -jar jfreechart-1.0.19-demo.jar The complete source code for the demo application is available for download when you purchase the JFreeChart Developer Guide. The demo application also links to the JFreeSVG and OrsonPDF libraries, to provide export facilities to the SVG and PDF formats. These fast, lightweight -libraries are not free, licenses can be purchased from Object Refinery Limited. +libraries are independent from JFreeChart. JFreeSVG is dual licensed under +the GNU GPLv3 and a commercial license, while OrsonPDF is commercially licensed. +Licenses can be purchased from Object Refinery Limited. -An additional tab added to the demo application in version 1.0.18 showcases -Orson Charts, a new 3D chart library by Object Refinery Limited. You can find -out more about Orson Charts at: +An additional tab added to the demo application showcases Orson Charts, a +3D chart library by Object Refinery Limited. You can find out more about +Orson Charts at: http://www.object-refinery.com/orsoncharts/ --------------- -8. LIMITATIONS +9. LIMITATIONS --------------- JFreeChart has some known limitations that will hopefully be addressed in the future: @@ -156,10 +180,20 @@ please post a bug report. -------------- -9. WHAT's NEW +10. WHAT's NEW -------------- A list of changes in recent versions: +1.0.19 : (31-Jul-2014) + - fixed clipping issues for combined plots in JavaFX; + - fix a memory leak in the new JavaFX ChartCanvas class; + - CombinedDomainXYPlot and CombinedRangeXYPlot now take into account the + pannable flags in the subplots; + - FastScatterPlot panning direction is corrected; + - added rendering hints to sharpen gridlines and borders in most output + formats; + - JFreeSVG updated to version 2.0. + 1.0.18 : (3-Jul-2014) - added JavaFX support via FXGraphics2D; - improved LogAxis labelling; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 08:30:15
|
Revision: 3275 http://sourceforge.net/p/jfreechart/code/3275 Author: mungady Date: 2014-07-31 08:30:10 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Update JCommon to latest. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/pom.xml Modified: branches/jfreechart-1.0.x-branch/pom.xml =================================================================== --- branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 08:12:06 UTC (rev 3274) +++ branches/jfreechart-1.0.x-branch/pom.xml 2014-07-31 08:30:10 UTC (rev 3275) @@ -74,7 +74,7 @@ <dependency> <groupId>org.jfree</groupId> <artifactId>jcommon</artifactId> - <version>1.0.21</version> + <version>1.0.23</version> </dependency> <dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-31 08:12:09
|
Revision: 3274 http://sourceforge.net/p/jfreechart/code/3274 Author: mungady Date: 2014-07-31 08:12:06 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Add rendering hint. 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-07-29 09:50:28 UTC (rev 3273) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2014-07-31 08:12:06 UTC (rev 3274) @@ -988,8 +988,11 @@ Stroke stroke = plot.getDomainGridlineStroke(); g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT); g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(line); - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2014-07-29 09:50:38
|
Revision: 3273 http://sourceforge.net/p/jfreechart/code/3273 Author: mungady Date: 2014-07-29 09:50:28 +0000 (Tue, 29 Jul 2014) Log Message: ----------- 2014-07-29 David Gilbert <dav...@ob...> * org/jfree/chart/axis/Axis.java (drawAxisLine): Add rendering hint, * org/jfree/chart/axis/CategoryAxis.java (drawTickMarks): Add rendering hint, * org/jfree/chart/axis/ValueAxis.java (drawAxisLine): Add rendering hint, (drawTickMarksAndLabels): Likewise, * org/jfree/chart/block/LineBorder.java (draw): Add rendering hint, * org/jfree/chart/plot/FastScatterPlot.java (drawDomainGridlines): Add rendering hint, (drawRangeGridlines): Likewise, * org/jfree/chart/plot/Plot.java (drawOutline): Add rendering hint, * org/jfree/chart/plot/XYPlot.java (drawDomainCrosshair): Add rendering hint, (drawRangeCrosshair): Likewise, * org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (drawRangeLine): Add rendering hint, * org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java (drawDomainLine): Add rendering hint, (drawRangeLine): Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CategoryAxis.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/ValueAxis.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/block/LineBorder.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/FastScatterPlot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/XYPlot.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 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/axis/Axis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -85,6 +85,8 @@ * 02-Jul-2013 : Use ParamChecks (DG); * 01-Aug-2013 : Added attributedLabel override to support superscripts, * subscripts and more (DG); + * 29-Jul-2014 : Add hint to normalise stroke for axis line (DG); + * */ package org.jfree.chart.axis; @@ -95,6 +97,7 @@ import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.font.TextLayout; @@ -1528,28 +1531,25 @@ */ protected void drawAxisLine(Graphics2D g2, double cursor, Rectangle2D dataArea, RectangleEdge edge) { - Line2D axisLine = null; + double x = dataArea.getX(); + double y = dataArea.getY(); if (edge == RectangleEdge.TOP) { - axisLine = new Line2D.Double(dataArea.getX(), cursor, - dataArea.getMaxX(), cursor); + axisLine = new Line2D.Double(x, cursor, dataArea.getMaxX(), cursor); + } else if (edge == RectangleEdge.BOTTOM) { + axisLine = new Line2D.Double(x, cursor, dataArea.getMaxX(), cursor); + } else if (edge == RectangleEdge.LEFT) { + axisLine = new Line2D.Double(cursor, y, cursor, dataArea.getMaxY()); + } else if (edge == RectangleEdge.RIGHT) { + axisLine = new Line2D.Double(cursor, y, cursor, dataArea.getMaxY()); } - else if (edge == RectangleEdge.BOTTOM) { - axisLine = new Line2D.Double(dataArea.getX(), cursor, - dataArea.getMaxX(), cursor); - } - else if (edge == RectangleEdge.LEFT) { - axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, - dataArea.getMaxY()); - } - else if (edge == RectangleEdge.RIGHT) { - axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, - dataArea.getMaxY()); - } g2.setPaint(this.axisLinePaint); g2.setStroke(this.axisLineStroke); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(axisLine); - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CategoryAxis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CategoryAxis.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/CategoryAxis.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -97,6 +97,8 @@ * 25-Jul-2013 : Added support for URLs on category labels (DG); * 01-Aug-2013 : Added attributedLabel override to support superscripts, * subscripts and more (DG); + * 29-Jul-2014 : Add hint to normalise stroke for tick marks (DG); + * */ package org.jfree.chart.axis; @@ -104,6 +106,7 @@ import java.awt.Font; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.geom.Line2D; import java.awt.geom.Point2D; @@ -1187,7 +1190,7 @@ * Draws the tick marks. * * @param g2 the graphics target. - * @param cursor the cursor position (an offset when drawing multiple axes) + * @param cursor the cursor position (an offset when drawing multiple axes) * @param dataArea the area for plotting the data. * @param edge the location of the axis. * @param state the axis state. @@ -1208,6 +1211,9 @@ List categories = plot.getCategoriesForAxis(this); g2.setPaint(getTickMarkPaint()); g2.setStroke(getTickMarkStroke()); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); if (edge.equals(RectangleEdge.TOP)) { Iterator iterator = categories.iterator(); while (iterator.hasNext()) { @@ -1219,8 +1225,7 @@ g2.draw(line); } state.cursorUp(ol); - } - else if (edge.equals(RectangleEdge.BOTTOM)) { + } else if (edge.equals(RectangleEdge.BOTTOM)) { Iterator iterator = categories.iterator(); while (iterator.hasNext()) { Comparable key = (Comparable) iterator.next(); @@ -1231,8 +1236,7 @@ g2.draw(line); } state.cursorDown(ol); - } - else if (edge.equals(RectangleEdge.LEFT)) { + } else if (edge.equals(RectangleEdge.LEFT)) { Iterator iterator = categories.iterator(); while (iterator.hasNext()) { Comparable key = (Comparable) iterator.next(); @@ -1243,8 +1247,7 @@ g2.draw(line); } state.cursorLeft(ol); - } - else if (edge.equals(RectangleEdge.RIGHT)) { + } else if (edge.equals(RectangleEdge.RIGHT)) { Iterator iterator = categories.iterator(); while (iterator.hasNext()) { Comparable key = (Comparable) iterator.next(); @@ -1256,6 +1259,7 @@ } state.cursorRight(ol); } + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/ValueAxis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/ValueAxis.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/ValueAxis.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -108,6 +108,7 @@ * 03-Sep-2012 : Fix reserveSpace() method, bug 3555275 (DG); * 02-Jul-2013 : Use ParamChecks (DG); * 18-Mar-2014 : Updates to support attributed tick labels for LogAxis (DG); + * 29-Jul-2014 : Add hints to normalise axis line and tick marks (DG); * */ @@ -117,6 +118,7 @@ import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Polygon; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.LineMetrics; import java.awt.geom.AffineTransform; @@ -536,7 +538,7 @@ /** * Draws an axis line at the current cursor position and edge. * - * @param g2 the graphics device. + * @param g2 the graphics device ({@code null} not permitted). * @param cursor the cursor position. * @param dataArea the data area. * @param edge the edge. @@ -545,25 +547,27 @@ protected void drawAxisLine(Graphics2D g2, double cursor, Rectangle2D dataArea, RectangleEdge edge) { Line2D axisLine = null; + double c = cursor; if (edge == RectangleEdge.TOP) { - axisLine = new Line2D.Double(dataArea.getX(), cursor, - dataArea.getMaxX(), cursor); - } - else if (edge == RectangleEdge.BOTTOM) { - axisLine = new Line2D.Double(dataArea.getX(), cursor, - dataArea.getMaxX(), cursor); - } - else if (edge == RectangleEdge.LEFT) { - axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, + axisLine = new Line2D.Double(dataArea.getX(), c, dataArea.getMaxX(), + c); + } else if (edge == RectangleEdge.BOTTOM) { + axisLine = new Line2D.Double(dataArea.getX(), c, dataArea.getMaxX(), + c); + } else if (edge == RectangleEdge.LEFT) { + axisLine = new Line2D.Double(c, dataArea.getY(), c, dataArea.getMaxY()); - } - else if (edge == RectangleEdge.RIGHT) { - axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, + } else if (edge == RectangleEdge.RIGHT) { + axisLine = new Line2D.Double(c, dataArea.getY(), c, dataArea.getMaxY()); } g2.setPaint(getAxisLinePaint()); g2.setStroke(getAxisLineStroke()); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(axisLine); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); boolean drawUpOrRight = false; boolean drawDownOrLeft = false; @@ -578,8 +582,7 @@ if (this.negativeArrowVisible) { if (this.inverted) { drawUpOrRight = true; - } - else { + } else { drawDownOrLeft = true; } } @@ -591,8 +594,7 @@ x = dataArea.getMaxX(); y = cursor; arrow = this.rightArrow; - } - else if (edge == RectangleEdge.LEFT + } else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) { x = cursor; y = dataArea.getMinY(); @@ -615,8 +617,7 @@ x = dataArea.getMinX(); y = cursor; arrow = this.leftArrow; - } - else if (edge == RectangleEdge.LEFT + } else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) { x = cursor; y = dataArea.getMaxY(); @@ -690,6 +691,9 @@ List ticks = refreshTicks(g2, state, dataArea, edge); state.setTicks(ticks); g2.setFont(getTickLabelFont()); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); @@ -749,7 +753,8 @@ g2.draw(mark); } } - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); + // need to work out the space used by the tick labels... // so we can update the cursor... double used = 0.0; @@ -758,18 +763,15 @@ used += findMaximumTickLabelWidth(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorLeft(used); - } - else if (edge == RectangleEdge.RIGHT) { + } else if (edge == RectangleEdge.RIGHT) { used = findMaximumTickLabelWidth(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorRight(used); - } - else if (edge == RectangleEdge.TOP) { + } else if (edge == RectangleEdge.TOP) { used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorUp(used); - } - else if (edge == RectangleEdge.BOTTOM) { + } else if (edge == RectangleEdge.BOTTOM) { used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorDown(used); Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/block/LineBorder.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/block/LineBorder.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/block/LineBorder.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -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 @@ * --------------- * LineBorder.java * --------------- - * (C) Copyright 2007-2013, by Christo Zietsman and Contributors. + * (C) Copyright 2007-2014, by Christo Zietsman and Contributors. * * Original Author: Christo Zietsman; * Contributor(s): David Gilbert (for Object Refinery Limited); @@ -38,6 +38,7 @@ * modifications by DG (DG); * 13-Jun-2007 : Don't draw if area doesn't have positive dimensions (DG); * 02-Jul-2013 : Use ParamChecks (DG); + * 29-Jul-2014 : Add rendering hint to normalise stroke for border (DG); * */ @@ -47,6 +48,7 @@ import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; @@ -91,9 +93,9 @@ /** * Creates a new border with the specified color. * - * @param paint the color (<code>null</code> not permitted). - * @param stroke the border stroke (<code>null</code> not permitted). - * @param insets the insets (<code>null</code> not permitted). + * @param paint the color ({@code null} not permitted). + * @param stroke the border stroke ({@code null} not permitted). + * @param insets the insets ({@code null} not permitted). */ public LineBorder(Paint paint, Stroke stroke, RectangleInsets insets) { ParamChecks.nullNotPermitted(paint, "paint"); @@ -107,7 +109,7 @@ /** * Returns the paint. * - * @return The paint (never <code>null</code>). + * @return The paint (never {@code null}). */ public Paint getPaint() { return this.paint; @@ -116,7 +118,7 @@ /** * Returns the insets. * - * @return The insets (never <code>null</code>). + * @return The insets (never {@code null}). */ @Override public RectangleInsets getInsets() { @@ -126,7 +128,7 @@ /** * Returns the stroke. * - * @return The stroke (never <code>null</code>). + * @return The stroke (never {@code null}). */ public Stroke getStroke() { return this.stroke; @@ -158,6 +160,9 @@ double y1 = y + t / 2.0; g2.setPaint(getPaint()); g2.setStroke(getStroke()); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); Line2D line = new Line2D.Double(); if (t > 0.0) { line.setLine(x0, y1, x1, y1); @@ -175,12 +180,13 @@ line.setLine(x1, y0, x1, y1); g2.draw(line); } + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** * Tests this border for equality with an arbitrary instance. * - * @param obj the object (<code>null</code> permitted). + * @param obj the object ({@code null} permitted). * * @return A boolean. */ Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/FastScatterPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/FastScatterPlot.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/FastScatterPlot.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -62,6 +62,7 @@ * 26-Mar-2009 : Implemented Pannable, and fixed bug in zooming (DG); * 02-Jul-2013 : Use ParamChecks (DG); * 21-Jul-2014 : Fix panning (patch #307 by Ulrich Voigt) (DG); + * 29-Jul-2014 : Add rendering hint to normalise stroke for gridlines (DG); * */ @@ -73,6 +74,7 @@ import java.awt.Composite; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Line2D; @@ -580,10 +582,6 @@ */ public void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState) { - - - //long start = System.currentTimeMillis(); - //System.out.println("Start: " + start); g2.setPaint(this.paint); // if the axes use a linear scale, you can uncomment the code below and @@ -613,10 +611,6 @@ g2.fillRect(transX, transY, 1, 1); } } - //long finish = System.currentTimeMillis(); - //System.out.println("Finish: " + finish); - //System.out.println("Time: " + (finish - start)); - } /** @@ -627,22 +621,25 @@ * @param ticks the ticks. */ protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, - List ticks) { - - // draw the domain grid lines, if the flag says they're visible... - if (isDomainGridlinesVisible()) { - Iterator iterator = ticks.iterator(); - while (iterator.hasNext()) { - ValueTick tick = (ValueTick) iterator.next(); - double v = this.domainAxis.valueToJava2D(tick.getValue(), - dataArea, RectangleEdge.BOTTOM); - Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, - dataArea.getMaxY()); - g2.setPaint(getDomainGridlinePaint()); - g2.setStroke(getDomainGridlineStroke()); - g2.draw(line); - } + List ticks) { + if (!isDomainGridlinesVisible()) { + return; } + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); + Iterator iterator = ticks.iterator(); + while (iterator.hasNext()) { + ValueTick tick = (ValueTick) iterator.next(); + double v = this.domainAxis.valueToJava2D(tick.getValue(), + dataArea, RectangleEdge.BOTTOM); + Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, + dataArea.getMaxY()); + g2.setPaint(getDomainGridlinePaint()); + g2.setStroke(getDomainGridlineStroke()); + g2.draw(line); + } + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** @@ -653,23 +650,27 @@ * @param ticks the ticks. */ protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, - List ticks) { + List ticks) { - // draw the range grid lines, if the flag says they're visible... - if (isRangeGridlinesVisible()) { - Iterator iterator = ticks.iterator(); - while (iterator.hasNext()) { - ValueTick tick = (ValueTick) iterator.next(); - double v = this.rangeAxis.valueToJava2D(tick.getValue(), - dataArea, RectangleEdge.LEFT); - Line2D line = new Line2D.Double(dataArea.getMinX(), v, - dataArea.getMaxX(), v); - g2.setPaint(getRangeGridlinePaint()); - g2.setStroke(getRangeGridlineStroke()); - g2.draw(line); - } + if (!isRangeGridlinesVisible()) { + return; } + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); + Iterator iterator = ticks.iterator(); + while (iterator.hasNext()) { + ValueTick tick = (ValueTick) iterator.next(); + double v = this.rangeAxis.valueToJava2D(tick.getValue(), + dataArea, RectangleEdge.LEFT); + Line2D line = new Line2D.Double(dataArea.getMinX(), v, + dataArea.getMaxX(), v); + g2.setPaint(getRangeGridlinePaint()); + g2.setStroke(getRangeGridlineStroke()); + g2.draw(line); + } + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/Plot.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -129,6 +129,7 @@ * PK) (DG); * 13-Jul-2009 : Plot background image should be clipped if necessary (DG); * 02-Jul-2013 : Use ParamChecks (DG); + * 29-Jul-2014 : Add hint to normalise stroke for plot border (DG); * */ @@ -143,6 +144,7 @@ import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; @@ -1122,7 +1124,10 @@ if ((this.outlineStroke != null) && (this.outlinePaint != null)) { g2.setStroke(this.outlineStroke); g2.setPaint(this.outlinePaint); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(area); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } } Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/XYPlot.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/XYPlot.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/XYPlot.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -229,7 +229,8 @@ * 18-Oct-2011 : Fix tooltip offset with shadow renderer (DG); * 12-Sep-2013 : Check for KEY_SUPPRESS_SHADOW_GENERATION rendering hint (DG); * 10-Mar-2014 : Updated Javadocs for issue #1123 (DG); - * + * 29-Jul-2014 : Add hints to normalise stroke for crosshairs (DG); + * */ package org.jfree.chart.plot; @@ -241,6 +242,7 @@ import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Rectangle; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Line2D; @@ -4164,25 +4166,28 @@ PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) { - if (axis.getRange().contains(value)) { - Line2D line; - if (orientation == PlotOrientation.VERTICAL) { - double xx = axis.valueToJava2D(value, dataArea, - RectangleEdge.BOTTOM); - line = new Line2D.Double(xx, dataArea.getMinY(), xx, - dataArea.getMaxY()); - } - else { - double yy = axis.valueToJava2D(value, dataArea, - RectangleEdge.LEFT); - line = new Line2D.Double(dataArea.getMinX(), yy, - dataArea.getMaxX(), yy); - } - g2.setStroke(stroke); - g2.setPaint(paint); - g2.draw(line); + if (!axis.getRange().contains(value)) { + return; } - + Line2D line; + if (orientation == PlotOrientation.VERTICAL) { + double xx = axis.valueToJava2D(value, dataArea, + RectangleEdge.BOTTOM); + line = new Line2D.Double(xx, dataArea.getMinY(), xx, + dataArea.getMaxY()); + } else { + double yy = axis.valueToJava2D(value, dataArea, + RectangleEdge.LEFT); + line = new Line2D.Double(dataArea.getMinX(), yy, + dataArea.getMaxX(), yy); + } + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); + g2.setStroke(stroke); + g2.setPaint(paint); + g2.draw(line); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** @@ -4230,25 +4235,27 @@ PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) { - if (axis.getRange().contains(value)) { - Line2D line; - if (orientation == PlotOrientation.HORIZONTAL) { - double xx = axis.valueToJava2D(value, dataArea, - RectangleEdge.BOTTOM); - line = new Line2D.Double(xx, dataArea.getMinY(), xx, - dataArea.getMaxY()); - } - else { - double yy = axis.valueToJava2D(value, dataArea, - RectangleEdge.LEFT); - line = new Line2D.Double(dataArea.getMinX(), yy, - dataArea.getMaxX(), yy); - } - g2.setStroke(stroke); - g2.setPaint(paint); - g2.draw(line); + if (!axis.getRange().contains(value)) { + return; } - + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); + Line2D line; + if (orientation == PlotOrientation.HORIZONTAL) { + double xx = axis.valueToJava2D(value, dataArea, + RectangleEdge.BOTTOM); + line = new Line2D.Double(xx, dataArea.getMinY(), xx, + dataArea.getMaxY()); + } else { + double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); + line = new Line2D.Double(dataArea.getMinX(), yy, + dataArea.getMaxX(), yy); + } + g2.setStroke(stroke); + g2.setPaint(paint); + g2.draw(line); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2014-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -105,18 +105,19 @@ * 09-Feb-2010 : Fixed bug 2947660 (DG); * 02-Jul-2013 : Use ParamChecks (DG); * 08-Apr-2014 : Remove use of ObjectList (DG); + * 29-Jul-2014 : Add rendering hints to normalise range lines (DG); * */ package org.jfree.chart.renderer.category; import java.awt.AlphaComposite; -import java.awt.Color; import java.awt.Composite; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; @@ -844,16 +845,18 @@ if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); - } - else if (orientation == PlotOrientation.VERTICAL) { + } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } g2.setPaint(paint); g2.setStroke(stroke); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(line); - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** 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-07-29 09:38:54 UTC (rev 3272) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2014-07-29 09:50:28 UTC (rev 3273) @@ -121,6 +121,7 @@ * 03-Jul-2013 : Use ParamChecks (DG); * 11-Jan-2014 : Fix error in fillDomainGridBand method (DG); * 07-Apr-2014 : Don't use ObjectList anymore (DG); + * 29-Jul-2014 : Add rendering hint to normalise domain and range lines (DG); * */ @@ -132,6 +133,7 @@ import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Paint; +import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; @@ -1014,21 +1016,23 @@ PlotOrientation orientation = plot.getOrientation(); Line2D line = null; - double v = axis.valueToJava2D(value, dataArea, + double v = axis.valueToJava2D(value, dataArea, plot.getDomainAxisEdge()); - if (orientation == PlotOrientation.HORIZONTAL) { + if (orientation.isHorizontal()) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); - } - else if (orientation == PlotOrientation.VERTICAL) { + } else if (orientation.isVertical()) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); } g2.setPaint(paint); g2.setStroke(stroke); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(line); - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** @@ -1054,20 +1058,22 @@ PlotOrientation orientation = plot.getOrientation(); Line2D line = null; - double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); + double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); - } - else if (orientation == PlotOrientation.VERTICAL) { + } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } g2.setPaint(paint); g2.setStroke(stroke); + Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_NORMALIZE); g2.draw(line); - + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |