Initial Commit
@@ -0,0 +1,855 @@
|
||||
JFreeChart 1.0.17
|
||||
-----------------
|
||||
24 November 2013
|
||||
|
||||
Enhanced XYSplineRenderer with new area fill (contributed by Klaus Rheinwald),
|
||||
added a notify flag to all datasets that extend AbstractDataset, extended
|
||||
TimeSeriesCollection to validate TimeSeries keys for uniqueness, added a new
|
||||
DirectionalGradientPaintTransformer (by Peter Kolb), updated OHLCSeries, added
|
||||
HMSNumberFormat, updated JCommon to version 1.0.21 (includes rotated text
|
||||
improvements) and fixed some minor bugs.
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
977 : Multithreading issue with DateAxis;
|
||||
1084 : BorderArrangement.add() possible ClassCastException;
|
||||
1099 : XYSeriesCollection.removeSeries(int) does not deregister listener;
|
||||
1109 : WaterfallBarRenderer uses wrong color for diff 0.
|
||||
|
||||
And now a word from our sponsors, Object Refinery Limited...
|
||||
|
||||
> ORSON CHARTS 3D
|
||||
> ---------------
|
||||
> We are pleased to announce the release of Orson Charts, a 3D chart library
|
||||
> for the Java(tm) platform. Orson Charts has a similar architecture to
|
||||
> JFreeChart and provides high-quality 3D chart rendering using just the Java2D
|
||||
> API. The built-in Swing-based viewer provides zooming and full 360 degree
|
||||
> rotation of charts in any direction. Export options include PNG, PDF and SVG.
|
||||
> You can download a free evaluation copy of Orson Charts from:
|
||||
>
|
||||
> http://www.object-refinery.com/orsoncharts
|
||||
>
|
||||
> We've also added a tab to the JFreeChart demo application so you can see
|
||||
> Orson Charts in action. Orson Charts is not free, but provides a superb
|
||||
> complement to the extensive 2D charting capabilities of JFreeChart.
|
||||
|
||||
|
||||
JFreeChart 1.0.16
|
||||
-----------------
|
||||
13 September 2013
|
||||
|
||||
*** THIS RELEASE REQUIRES JDK/JRE 1.6.0 OR LATER. ***
|
||||
|
||||
Provided subscript/superscript support for axis labels (via AttributedString),
|
||||
new axis label positioning options, simplified ChartFactory methods,
|
||||
added new methods to DatasetUtilities to interpolate y-values in XYDatasets,
|
||||
added URLs to labels on CategoryAxis, seamless integration with
|
||||
JFreeSVG (http://www.jfree.org/jfreesvg/) and OrsonPDF
|
||||
(http://www.object-refinery.com/pdf/), improved the consistency of the
|
||||
SWTGraphics2D implementation, and fixed various bugs. All the JUnit tests
|
||||
have been upgraded to JUnit 4.
|
||||
|
||||
Bug Fixes:
|
||||
1107 : Fixed TimeZone issue in PeriodAxis.
|
||||
|
||||
Also fixed a line drawing issue with the StackedXYAreaRenderer, and a memory
|
||||
leak in the SWT ChartComposite class.
|
||||
|
||||
IMPORTANT: Funding is vital to the continued success of the JFreeChart project.
|
||||
Please ask/persuade/beg your company to support us buy purchasing the
|
||||
JFreeChart Developer Guide and demo source code (site license options are
|
||||
available for big companies)...and also please take a look at JFreeSVG and
|
||||
OrsonPDF, useful products that we are charging money for!
|
||||
|
||||
|
||||
JFreeChart 1.0.15
|
||||
-----------------
|
||||
4-July-2013
|
||||
|
||||
Added support for non-visible series in XYBarRenderer, minor gridlines in
|
||||
PolarPlot, legend item ordering, chart editor enhancements, updates to
|
||||
StandardDialScale, localisation files for Japanese and refactored parameter
|
||||
checks.
|
||||
|
||||
This release also fixes a minor security flaw in the DisplayChart class,
|
||||
detected and reported by OSI Security:
|
||||
|
||||
http://www.osisecurity.com.au/advisories/jfreechart-path-disclosure
|
||||
|
||||
Patches:
|
||||
|
||||
3500621 : LegendTitle order attribute (by Simon Kaczor);
|
||||
3463807 : ChartComposite does not dispose popup (by Sebastiao Correia);
|
||||
3204823 : PaintAlpha for 3D effects (by Dave Law);
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
3561093 : Rendering anomaly for XYPlots;
|
||||
3555275 : ValueAxis.reserveSpace() problem for axes with fixed dimension;
|
||||
3521736 : DeviationRenderer optimisation (by Milan Ramaiya);
|
||||
3514487 : SWTGraphics2D get/setStroke() problem;
|
||||
3508799 : DefaultPolarItemRenderer does not populate seriesKey in LegendItem;
|
||||
3482106 : Missing text in SWTGraphics2D (by Kevin Xu);
|
||||
3484408 : Maven fixes (Martin Hoeller);
|
||||
3484403 : DateAxis endless loop (by Martin Hoeller);
|
||||
3446965 : TimeSeries calculates range incorrectly in addOrUpdate();
|
||||
3445507 : TimeSeriesCollection.findRangeBounds() regression;
|
||||
3425881 : XYDifferenceRenderer fix (by Patrick Schlott/Christoph Schroeder);
|
||||
2963199 : SWT print job (by Jonas Rüttimann);
|
||||
2879650 : Path disclosure vulnerability in DisplayChart servlet;
|
||||
|
||||
Also fixed a rendering issue for polar charts using an inverted axis.
|
||||
|
||||
|
||||
JFreeChart 1.0.14
|
||||
-----------------
|
||||
20 November 2011
|
||||
|
||||
This release contains support for multiple and logarithmic axes with PolarPlot,
|
||||
optional drop-shadows in plot rendering, fitting polynomial functions to a data
|
||||
series, some performance improvements in the TimeSeriesCollection class, mouse
|
||||
wheel rotation of pie charts, improved Maven support and numerous bug fixes.
|
||||
|
||||
Patches:
|
||||
|
||||
3435734 : Fix lines overlapping item labels (by Martin Hoeller);
|
||||
3421088 : Bugfix for misalignment in BoxAndWhiskerRenderer;
|
||||
2952086 : Enhancement for finding bounds in XYZDatasets;
|
||||
2954302 : CategoryPointerAnnotation line calculation;
|
||||
2902842 : HistogramDataset.addSeries() fires change change event (by
|
||||
Thomas A Caswell);
|
||||
2868608 : Whisker width attribute for BoxAndWhiskerRenderer (by Peter Becker);
|
||||
2868585 : Added useOutlinePaint flag for BoxAndWhiskerRenderer (by
|
||||
Peter Becker);
|
||||
2850344 : PolarPlot enhancements (by Martin Hoeller);
|
||||
2795746 : Support for polynomial regression;
|
||||
2791407 : Fixes for findRangeBounds() in various renderers.
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
3440237 : Shadows always visible;
|
||||
3432721 : PolarPlot doesn't work with logarithmic axis;
|
||||
3433405 : LineChart3D - Problem with Item Labels;
|
||||
3429707 : LogAxis endless loop;
|
||||
3428870 : Missing argument check in TextAnnotation;
|
||||
3418287 : RelativeDateFormatTest.java is locale dependent;
|
||||
3353913 : Localisation fixes for ChartPanel, CompassPlot and PiePlot3D;
|
||||
3237879 : RingPlot should respect getSectionOutlineVisible();
|
||||
3190615 : Added missing clear() method in CategoryTableXYDataset;
|
||||
3165708 : PolarChartPanel localisation fix;
|
||||
3072674 : Bad handling of NaN in DefaultStatisticalCategoryDataset;
|
||||
3035289 : StackedXYBarRenderer should respect series/item visible flags;
|
||||
3026341 : Check for null in getDomain/RangeBounds() for XYShapeRenderer;
|
||||
2947660 : AbstractCategoryRenderer fix null check in getLegendItems();
|
||||
2946521 : StandardDialScale check majorTickIncrement argument;
|
||||
2876406 : TimeTableXYDataset should support Comparable for series keys;
|
||||
2868557 : BoxAndWhiskerRenderer should fire change event in setMedianVisible();
|
||||
2849731 : For IntervalCategoryDataset and IntervalXYDataset, fix
|
||||
iterateRangeBounds() in DatasetUtilities;
|
||||
2840132 : AbstractXYItemRenderer drawAnnotations doesn't set renderer index;
|
||||
2810220 : Offset problem in StatisticalBarRenderer;
|
||||
2802014 : Dial value border too small;
|
||||
2781844 : XYPointerAnnotation arrow drawing;
|
||||
1937486 : AreaRenderer doesn't respect AreaRendererEndType.LEVEL;
|
||||
|
||||
Also fixed:
|
||||
- use of simple label offset in PiePlot;
|
||||
- cached minY and maxY in TimeSeries.createCopy();
|
||||
- scaling issues for charts copied to the clipboard;
|
||||
- use of timezone in TimeTableXYDataset constructor;
|
||||
- duplicate series names in XYSeriesCollection;
|
||||
- HistogramDataset fires a change event in addSeries();
|
||||
- check visibility of main chart title before drawing it;
|
||||
- fixed serialization of PowerFunction2D, NormalDistributionFunction2D,
|
||||
and LineFunction2D;
|
||||
- item label positioning for the AreaRenderer class when the plot has an
|
||||
horizontal orientation.
|
||||
|
||||
|
||||
JFreeChart 1.0.13
|
||||
-----------------
|
||||
20 April 2009
|
||||
|
||||
******************************************************************************
|
||||
* SPECIAL NOTICE: There will be a birds-of-a-feather session for JFreeChart *
|
||||
* at this year's JavaOne conference in San Francisco. The session is *
|
||||
* scheduled for 6.45pm to 7.35pm on Wednesday 3 June. *
|
||||
******************************************************************************
|
||||
|
||||
This release contains:
|
||||
|
||||
- updates to the ChartPanel class to support copying charts to the clipboard,
|
||||
panning and mouse-wheel zooming, and an overlay mechanism that supports
|
||||
crosshairs;
|
||||
- enhancements to the auto-range calculation for axes, providing the ability
|
||||
to use subranges only and also to skip hidden series;
|
||||
- updates for many of the CategoryItemRenderer implementations to ensure that
|
||||
they respect the 'seriesVisible' flags;
|
||||
- an improvement to the TimeSeries class so that it is no longer necessary to
|
||||
specify the time period type in the constructor;
|
||||
- a new SamplingXYLineRenderer for improving the performance of time series
|
||||
charts with large datasets;
|
||||
- the XYSeries/XYSeriesCollection classes now cache the minimum and maximum
|
||||
data values to improve the performance of charts with large datasets;
|
||||
- entities are now created for the chart, data area and axes, allowing mouse
|
||||
clicks to be detected for these regions;
|
||||
- added a bar alignment factor to the XYBarRenderer class;
|
||||
- a new 'errorIndicatorStroke' field for the StatisticalLineAndShapeRenderer
|
||||
and XYErrorRenderer classes;
|
||||
- added a new HeatMapDataset interface, DefaultHeatMapDataset implementation,
|
||||
and a HeatMapUtilities class to make it easier to create heat map charts;
|
||||
- there is a new flag to allow an XYDataImageAnnotation to be included in the
|
||||
automatic range calculation for the axes;
|
||||
- additional attributes in the XYTextAnnotation class;
|
||||
- added a sampleFunction2DToSeries() method to the DatasetUtilities class;
|
||||
- some changes to the ChartPanel class that help to work around a regression in
|
||||
JRE 1.6.0_10 relating to drawing in XOR mode. Regarding this final point:
|
||||
* the default value for the useBuffer flag has changed to true, which means
|
||||
that all charts will, by default, be rendered into an off-screen image
|
||||
before being displayed in the ChartPanel;
|
||||
* the zoom rectangle is drawn using XOR mode *only* when the useBuffer
|
||||
flag has been set to false.
|
||||
For most usage, this should improve performance (but at the cost of using more
|
||||
memory for each ChartPanel used in your application);
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
2690293 : Problem with Javascript escape characters;
|
||||
2617557 : StandardDialScale ignored tickLabelPaint;
|
||||
2612649 : Stroke selection in plot property editor;
|
||||
2583891 : SWTGraphics2D.fillPolygon() not implemented;
|
||||
2564636 : Month constructor ignores Locale;
|
||||
2502355 : ChartPanel sending multiple events;
|
||||
2490803 : PeriodAxis.setRange() method doesn't take into account that the axis
|
||||
displays whole periods;
|
||||
|
||||
In addition, a bug in the SlidingCategoryDataset class has been fixed, the
|
||||
correct outline paint is now used by GradientXYBarPainter, a new method
|
||||
has been added to the ImageMapUtilities class to escape special characters
|
||||
in Javascript strings to avoid problems with the OverLIB and DynamicDrive
|
||||
tooltips, and there are some important fixes in the LogAxis class.
|
||||
|
||||
This release passes 2110 JUnit tests (0 failures) on JRE 1.6.0_12.
|
||||
|
||||
|
||||
JFreeChart 1.0.12
|
||||
-----------------
|
||||
31 December 2008
|
||||
|
||||
This release adds support for minor tick marks, mapping datasets to more than
|
||||
one axis, an important fix for the XYSeries class (relating to the
|
||||
addOrUpdate() method) plus numerous other bug fixes.
|
||||
|
||||
This release passes 1996 JUnit test (0 failures) on JRE 1.6.0_10.
|
||||
|
||||
API Adjustments:
|
||||
- CategoryPlot : added mapDatasetToDomainAxes() and mapDatasetToRangeAxes()
|
||||
methods;
|
||||
- Month : added a new constructor Month(Date, TimeZone, Locale) and deprecated
|
||||
Month(Date, TimeZone);
|
||||
- Quarter : added a new constructor Quarter(Date, TimeZone, Locale) and
|
||||
deprecated Quarter(Date, TimeZone);
|
||||
- XYPlot : added mapDatasetToDomainAxes() and mapDatasetToRangeAxes() methods;
|
||||
- Year : added a new constructor Year(Date, TimeZone, Locale) and deprecated
|
||||
Year(Date, TimeZone);
|
||||
|
||||
Bug Fixes:
|
||||
2471906 : XYAreaRenderer with dashed outline - performance problem;
|
||||
2452078 : StackedAreaChart has gaps;
|
||||
2275695 : NullPointerException for SubCategoryAxis on plot with null dataset;
|
||||
2221495 : XYLineAnnotation with dashed stroke;
|
||||
2216511 : SWTBarChartDemo1 throws RuntimeException;
|
||||
2201869 : DateAxis tick label position error;
|
||||
2121818 : Label link lines for very thin RingPlot;
|
||||
2113627 : XYStepRenderer item labels;
|
||||
1955483 : XYSeries.addOrUpdate() problem.
|
||||
|
||||
Also fixed StackedXYBarRenderer which was ignoring the shadowsVisible attribute.
|
||||
|
||||
|
||||
JFreeChart 1.0.11
|
||||
-----------------
|
||||
19 September 2008
|
||||
|
||||
This release features a new chart theming mechanism to allow charts to be
|
||||
restyled conveniently, a new BarPainter mechanism to enhance the appearance of
|
||||
bar charts, a new XYShapeRenderer class, a scaling facility for the
|
||||
XYDrawableAnnotation for drawing images within specific data coordinates, some
|
||||
new classes (XYTaskDataset, XYDataImageAnnotation and XYTitleAnnotation), a
|
||||
modification to the Year class to support an extended range, and various bug
|
||||
fixes and API improvements. There is an important bug fix for the
|
||||
StackedBarRenderer3D class (see bug 2031407).
|
||||
|
||||
This release passes 1,961 JUnit tests (0 failures) on JRE 1.6.0_07.
|
||||
|
||||
API Adjustments:
|
||||
- AbstractRenderer - added clearSeriesPaints() and clearSeriesStrokes()
|
||||
methods;
|
||||
- BarRenderer - added shadowPaint attribute;
|
||||
- CategoryAxis - added getCategoryMiddle() method;
|
||||
- CategoryPlot - added getRendererCount() method;
|
||||
- ChartFactory - added get/setChartTheme() methods;
|
||||
- ChartPanel - increased default maximum drawing width and height;
|
||||
- ChartTheme - new interface;
|
||||
- ChartUtilities - added applyCurrentTheme() method;
|
||||
- CompositeTitle - added backgroundPaint attribute;
|
||||
- GradientBarPainter - new class;
|
||||
- LegendTitle - added getWrapper() method;
|
||||
- OHLCSeriesCollection - added xPosition attribute;
|
||||
- PaintScaleLegend - new subdivisions field;
|
||||
- PiePlot - added autoPopulate flags, and methods to clear section attributes;
|
||||
- Plot - added setDrawingSupplier() method;
|
||||
- RegularTimePeriod - the DEFAULT_TIME_ZONE field has been deprecated in this
|
||||
release;
|
||||
- RelativeDateFormat - added methods to control formatting of hours and
|
||||
minutes - see patch 2033092;
|
||||
- StandardChartTheme - new class;
|
||||
- XYItemRendererState - new methods;
|
||||
- XYPlot - added getRendererCount() method;
|
||||
- XYShapeRenderer - new class;
|
||||
- XYTaskDataset - new class.
|
||||
|
||||
Patches:
|
||||
1997549 : Status calls to XYItemRendererState [Ulrich Voigt];
|
||||
2006826 : CompositeTitle drawing fix;
|
||||
2033092 : Additional formatters for RelativeDateFormat [Cole Markham];
|
||||
|
||||
Bug Fixes:
|
||||
1994355 : ChartComposite listener type;
|
||||
2031407 : Incorrect rendering in StackedBarRenderer3D;
|
||||
2033721 : WaferMapRenderer;
|
||||
2051168 : No key in LegendItemEntity for pie charts;
|
||||
|
||||
Also fixed drawing of alternate grid bands in SymbolAxis, the totalWeight
|
||||
calculation in the CombinedXXXPlot classes, a NullPointerException in the
|
||||
XYPlot class when drawing quadrants, outline visibility in the
|
||||
CategoryPlot class, and auto-range calculations with XYBarRenderer.
|
||||
|
||||
|
||||
JFreeChart 1.0.10
|
||||
-----------------
|
||||
9 June 2008
|
||||
|
||||
This release contains various bug fixes and minor enhancements to JFreeChart.
|
||||
PiePlot labelling has been enhanced (new curve options, and more robust bounds
|
||||
checking). The BoxAndWhiskerRenderer now has a maximumBarWidth attribute, the
|
||||
XYStepRenderer has a new stepPoint attribute. The RelativeDateFormat class
|
||||
has new options. There are new dataset classes (SlidingCategoryDataset and
|
||||
SlidingGanttDataset) that permit a subset of categories to be plotted, and
|
||||
allow charts based on these datasets to simulate scrolling. There is a new
|
||||
ShortTextTitle class.
|
||||
|
||||
This release passes 1,929 JUnit tests (0 failures) on JRE 1.6.0_03.
|
||||
|
||||
|
||||
API Adjustments:
|
||||
|
||||
- BoxAndWhiskerRenderer - added maximumBarWidth attribute (see patch 1866446);
|
||||
- ChartPanel - the zoomPoint attribute has been changed from Point to Point2D;
|
||||
- DatasetUtilities - iterateCategoryRangeBounds() is deprecated, the method
|
||||
has been renamed iterateRangeBounds(CategoryDataset) for consistency;
|
||||
- DefaultKeyedValue - the constructor now prevents a null key;
|
||||
- LogFormat - now has a 'powerLabel' attribute;
|
||||
- ShortTextTitle - a new title class;
|
||||
- SlidingCategoryDataset - new class;
|
||||
- SlidingGanttDataset - new class;
|
||||
- TimeSeriesCollection - getSeries(String) changed to getSeries(Comparable);
|
||||
- XIntervalSeriesCollection - added series removal methods;
|
||||
- YIntervalSeriesCollection - added series removal methods;
|
||||
- XYIntervalSeriesCollection - added series removal methods;
|
||||
|
||||
PublicCloneable is now implemented by a number of classes that didn't
|
||||
previously implement the interface - this should improve the reliability of
|
||||
chart cloning.
|
||||
|
||||
Patches:
|
||||
|
||||
1943021 : Fix for MultiplePiePlot [Brian Cabana];
|
||||
1925366 : Speed improvement for DatasetUtilities [Rafal Skalny];
|
||||
1918209 : LogAxis createTickLabel() changed from private to
|
||||
protected [Andrew Mickish];
|
||||
1914411 : Simplification of plot event notification [Richard West];
|
||||
1913751 : XYPlot and CategoryPlot addMarker() methods with
|
||||
optional notification [Richard West];
|
||||
1902418 : Bug fix for LogAxis vertical labels [Andrew Mickish];
|
||||
1901599 : Fixes for XYTitleAnnotation [Andrew Mickish];
|
||||
1891849 : New curve option for pie chart label links [Martin Hilpert];
|
||||
1874890 : Added step point to XYStepRenderer [Ulrich Voigt];
|
||||
1873328 : Enhancements to RelativeDateFormat [Michael Siemer];
|
||||
1871902 : PolarPlot now has angleTickUnit attribute [Martin Hoeller];
|
||||
1868745 : Fix label anchor points on LogAxis [Andrew Mickish];
|
||||
1866446 : Added maximumBarWidth to BoxAndWhiskerRenderer [Rob Van der Sanden];
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1932146 - PeriodAxis.setRange() doesn't notify listeners;
|
||||
1927239 - Fix calculation of cumulative range;
|
||||
1926517 - Bugs in data range calculation for combined plots;
|
||||
1920854 - PiePlot3D labels drawn multiple times;
|
||||
1897580 - Fix for DefaultIntervalCategoryDataset;
|
||||
1892419 - Wrong default for minor tick count in LogAxis;
|
||||
1880114 - VectorRenderer doesn't work for horizontal plot orientation;
|
||||
1873160 - DialPlot clipping issues;
|
||||
1868521 - Problem saving charts to JPEG format;
|
||||
1864222 - Error on TimeSeries createCopy() method;
|
||||
|
||||
The DatasetUtilities.sampleFunction2D() has been changed to sample the correct
|
||||
number of points - you should check any code that calls this method. The
|
||||
XYBlockRenderer class now generates entities. Bugs in the removeDomainMarker()
|
||||
and removeRangeMarker() methods in the CategoryPlot and XYPlot classes have
|
||||
been fixed. A bug in the TimePeriodValues range calculation has been fixed.
|
||||
Fixes were applied to the clone() methods in the TaskSeries and
|
||||
TaskSeriesCollection classes.
|
||||
|
||||
New Experimental Features:
|
||||
|
||||
Two new classes CombinedCategoryPlot and CombinedXYPlot have been added to the
|
||||
'experimental' source tree - these were contributed by Richard West (see
|
||||
patch 1924543).
|
||||
|
||||
|
||||
JFreeChart 1.0.9
|
||||
----------------
|
||||
4 January 2008
|
||||
|
||||
This release contains an important security patch as well as various bug fixes
|
||||
and minor enhancements. Regarding the security patch, please see the
|
||||
following advisory:
|
||||
|
||||
http://www.rapid7.com/advisories/R7-0031.jsp
|
||||
|
||||
Note that the fix incorporated in the special JFreeChart 1.0.8a release was
|
||||
flawed in that it broke the URLs in the HTML image maps generated by
|
||||
JFreeChart. Further amendments have been made in this release to fix this
|
||||
problem.
|
||||
|
||||
API Adjustments:
|
||||
|
||||
A number of classes have new methods. Nothing has been removed or deprecated:
|
||||
|
||||
- HashUtilities - added hashCode() methods for BooleanList, PaintList and
|
||||
StrokeList;
|
||||
- ImageMapUtilities - added htmlEscape(String);
|
||||
- IntervalMarker - added new constructor;
|
||||
- Range - added intersects(Range) and scale(Range, double);
|
||||
- TextTitle - added protected methods arrangeNN(), arrangeFN() and arrangeRN();
|
||||
- XYDataItem - added getXValue() and getYValue() methods;
|
||||
- XYPlot - added setFixedDomainAxisSpace(AxisSpace, boolean) and
|
||||
setFixedRangeAxisSpace(AxisSpace, boolean);
|
||||
- XYSeriesCollection - added getSeries(Comparable) method.
|
||||
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1852525 - CandlestickChart.getCategoryPlot() - ClassCastException;
|
||||
1851416 - testGetFirstMillisecondWithTimeZone fails in 1.0.8a;
|
||||
1849333 - 1.0.8a breaks URLs in HTML image maps;
|
||||
1848961 - GroupedStackedBarRenderer works only for primary dataset;
|
||||
1846063 - Endless loop in paint of XYPlot;
|
||||
1840139 - Cross-site scripting vulnerabilities in image map code;
|
||||
1837979 - Background image not shown with SWT;
|
||||
1460195 - ChartEntity.getImageMapAreaTag() needs nohref;
|
||||
1400917 - OverLIBToolTipTagFragmentGenerator not escaping single quote;
|
||||
1363043 - Escape Image Map Data;
|
||||
1178601 - AbstractRenderer.hashcode() method returns the same value;
|
||||
|
||||
In addition, a bug in the constructor for the Week class has been fixed.
|
||||
|
||||
|
||||
JFreeChart 1.0.8
|
||||
----------------
|
||||
23 November 2007
|
||||
|
||||
This release is primarily a bug fix release, correcting a problem with pie
|
||||
chart labelling, a regression in the DefaultCategoryDataset class (and
|
||||
underlying KeyedValues2D class), and a cloning bug in the TimeSeries class.
|
||||
In addition, the StatisticalBarRenderer class has a new 'errorIndicatorStroke'
|
||||
field and has been updated to support gradients, the StandardDialScale has had
|
||||
some missing accessor methods implemented, and an override field in the
|
||||
StandardXYItemRenderer class has been deprecated. Plus some warnings reported
|
||||
by FindBugs 1.3.0 have been addressed.
|
||||
|
||||
|
||||
JFreeChart 1.0.7
|
||||
----------------
|
||||
14 November 2007
|
||||
|
||||
This release features new classes DialPlot and LogAxis (previously in
|
||||
experimental), initial support for minor tick units, a new anchored zooming
|
||||
option for the ChartPanel class, optional simple labelling on pie charts,
|
||||
improvements to the "statistical" datasets and underlying data structures, and
|
||||
numerous bug fixes.
|
||||
|
||||
API Adjustments:
|
||||
|
||||
- CategoryAxis - added getCategorySeriesMiddle() method;
|
||||
- CategoryPlot - added methods to remove markers;
|
||||
- ChartPanel - added defaultDirectorForSaveAs attribute;
|
||||
- DialPlot - new class, an alternative to MeterPlot;
|
||||
- LogAxis - new class, an alternative to LogarithmicAxis;
|
||||
- NumberTick - new constructor that allows specification of the tick type;
|
||||
- NumberTickUnit - new constructor to specify the minor tick count;
|
||||
- SymbolAxis - new methods get/setGridBandAlternatePaint();
|
||||
- TickType - new class;
|
||||
- TickUnit - added minorTickCount attribute;
|
||||
- ValueTick - added tickType attribute;
|
||||
- StandardPieSectionLabelGenerator - new constructors accepting a Locale;
|
||||
- StandardPieToolTipGenerator - likewise;
|
||||
- CategoryPlot - added getRangeAxisIndex(), zoomDomainAxes() and zoomRangeAxes()
|
||||
methods;
|
||||
- FastScatterPlot - added new zooming methods;
|
||||
- PiePlot - new attributes to support simple labelling;
|
||||
- PlotUtilities - new class;
|
||||
- PolarPlot - added new zooming methods;
|
||||
- ThermometerPlot - likewise;
|
||||
- XYPlot - added methods to remove markers (patch 1823697--same as for
|
||||
CategoryPlot), and added new zooming methods;
|
||||
- Zoomable - added new zooming methods to this interface;
|
||||
- LineAndShapeRenderer - added useSeriesOffset and itemMargin attributes;
|
||||
- MinMaxCategoryRenderer - implemented equals();
|
||||
- XYSplineAndShapeRenderer - new class;
|
||||
- LogFormat - new class;
|
||||
- ChartFactory - new pie and ring chart creation methods that accept a Locale;
|
||||
- ChartPanel - added zoomAroundAnchor attribute;
|
||||
- Series - added isEmpty() method;
|
||||
- BoxAndWhiskerItem - new convenience constructor;
|
||||
- DefaultBoxAndWhiskerCategoryDataset - new remove methods;
|
||||
- DefaultStatisticalCategoryDataset - likewise;
|
||||
- MeanAndStandardDeviation - added new value accessor methods;
|
||||
- TimeTableXYDataset - added clear() method;
|
||||
- Week - added new constructor;
|
||||
- KeyedObjects - added insertValue() and clear() methods;
|
||||
- KeyedObjects2D - added clear() method.
|
||||
|
||||
Patches:
|
||||
|
||||
1823724 - updated XYDifferenceRenderer to support item labels;
|
||||
1827829 - fixed possible NullPointerException in XYBarRenderer;
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1767315 - GrayPaintScale.getPaint() uses wrong value;
|
||||
1775452 - Inverted XYBarRenderer does not render margins correctly;
|
||||
1802195 - Marker.listenerList serializable;
|
||||
1779941 - StatisticalBarRenderer NPE;
|
||||
1766646 - XYBlockRenderer can't handle empty datasets;
|
||||
1763413 - PeriodAxis labels fail to display with setInverted
|
||||
1737953 - Zoom doesn't work on LogAxis(Demo1)
|
||||
1749124 - JFreeChart not added as TitleChangeListener
|
||||
|
||||
|
||||
JFreeChart 1.0.6
|
||||
----------------
|
||||
15 June 2007
|
||||
|
||||
This release features a new VectorRenderer (previously in experimental), a
|
||||
generalised XYDifferenceRenderer, better support for hotspots on legend items,
|
||||
improved performance for time series charts displaying subsets of data, support
|
||||
for GradientPaint in plot backgrounds, plus the usual slew of bug fixes and
|
||||
minor feature additions.
|
||||
|
||||
API Adjustments:
|
||||
|
||||
- CategoryItemEntity - replaced row and column index attributes with row and
|
||||
column key attributes;
|
||||
- CategoryItemRenderer - numerous series override settings have been deprecated;
|
||||
- DefaultPieDataset - added insertValues() method;
|
||||
- HexNumberFormat - new class;
|
||||
- LegendItem - added dataset and seriesKey attributes;
|
||||
- Plot - added new fillBackground() method to support GradientPaint, and
|
||||
added is/setOutlineVisible() methods;
|
||||
- QuarterDateFormat - added GREEK_QUARTERS field plus a new constructor;
|
||||
- SimpleHistogramDataset - added clearObservations() and removeAllBins()
|
||||
methods;
|
||||
- TimeSeriesCollection - added indexOf() method;
|
||||
- URLUtilities - new class;
|
||||
- XYItemRenderer - numerous series override settings have been deprecated;
|
||||
- XYSeriesCollection - added indexOf() method.
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1735508 - ClusteredXYBarRenderer fails with inverted x-axis;
|
||||
1726404 - ChartComposite tooltips;
|
||||
1713474 - StackedBarRenderer3D doesn't fill shadows;
|
||||
1713401 - StackedBarRenderer3D doesn't check drawBarOutline flag;
|
||||
1701822 - DefaultBoxAndWhiskerCategoryDataset doesn't follow contracts;
|
||||
1698965 - NPE in CombinedDomainXYPlot;
|
||||
1690994 - HideSeriesDemo1 does not work;
|
||||
1690654 - Bug in removeValue() of DefaultKeyedValues2D;
|
||||
1562701 - LegendItemEntity needs dataset index;
|
||||
1486299 - Use URLEncoder.encode() for URL generators;
|
||||
|
||||
Plus the following bugs that didn't have entries in the database:
|
||||
|
||||
- BarRenderer - check for series visibility in getLegendItem();
|
||||
- ChartPanel - use correct insets for painting chart buffer to screen, update
|
||||
UI for popup menu if LookAndFeel changes;
|
||||
- DateAxis - fixed boundary cases for previousStandardDate() method;
|
||||
- LineBorder - only draw border if area has positive dimensions;
|
||||
- JFreeChart - should register as a listener with the default legend;
|
||||
- StandardXYItemRenderer - fixed a problem where chart entities are created for
|
||||
non-visible items;
|
||||
- TimePeriodValuesCollection.getDomainBounds() now computes the bounds
|
||||
correctly;
|
||||
- XYLineAndShapeRenderer - fixed a problem where chart entities are created for
|
||||
non-visible items;
|
||||
- XYLine3DRenderer - equals() implemented, and serialization fixed;
|
||||
- XYTitleAnnotation - fixed equals() method;
|
||||
- various resource usage bugs in the experimental ChartComposite class;
|
||||
|
||||
|
||||
JFreeChart 1.0.5
|
||||
----------------
|
||||
23 March 2007
|
||||
|
||||
This release features a new DeviationRenderer class, support for item labels
|
||||
in StackedXYBarRenderer, tooltips and URLs in the CategoryStepRenderer, and
|
||||
many bug fixes.
|
||||
|
||||
API Adjustments:
|
||||
|
||||
- AbstractCategoryItemRenderer - added createState() method;
|
||||
- StackedXYBarRenderer - added get/setRenderAsPercentages() methods;
|
||||
- XYIntervalSeries - added getXLowValue(), getXHighValue(), getYLowValue() and
|
||||
getYHighValue();
|
||||
- YIntervalSeries - added getYLowValue() and getYHighValue() methods;
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1681777 - DefaultCategoryDataset does not clone data;
|
||||
1672552 - Zoom rectangle is lost when the chart is repainted;
|
||||
1671645 - Crosshair incorrectly positioned in horizontal orientation;
|
||||
1669302 - Tick labels in vertical symbol axis;
|
||||
1669218 - CategoryPlot.setDomainAxisLocation() ignores parameter;
|
||||
1667750 - Clip region not restored in Spider and MeterPlot;
|
||||
1663380 - OutputStream not closed;
|
||||
1659627 - IntervalMarker with Double.POSITIVE_INFINITY bound;
|
||||
1647269 - IntervalMarker with Double.MAX_VALUE as upper bound;
|
||||
1594477 - XYBarRenderer does not render bars on LogarithmicAxis;
|
||||
1459958 - Log axis zoom function problem;
|
||||
880597 - Zooming ChartPanel with log axes;
|
||||
764561 - Dynamic chart zoom buggy.
|
||||
|
||||
Also fixed numerous bugs in equals(), cloning and serialization
|
||||
implementations.
|
||||
|
||||
|
||||
JFreeChart 1.0.4
|
||||
----------------
|
||||
9 February 2007
|
||||
|
||||
This release features a new XYBlockRenderer class, URLs for pie chart labels
|
||||
in HTML image maps, a new dataset implementation for open-high-low-close
|
||||
charts, support for gradient paint in ClusteredXYBarRenderer,
|
||||
StackedXYBarRenderer and legend graphics, a new anchor attribute for
|
||||
XYImageAnnotation, improvements to the experimental SWT support, plus a
|
||||
number of additions to the API for usability, and many bug fixes.
|
||||
|
||||
API Adjustments:
|
||||
|
||||
- DateAxis - added get/setTimeZone() methods;
|
||||
- DefaultXYDataset - now implements PublicCloneable;
|
||||
- StackedXYAreaRenderer2 - added get/setRoundXValues() methods;
|
||||
- StandardXYItemLabelGenerator - added new constructor;
|
||||
- StandardXYToolTipGenerator - added new constructor;
|
||||
- XYBarDataset - added getUnderlyingDataset() and get/setBarWidth() methods;
|
||||
- XYDifferenceRenderer - added roundXCoordinates attribute;
|
||||
- XYImageAnnotation - added an image anchor attribute, a new constructor, and
|
||||
several accessor methods;
|
||||
- XYSeries - added toArray() method;
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1654215 - XYPlot renderer with no corresponding dataset;
|
||||
1652640 - RangeMarkers do not update properly;
|
||||
1649686 - Crosshairs for StackedXYAreaRenderer;
|
||||
1647749 - IllegalArgumentException in SWTAxisEditor;
|
||||
1644877 - Replacing series data in DefaultXYDataset;
|
||||
1644010 - DateAxis.nextStandardDate() ignores timezone;
|
||||
1638678 - DateAxis code uses the default calendar;
|
||||
1629382 - Tests fail for jfreechart-1.0.3;
|
||||
1624067 - StandardXYToolTipGenerator missing constructor;
|
||||
1616583 - Serialize ChartDeleter;
|
||||
1612770 - Popup menu in wrong position for SWT ChartComposite;
|
||||
1611872 - Minute.previous() returns null for minute == 0;
|
||||
1608371 - Tick labels overlap with custom NumberFormat;
|
||||
1606205 - Draw shared axis last on combined plots;
|
||||
1605207 - IntervalMarker exceeds bounds of data area;
|
||||
1605202 - SpiderWebPlot method access;
|
||||
1599652 - Inverted StackedBar3D problem;
|
||||
1598394 - XYBarDataset hiding its proxied object;
|
||||
1564967 - Crosshairs on XYDifferenceRenderer;
|
||||
1245305 - NullPointerException in writeImageMap();
|
||||
1086307 - Crosshairs on plots with multiple axes.
|
||||
|
||||
Also fixed numerous bugs in equals() and clone() methods throughout the API.
|
||||
|
||||
|
||||
JFreeChart 1.0.3:
|
||||
-----------------
|
||||
17 November 2006
|
||||
|
||||
This release features several new IntervalXYDataset implementations, some
|
||||
significant refactoring of the time period classes (to improve performance
|
||||
and correctness), modifications to the PiePlot class to support reordering of
|
||||
dataset items, a new event mechanism to allow updating of markers, plus many
|
||||
other enhancements, bug fixes and documentation updates.
|
||||
|
||||
A new DialPlot implementation has been added to the 'experimental' sources.
|
||||
We are looking for people to test this code and provide feedback, so that we
|
||||
can stabilize the API and add this code to the main JFreeChart API.
|
||||
|
||||
API adjustments:
|
||||
|
||||
The following adjustments have been made to the API:
|
||||
|
||||
- CategoryLabelEntity - new class;
|
||||
- CategoryPointerAnnotation - new class;
|
||||
- ChartPanel: added new public method doEditChartProperties();
|
||||
- ComparableObjectItem, ComparableObjectSeries - new classes;
|
||||
- CrosshairState: added several new accessor methods;
|
||||
- DefaultPieDataset: added sortByKeys() and sortByValues() methods;
|
||||
- Markers: a change event mechanism has been added to the Marker class and
|
||||
its subclasses;
|
||||
- StackedAreaRenderer: added get/setRenderAsPercentages() methods;
|
||||
- XIntervalDataItem, XIntervalSeries and XIntervalSeriesCollection - new
|
||||
classes;
|
||||
- XYErrorRenderer: new class;
|
||||
- XYInterval, XYIntervalDataItem, XYIntervalSeries and
|
||||
XYIntervalSeriesCollection - new classes;
|
||||
- YInterval, YIntervalDataItem, YIntervalSeries, YIntervalSeriesCollection and
|
||||
YWithXInterval - new classes.
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1578293 - Unused methods in JDBCXYDataset;
|
||||
1572478 - BoxAndWhiskerRenderer potential NullPointerException;
|
||||
1569094 - XYStepRenderer with horizontal orientation;
|
||||
1565168 - Crosshair position incorrect;
|
||||
1564977 - DateAxis missing initial tick label;
|
||||
1562759 - StatisticalLineAndShapeRenderer constructor ignores arguments;
|
||||
1557141 - Bad locale in ServletUtilities;
|
||||
1550045 - TimeSeries.removeAgedItems() method problems;
|
||||
1549218 - Chart not displaying when all data values are the same and large;
|
||||
1450447 - Marker.setAlpha() ignored;
|
||||
|
||||
Also fixed URL generation for legend items, tick mark positioning on the
|
||||
DateAxis, the equals() method in the AreaRenderer class, hardcoded outline
|
||||
attributes in the XYBubbleRenderer, and potential NullPointerExceptions in the
|
||||
ChartPanel class.
|
||||
|
||||
|
||||
JFreeChart 1.0.2:
|
||||
-----------------
|
||||
Released on 25 August 2006.
|
||||
|
||||
API adjustments:
|
||||
|
||||
The following adjustments have been made to the API (there should be no
|
||||
breakage of applications coded to the 1.0.0 or 1.0.1 API):
|
||||
|
||||
- CategoryToPieDataset: added accessor methods for underlying dataset, extract
|
||||
type and index (feature request 1477915);
|
||||
- DefaultXYDataset: New dataset implementation that uses double[] arrays;
|
||||
- DefaultXYZDataset: New dataset implementation that uses double[] arrays;
|
||||
- LegendItemBlockContainer: New container used in legends (enables
|
||||
legend item entities again);
|
||||
- MultiplePiePlot: Added new fields aggregatedItemsKey and
|
||||
aggregatedItemsPaint, plus accessor methods - see bug 1190647;
|
||||
- SpiderWebPlot: Added new fields toolTipGenerator and urlGenerator, plus
|
||||
accessor methods (see patch 1463455);
|
||||
- StackedBarRenderer3D: Added new flag (renderAsPercentages), plus accessor
|
||||
methods, that controls whether the data items are displayed as values or
|
||||
percentages. Two new constructors are also added (see patch 1459313);
|
||||
- XYPolygonAnnotation: Added new accessor methods.
|
||||
|
||||
Patches:
|
||||
|
||||
1459313 - Add renderAsPercentages option to StackedBarRenderer3D;
|
||||
1462727 - Modify SpiderWebPlot to support zero values;
|
||||
1463455 - Modify SpiderWebPlot to support mouse clicks, tool tips and URLs;
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
1514904 - Background image alpha in Plot class;
|
||||
1499140 - ClusteredXYBarRenderer with margin not drawing correctly;
|
||||
1494936 - LineAndShapeRenderer generates entity for non-visible item;
|
||||
1493199 - NPE drawing SpiderWebPlot with null info;
|
||||
1480978 - AbstractPieItemLabelGenerator.clone() doesn't clone percentFormat;
|
||||
1472942 - DateAxis.equals() broken;
|
||||
1468794 - StatisticalLineAndShapeRenderer doesn't draw error bars correctly
|
||||
when the plot has a horizontal orientation;
|
||||
- AbstractCategoryItemRenderer doesn't check seriesVisibleInLegend
|
||||
flag before creating new item;
|
||||
1440415 - Bad distribution of pie chart section labels;
|
||||
1440346 - Bad manifest entry for JCommon in JFreeChart jar file;
|
||||
1435461 - NumberAxis.equals() ignores rangeType field;
|
||||
1435160 - XYPointerAnnotation.equals() ignores x and y fields;
|
||||
1398672 - LegendItemEntities not working;
|
||||
1380480 - StandardXYItemRenderer problems with Double.NaN;
|
||||
1190647 - Legend and section color mismatch for MultiplePiePlot.
|
||||
|
||||
Miscellaneous Changes:
|
||||
|
||||
- Updated CandlestickRenderer, CyclicXYItemRenderer, HighLowRenderer,
|
||||
XYStepAreaRenderer and TimeSeriesURLGenerator to call dataset methods that
|
||||
return double primitive only;
|
||||
- Updated XYPolygonAnnotation, adding new accessor methods and fixing problems
|
||||
in the equals()/hashCode() methods;
|
||||
- ChartFactory.createStackedXYAreaChart() now uses StackedXYAreaRenderer2, for
|
||||
better handling of negative values;
|
||||
- Added crosshair support for XYBarRenderer.
|
||||
|
||||
Experimental Code:
|
||||
|
||||
In this release, some new (incomplete) classes have been included in the
|
||||
org.jfree.experimental.* namespace. These classes are not part of the
|
||||
standard API, but are included for developers to experiment with and provide
|
||||
feedback on. Hopefully in the future, refined versions of these classes will
|
||||
be incorporated into the main library. PLEASE NOTE THAT THE API FOR THESE
|
||||
CLASSES IS SUBJECT TO CHANGE.
|
||||
|
||||
|
||||
JFreeChart 1.0.1:
|
||||
----------------
|
||||
Released 27 January 2006. This is primarily a bug fix release. In addition,
|
||||
there are some API adjustments (there should be no breakage of applications
|
||||
coded to the 1.0.0 API).
|
||||
|
||||
API adjustments:
|
||||
- BarRenderer: added a new flag (includeBaseInRange), plus accessor
|
||||
methods, that controls whether or not the base value for the bar is
|
||||
included in the range calculated by the findRangeBounds() method;
|
||||
- BubbleXYItemLabelGenerator: new class;
|
||||
- Range: added a new method expandToInclude(Range, double), this is used by
|
||||
the BarRenderer class;
|
||||
- TaskSeriesCollection: added two new methods, getSeries(int) and
|
||||
getSeries(Comparable).
|
||||
- TimeSeriesCollection: the domainIsPointsInTime flag has been deprecated.
|
||||
The flag serves no function now that renderers are used to calculate the
|
||||
domain bounds, so you can safely delete any calls to the
|
||||
setDomainIsPointsInTime() method;
|
||||
- XYPlot: added a new getAnnotations() method;
|
||||
- XYSeries: the update(int, Number) method has been deprecated and a new method
|
||||
updateByIndex(int, Number) has been added;
|
||||
|
||||
Bug fixes:
|
||||
|
||||
1243050 - XYBarRenderer doesn't show entire range of values for a
|
||||
TimeSeriesCollection;
|
||||
1373371 - XYBubbleRenderer doesn't support item labels;
|
||||
1374222 - BarRenderer contains JDK 1.4 specific code;
|
||||
1374328 - LegendItem serialization problem;
|
||||
1377239 - Bad argument checking in Quarter constructor;
|
||||
1379331 - Incorrect drawing of TextTitle at LEFT or RIGHT position;
|
||||
1386328 - RingPlot entity incorrect;
|
||||
1400442 - Inconsistent treatment of null and zero values in PiePlot;
|
||||
1401856 - Bad rendering for non-zero base values in BarRenderer;
|
||||
1403043 - NullPointerException in CategoryAxis;
|
||||
1408904 - NumberAxis3D assumes CategoryPlot;
|
||||
1415480 - XYTextAnnotation equals() method doesn't check (x, y);
|
||||
|
||||
|
||||
JFreeChart 1.0.0:
|
||||
----------------
|
||||
Released on 2 December 2005.
|
||||
@@ -0,0 +1,817 @@
|
||||
********************************
|
||||
* JFREECHART: Version 1.0.17 *
|
||||
********************************
|
||||
|
||||
24 November 2013
|
||||
|
||||
(C)opyright 2000-2013, by Object Refinery Limited and Contributors.
|
||||
|
||||
-----------------
|
||||
1. INTRODUCTION
|
||||
-----------------
|
||||
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.
|
||||
|
||||
JFreeChart is licensed under the terms of the GNU Lesser General
|
||||
Public Licence (LGPL). A copy of the licence is included in the
|
||||
distribution.
|
||||
|
||||
Please note that JFreeChart is distributed WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. Please refer to the licence for details.
|
||||
|
||||
We are grateful to the many developers that have contributed to JFreeChart.
|
||||
The contributors are listed below in section 10.
|
||||
|
||||
-------------------
|
||||
2. LATEST VERSION
|
||||
-------------------
|
||||
The latest version of this class library can be obtained from:
|
||||
|
||||
http://www.jfree.org/jfreechart/
|
||||
|
||||
If you have any comments, suggestions or bugs to report, please post a
|
||||
message in the JFreeChart forum.
|
||||
|
||||
-----------------
|
||||
3. DOCUMENTATION
|
||||
-----------------
|
||||
You can download installation instructions
|
||||
(jfreechart-1.0.17-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
|
||||
operated by David Gilbert (the original author of JFreeChart). For more
|
||||
information, please see:
|
||||
|
||||
http://www.object-refinery.com/jfreechart/guide.html
|
||||
|
||||
Sales of the JFreeChart Developer Guide are an important source of funding for
|
||||
the project. Please help us to continue developing free software.
|
||||
|
||||
API documentation files in HTML format are available on-line. If you wish
|
||||
to keep a local copy of the API files, you can regenerate them directly
|
||||
from the source code. You can do this using the 'javadoc' utility directly,
|
||||
or with the Ant script (build.xml) included in the distribution.
|
||||
|
||||
-----------------
|
||||
4. DEPENDENCIES
|
||||
-----------------
|
||||
JFreeChart has the following dependencies:
|
||||
|
||||
(a) JRE/JDK 1.6.0 or higher - note that the previous release of JFreeChart
|
||||
worked with JRE/JDK 1.4.2 or later. With a bit of hacking, it may be possible
|
||||
to get JFreeChart working on these older versions, but we are no longer
|
||||
supporting it.
|
||||
|
||||
(b) JCommon - version 1.0.0 or later. The runtime jar file (version 1.0.21)
|
||||
is included in the JFreeChart distribution. You can obtain the complete
|
||||
source code for JCommon from:
|
||||
|
||||
http://www.jfree.org/jcommon/
|
||||
|
||||
JCommon is licensed under the terms of the GNU Lesser General Public Licence.
|
||||
|
||||
(c) servlet.jar - classes in the org.jfree.chart.servlet
|
||||
package require this file. The JFreeChart distribution includes the
|
||||
servlet.jar file distributed with Tomcat 4.1.31. Applicable license
|
||||
terms are published at:
|
||||
|
||||
http://java.sun.com/products/servlet/LICENSE
|
||||
|
||||
(d) JUnit - a unit testing framework (the junit.jar runtime file is
|
||||
included in the distribution). JUnit is licensed under the terms
|
||||
of the IBM Common Public License. You can find out more about JUnit
|
||||
and/or download the latest version from:
|
||||
|
||||
http://www.junit.org
|
||||
|
||||
The JUnit tests included with JFreeChart have been created using JUnit
|
||||
4.3.1.
|
||||
|
||||
-----------
|
||||
5. SUPPORT
|
||||
-----------
|
||||
Support questions can be posted in the free support forum at
|
||||
|
||||
http://www.jfree.org/forum/viewforum.php?f=3
|
||||
|
||||
We read all questions posted in the forum, and respond to as many as we can
|
||||
in the time available. Unfortunately, there are too many questions to answer
|
||||
them all.
|
||||
|
||||
--------------------
|
||||
6. ANT BUILD SCRIPT
|
||||
--------------------
|
||||
An Ant build script (build.xml) is included in the distribution. This
|
||||
is the same script that is used to create the JFreeChart distribution.
|
||||
|
||||
For more information about Ant:
|
||||
|
||||
http://ant.apache.org/
|
||||
|
||||
If you want to rebuild the JFreeChart jar file, we highly recommend that you
|
||||
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. 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.17-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.
|
||||
|
||||
An additional tab added to the demo application in version 1.0.17 showcases
|
||||
Orson Charts 3D, a new library by Object Refinery Limited. You can find out
|
||||
more about Orson Charts at:
|
||||
|
||||
http://www.object-refinery.com/orsoncharts/
|
||||
|
||||
---------------
|
||||
8. LIMITATIONS
|
||||
---------------
|
||||
JFreeChart has some known limitations that will hopefully be addressed in
|
||||
the future:
|
||||
|
||||
- some renderers do not respect the series visibility flags yet;
|
||||
- the chart property editors (accessible by right-clicking on the chart
|
||||
panel) are horribly out of date and probably shouldn't be used;
|
||||
- item labels (if displayed) are not taken into account for the
|
||||
automatically calculated axis range. As a workaround, you can increase
|
||||
the axis margins;
|
||||
- tick labels on a DateAxis that uses a SegmentedTimeline can be
|
||||
problematic;
|
||||
|
||||
If there are other items that you think should be listed here,
|
||||
please post a bug report.
|
||||
|
||||
--------------
|
||||
9. WHAT's NEW
|
||||
--------------
|
||||
A list of changes in recent versions:
|
||||
|
||||
1.0.17 : (22-Nov-2013)
|
||||
- see the NEWS and ChangeLog files for details.
|
||||
|
||||
1.0.16 : (13-Sep-2013)
|
||||
- bumped the required JRE to 1.6, enhanced axis labelling, provided
|
||||
integration with JFreeSVG and OrsonPDF for vector output, and fixed
|
||||
bugs.
|
||||
|
||||
1.0.15 : (4-Jul-2013)
|
||||
- various minor feature enhancements and a range of bug fixes, see the
|
||||
NEWS and ChangeLog files for details.
|
||||
|
||||
1.0.14 : (20-Nov-2011)
|
||||
- added support for multiple axes in PolarPlot, performance
|
||||
improvements in the TimeSeriesCollection class, mouse wheel rotation
|
||||
in the PiePlot class, improved Maven support, a range of other
|
||||
minor functional enhancements and numerous bug fixes - see the NEWS
|
||||
and ChangeLog files for details.
|
||||
|
||||
1.0.13 : (17-Apr-2009)
|
||||
- there are some significant new features in this release, as well
|
||||
as performance enhancements and bug fixes - see the NEWS and
|
||||
ChangeLog files for details.
|
||||
|
||||
1.0.12 : (31-Dec-2008)
|
||||
- added support for minor tick marks, mapping datasets to more than
|
||||
one axis, and numerous bug fixes - see the NEWS and ChangeLog files
|
||||
for details.
|
||||
|
||||
1.0.11 : (18-Sep-2008)
|
||||
- this release includes a new chart theming mechanism, and numerous
|
||||
other feature enhancements and bug fixes - see the NEWS and ChangeLog
|
||||
files for details.
|
||||
|
||||
1.0.10 : (8-Jun-2008)
|
||||
- another general maintenance release - see the NEWS and ChangeLog
|
||||
files for more details.
|
||||
|
||||
1.0.9 : (4-Jan-2008)
|
||||
- this release fixes a security advisory with respect to the HTML
|
||||
image maps generated by JFreeChart - see the NEWS file for more
|
||||
information. In addition, a number of bugs have been fixed.
|
||||
|
||||
1.0.8 : (23-Nov-2007)
|
||||
- primarily a bug fix release. See the NEWS and ChangeLog files for a
|
||||
more detailed description of the changes in this release.
|
||||
|
||||
1.0.7 : (14-Nov-2007)
|
||||
- See the NEWS and ChangeLog files for a more detailed description of
|
||||
the changes in this release.
|
||||
|
||||
1.0.6 : (15-Jun-2007)
|
||||
- the VectorRenderer and associated dataset classes have been promoted
|
||||
to the standard API from the 'experimental' source tree. See the
|
||||
NEWS and ChangeLog files for a more detailed description of the
|
||||
changes in this release.
|
||||
|
||||
1.0.5 : (23-Mar-2007)
|
||||
- this release contains a new DeviationRenderer, enhancements to a
|
||||
number of existing classes and numerous bug fixes, see the NEWS
|
||||
and ChangeLog files for details.
|
||||
|
||||
1.0.4 : (9-Feb-2007)
|
||||
- this release contains both new features and bug fixes, see the NEWS
|
||||
and ChangeLog files for details.
|
||||
|
||||
1.0.3 : (17-Nov-2006)
|
||||
- this release contains a new DialPlot class (in 'experimental') that
|
||||
will hopefully replace the MeterPlot class, once the API has been
|
||||
polished a little, plus many other new features and bug fixes. See
|
||||
the NEWS and ChangeLog files for details.
|
||||
|
||||
1.0.2 : (25-Aug-2006)
|
||||
- this release contains both new features and bug fixes, see the NEWS
|
||||
and ChangeLog files for details.
|
||||
|
||||
1.0.1 : (27-Jan-2006)
|
||||
- primarily a bug fix release, see the NEWS and ChangeLog files for
|
||||
details.
|
||||
|
||||
1.0.0 : (2-Dec-2005)
|
||||
- the first stable release of the JFreeChart class library, all future
|
||||
releases in the 1.0.x series will aim to maintain backward
|
||||
compatibility with this release;
|
||||
- see the ChangeLog file for a detailed list of changes.
|
||||
|
||||
1.0.0-rc3 : (28-Nov-2005)
|
||||
- the third "release candidate" for version 1.0.0, this release
|
||||
fixes some issues with the 1.0.0-rc2 release (mainly concerning
|
||||
packaging of resource bundles for localisation).
|
||||
- if no significant problems are reported in the next few days,
|
||||
the 1.0.0 "final" release will be posted on 2-Dec-2005.
|
||||
|
||||
1.0.0-rc2 : (25-Nov-2005)
|
||||
- the second "release candidate" for version 1.0.0. If no problems
|
||||
are reported, 1.0.0 "final" will be released on 2-Dec-2005.
|
||||
- see the ChangeLog file for a detailed list of changes in this
|
||||
release.
|
||||
|
||||
1.0.0-rc1 : (2-Jun-2005)
|
||||
- this is a "release candidate" for version 1.0.0. If no
|
||||
significant API problems are reported, this release will be
|
||||
re-released as version 1.0.0.
|
||||
- see CHANGELOG.txt for further details.
|
||||
|
||||
1.0.0-pre2 : (10-Mar-2005)
|
||||
- see CHANGELOG.txt for further details.
|
||||
|
||||
1.0.0-pre1 : (29-Nov-2004)
|
||||
- see CHANGELOG.txt for further details.
|
||||
|
||||
0.9.21 : (9-Sep-2004)
|
||||
- added new axes: PeriodAxis and ModuloAxis.
|
||||
- split org.jfree.data and org.jfree.chart.renderer into
|
||||
subpackages for 'category' and 'xy' charts.
|
||||
- Sun PNG encoder is now used, if available.
|
||||
- a new demo application makes it easier to preview the
|
||||
chart types that JFreeChart can create.
|
||||
- added a new series visibility flag to the AbstractRenderer
|
||||
class.
|
||||
- added support for GradientPaint in interval markers.
|
||||
- see CHANGELOG.txt for further details.
|
||||
|
||||
0.9.20 : (7-Jun-2004)
|
||||
- primarily bug fixes, see CHANGELOG.txt for further details.
|
||||
|
||||
0.9.19 : (28-May-2004)
|
||||
- added methods to XYDataset that return double primitives;
|
||||
- removed distinction between "primary" and "secondary" datasets,
|
||||
renderers and axes;
|
||||
- added fixed legend item options to CategoryPlot and XYPlot;
|
||||
- legend changes by Barek Naveh;
|
||||
- removed Log4j dependency;
|
||||
- many, many bug fixes;
|
||||
- see CHANGELOG.txt for further details.
|
||||
|
||||
0.9.18 : (15-Apr-2004)
|
||||
- new legend anchor options;
|
||||
- fixed broken JPEG export;
|
||||
- fixed title size problems;
|
||||
- various other bug fixes;
|
||||
|
||||
0.9.17 : (26-Mar-2004)
|
||||
- pie chart enhancements for labelling, shading and multiple pie
|
||||
charts (2D or 3D) on a single plot;
|
||||
- new PolarPlot class added;
|
||||
- XYSeries can now be sorted or unsorted;
|
||||
- createBufferedImage() method can now scale charts;
|
||||
- domain and range markers now support intervals;
|
||||
- item labels are now supported by some XYItemRenderers;
|
||||
- tooltip and item label generators now use MessageFormat class;
|
||||
- added new XYBarDataset class;
|
||||
- added transparency support to PNG export;
|
||||
- numerous other small enhancements and bug fixes, see the
|
||||
CHANGELOG.txt file for more details;
|
||||
|
||||
0.9.16 : (09-Jan-2004)
|
||||
- this release contains bug fixes and some minor feature
|
||||
enhancements (title and category label wrapping, legend shape
|
||||
scaling, enhanced performance for the DefaultTableXYDataset class);
|
||||
- added Spanish localisation files;
|
||||
|
||||
0.9.15 : (28-Nov-2003)
|
||||
- the focus of this release is bug fixes - quite a number of issues
|
||||
have been resolved, please check the bug database for details;
|
||||
- added a new Wafer Map chart type;
|
||||
- added a cyclic axis;
|
||||
- added localisation files for _ru;
|
||||
|
||||
0.9.14 : (17-Nov-2003)
|
||||
- implemented zooming for the FastScatterPlot class;
|
||||
- added item label support for stacked bar charts, and new fall back
|
||||
options for item labels that don't fit within bars;
|
||||
- modified the CategoryAxis class to allow additional options for the
|
||||
alignment and rotation of category labels;
|
||||
- addition of the AxisState class, used in the drawing of axes to
|
||||
eliminate a bug when multiple threads draw the same axis
|
||||
simultaneously;
|
||||
- provided additional attributes in the DateTickUnit class to improve
|
||||
labelling on a segmented DateAxis;
|
||||
- added support for GradientPaint in bar charts;
|
||||
- updated the PNGEncoder;
|
||||
- fixes for tick label positioning on axes;
|
||||
- various Javadoc updates;
|
||||
- numerous bug fixes;
|
||||
|
||||
0.9.13 : (26-Sep-2003)
|
||||
- various enhancements to the stacked area XY charts;
|
||||
- added a completion indicator for the Gantt chart;
|
||||
- range and domain markers can now be placed in the foreground or the
|
||||
background;
|
||||
- more fixes for cloning and serialization;
|
||||
- fixed mouse event bug for combined charts;
|
||||
- fixed bugs in the PngEncoder class;
|
||||
- incorporated .properties files that were missing from the 0.9.12
|
||||
distribution;
|
||||
|
||||
0.9.12 : (11-Sep-2003)
|
||||
- extended box-and-whisker plots to work with the CategoryPlot class
|
||||
as well as the XYPlot class (based on work by David Browning);
|
||||
- added a new LayeredBarRenderer (by Arnaud Lelievre);
|
||||
- added support for stacked area charts with the XYPlot class (thanks
|
||||
to Richard Atkinson);
|
||||
- improved HTML image map support (thanks to Richard Atkinson);
|
||||
- added localized resources for the chart property editors (thanks to
|
||||
Arnaud Lelievre). Current translations include French and Portugese
|
||||
(thanks to Eduardo Ramalho);
|
||||
- added facility for setting all rendering hints;
|
||||
- improved support for cloning and serialization;
|
||||
- fixed a bug in the XYSeries class that prevented the TableXYDataset
|
||||
from functioning correctly;
|
||||
- improved date axis labelling with segmented time lines;
|
||||
- fixed several bugs in the secondary dataset/axis/renderer code;
|
||||
- fixed bugs in the JDBCCategoryDataset class;
|
||||
- numerous other bug fixes;
|
||||
|
||||
0.9.11 : (8-Aug-2003)
|
||||
- added support for box-and-whisker plots, thanks to David Browning;
|
||||
- lots of bug fixes;
|
||||
|
||||
API changes in this release are minimal and have been implemented using
|
||||
deprecation, so code written against 0.9.10 should recompile.
|
||||
|
||||
0.9.10 : (25-Jul-2003)
|
||||
- added support for multiple secondary axes, datasets and
|
||||
renderers;
|
||||
- minor feature enhancements and bug fixes;
|
||||
|
||||
0.9.9 : (10-Jul-2003) PLEASE NOTE THAT MAJOR CHANGES HAVE BEEN MADE IN THIS
|
||||
RELEASE AND ONE OR TWO FEATURES MAY BE BROKEN. PLEASE REPORT BUGS SO THEY CAN
|
||||
BE FIXED FOR THE NEXT RELEASE.
|
||||
|
||||
- merged the HorizontalCategoryPlot and VerticalCategoryPlot classes,
|
||||
into the CategoryPlot class;
|
||||
- merged the horizontal and vertical axis classes;
|
||||
- merged the horizontal and vertical renderer classes;
|
||||
- CategoryPlot and XYPlot now support both horizontal and vertical
|
||||
orientation via the setOrientation(...) method;
|
||||
- merged horizontal and vertical methods in the ChartFactory class;
|
||||
- created new combined plot classes: CombinedDomainCategoryPlot,
|
||||
CombinedRangeCategoryPlot, CombinedDomainXYPlot and
|
||||
CombinedRangeXYPlot (these can all be drawn with a horizontal or
|
||||
vertical orientation);
|
||||
- Bill Kelemen has enhanced the DateAxis class to handle segmented
|
||||
timelines. This can be used, for example, to skip weekends for
|
||||
daily stock price charts;
|
||||
- Richard Atkinson has updated the ServletUtilities class;
|
||||
- Bryan Scott has added an XYDatasetTableModel class for presenting
|
||||
datasets in a JTable;
|
||||
- modified XYPlot to allow renderers to use multiple passes through
|
||||
the dataset;
|
||||
- added new XYDifferenceRenderer;
|
||||
- added support for colored bands between gridlines in XYPlot;
|
||||
- added new XYDrawableAnnotation class;
|
||||
- added a new attribute to control the order of dataset rendering in
|
||||
a CategoryPlot;
|
||||
- extended the value label mechanism for the renderers, to allow
|
||||
better (per series) control over label generation, positioning and
|
||||
visibility;
|
||||
- CategoryItemTooltipGenerator has been renamed
|
||||
CategoryItemLabelGenerator, since it is now being used to generated
|
||||
item labels as well as tooltips;
|
||||
- there is now support for horizontal stacked 3D bar charts;
|
||||
- added support for range markers against secondary axis in a
|
||||
CategoryPlot;
|
||||
- added labels to domain and range markers;
|
||||
- added a new HistogramDataset class (contributed by Jelai Wang) to
|
||||
make it easier to create histograms with JFreeChart;
|
||||
- moved the DrawingSupplier into the plot class, renderers now
|
||||
reference the supplier from the plot (parent plot for combined and
|
||||
overlaid charts). This means that renderers now share a single
|
||||
DrawingSupplier by default, which simplifies the creation of
|
||||
combined charts;
|
||||
- changed the ColorBarAxis classes that extended the NumberAxis class,
|
||||
to a single ColorBar class that wraps a ValueAxis (may have broken
|
||||
one or two things in the process);
|
||||
- Barak Naveh has contributed new classes MatrixSeries and
|
||||
MatrixSeriesCollection, along with demos: BubblyBubblesDemo.java
|
||||
and BubblyBubblesDemo2.java;
|
||||
- the TextTitle class now has a background paint attribute;
|
||||
- the StandardLegend class now generates LegendEntity objects if a
|
||||
ChartRenderingInfo instance is supplied to the draw(...) method;
|
||||
- extended the CategoryTextAnnotation class to take into account a
|
||||
category anchor point. See the SurveyResultsDemo.java application
|
||||
for an example;
|
||||
- included numerous bug fixes;
|
||||
|
||||
0.9.8 : (24-Apr-2003)
|
||||
- changed package naming from com.jrefinery.* to org.jfree.*;
|
||||
- added new TimePeriodValuesCollection class;
|
||||
- added MIME type code to ServletUtilities class;
|
||||
- reversed the order of PieDataset and KeyedValuesDataset in
|
||||
the class hierarchy;
|
||||
- reversed the order of CategoryDataset and KeyedValues2DDataset
|
||||
in the class hierarchy;
|
||||
- minor bug fixes;
|
||||
|
||||
0.9.7 : (11-Apr-2003)
|
||||
- added a new ValueDataset interface and DefaultValueDataset
|
||||
class, and changed the CompassPlot class to use this instead
|
||||
of MeterDataset;
|
||||
- added DataUtilities class, to support creation of Pareto
|
||||
charts (new demo included);
|
||||
- updated writeImageMap method as suggested by Xavier Poinsard
|
||||
(see Feature Request 688079);
|
||||
- implemented Serializable for most classes (this is likely to
|
||||
require further testing);
|
||||
- incorporated contour plot updates from David M. O'Donnell;
|
||||
- added new CategoryTextAnnotation and XYLineAnnotation
|
||||
classes;
|
||||
- added new HorizontalCategoryAxis3D class contributed by
|
||||
Klaus Rheinwald;
|
||||
|
||||
Bug fixes:
|
||||
- added a workaround for JVM crash (a JDK bug) in pie charts
|
||||
with small sections (see bug report 620031);
|
||||
- fixed minor bug in HorizontalCategoryPlot constructor (see
|
||||
bug report 702248);
|
||||
- added code to ensure HorizontalNumberAxis3D is not drawn if
|
||||
it is not visible (see bug report 702466);
|
||||
- added small fix for suppressed chart change events (see bug
|
||||
report 690865);
|
||||
- added pieIndex parameter to tooltip and URL generators for
|
||||
pie charts;
|
||||
- fixed bug in getLastMillisecond() method for the Second
|
||||
class and the getFirstMillisecond() method for the Year
|
||||
class (picked up in JUnit tests);
|
||||
- in TextTitle, changed width used for relative spacing to fix
|
||||
bug 703050;
|
||||
|
||||
0.9.6 : (17-Feb-2003) Bug fixes:
|
||||
- fixed null pointer exception in DefaultCategoryDataset;
|
||||
- fixed update problem for PaintTable, StrokeTable and
|
||||
ShapeTable objects;
|
||||
- added methods to control colors in PiePlot (these were
|
||||
inadvertantly removed in the changes made for 0.9.5);
|
||||
- fixed auto-range update problem for secondary axis;
|
||||
- fixed missing category labels in the overlaid category plot;
|
||||
- fixed constructors for symbolic axes;
|
||||
- corrected error in Javadoc generation (Ant script);
|
||||
|
||||
0.9.5 : (6-Feb-2003) PLEASE NOTE THAT MAJOR CHANGES TO THE
|
||||
JFREECHART API HAVE BEEN MADE IN THIS RELEASE!
|
||||
|
||||
- added support for secondary axes, datasets and renderers;
|
||||
- added new data interfaces (Value, Values, Values2D,
|
||||
KeyedValues and KeyedValues2D) and incorporated these into
|
||||
the existing PieDataset and CategoryDataset interfaces.
|
||||
- modified the CategoryDataset interface to be more
|
||||
symmetrical, data is organised in rows and columns (as
|
||||
before) but can now be accessed by row/column index or
|
||||
row/column key.
|
||||
- added support for reading PieDatasets and CategoryDatasets
|
||||
from XML files.
|
||||
- created separate packages for the axes
|
||||
(com.jrefinery.chart.axis), plots (com.jrefinery.chart.plot)
|
||||
and renderers (com.jrefinery.chart.renderer).
|
||||
- series attributes (paint, outline paint, stroke and shape)
|
||||
are now controlled by the renderer classes using lookup
|
||||
tables. Introduced the DrawingSupplier interface (and
|
||||
DefaultDrawingSupplier class) which is used to populate the
|
||||
lookup tables from a common source (necessary to coordinate
|
||||
complex combined charts).
|
||||
- the chart legend can now display shapes corresponding to
|
||||
series.
|
||||
- moved responsibility for category distribution to the
|
||||
CategoryAxis class, which tidies up the code in the
|
||||
CategoryPlot classes.
|
||||
- gridlines are now controlled by the CategoryPlot and XYPlot
|
||||
classes, not the axes (included in this change is the
|
||||
addition of gridlines for the CategoryPlot domain values).
|
||||
- changed the list of titles in the JFreeChart class to a
|
||||
title and a list of subtitles.
|
||||
- added new renderers for XYPlot (XYBubbleRenderer and
|
||||
YIntervalRenderer).
|
||||
- modified Gantt chart to display sub-tasks.
|
||||
- added ContourPlot class (still experimental) by David
|
||||
M. O'Donnell.
|
||||
- introduced new MovingAverage class.
|
||||
- ChartMouseEvent now includes source chart.
|
||||
- numerous bug fixes.
|
||||
- lots of Javadoc updates.
|
||||
|
||||
0.9.4 : (18-Oct-2002) Added a new stacked area chart (contributed by Dan
|
||||
Rivett) and a compass plot (contributed by Bryan Scott). Updated
|
||||
the ThermometerPlot class. Added a new XYDotRenderer for scatter
|
||||
plots. Modified combined and overlaid plots to use the series colors
|
||||
specified in the sub plot rather than the parent plot (this makes it
|
||||
easier to align the colors in the legend). Added Regression class
|
||||
for linear and power regressions. BasicTimeSeries can now
|
||||
automatically drop "old" data. Some clean-up work in the code for
|
||||
tooltips and the event listener mechanism. Richard Atkinson has
|
||||
incorporated some useful extensions for servlets/JSP developers.
|
||||
|
||||
Ran Checkstyle and corrected issues reported for most classes.
|
||||
Checkstyle is a free utility that you can download from:
|
||||
|
||||
http://checkstyle.sourceforge.net
|
||||
|
||||
Fixed bugs and updated documentation.
|
||||
|
||||
API changes include:
|
||||
- added tickMarkPaint to Axis constructor (also affects
|
||||
subclasses);
|
||||
- added getLegendItems() to Plot, and deprecated
|
||||
getLegendItemLabels();
|
||||
- added getLegendItem(int) to XYItemRenderer and
|
||||
CategoryItemRenderer.
|
||||
- most 'protected' member variables have been changed to
|
||||
'private'.
|
||||
|
||||
0.9.3 : (4-Sep-2002) Added multiple pie charts based on
|
||||
CategoryDataset. Updated logarithmic axes. Improved URL
|
||||
support for image map generation. Moved the com.jrefinery.data
|
||||
package from JCommon to JFreeChart. Added simple framework for
|
||||
chart annotations. Improved control over renderers. Duplicate
|
||||
x-values now allowed in XYSeries. Optional category label
|
||||
skipping in category axes. Added CategoriesPaint attribute to
|
||||
AbstractCategoryItemRenderer. Added new attributes to
|
||||
MeterPlot class. Updated 3D pie chart to observe start angle
|
||||
and direction, and also foreground alpha < 1.0. Improved
|
||||
Javadoc comments. New demo applications, including:
|
||||
AnnotationDemo1, EventFrequencyDemo, JDBCCategoryChartDemo,
|
||||
JDBCPieChartDemo, JDBCXYChartDemo and MinMaxCategoryPlotDemo.
|
||||
Bug fixes:
|
||||
- negative percentages on PiePlot.
|
||||
- added listener notification to setXXXAxis(...) methods.
|
||||
- fixed DomainInfo method name clash.
|
||||
- added DomainIsPointsInTime flag to TimeSeriesCollection to
|
||||
give better control over auto range on axis for time series
|
||||
charts.
|
||||
- axis margins for date axes are no longer hard-coded.
|
||||
- fix for ordering of categories in JdbcCategoryDataset.
|
||||
- added check for null axis in mouse click handler.
|
||||
|
||||
The CVS repository at SourceForge has also been restructured
|
||||
to match the distribution directory layout.
|
||||
|
||||
0.9.2 : (28-Jun-2002) PiePlot now has startAngle and direction
|
||||
attributes. Added support for image map generation. Added a
|
||||
new Pie3DPlot class. Added label drawing code to bar
|
||||
renderers. Added optional range markers to horizontal number
|
||||
axis. Added bar clipping to avoid PRExceptions in bar
|
||||
charts. JFreeChartDemo has been modified and now includes
|
||||
examples of the dial and thermometer plots.
|
||||
Bug fixes:
|
||||
- auto range for VerticalNumberAxis when zero is forced to be
|
||||
included in the range.
|
||||
- fixed null pointer exception in StackedVerticalBarRenderer3D;
|
||||
- Added get/set methods for min/max chart drawing dimensions
|
||||
in ChartPanel;
|
||||
- HorizontalIntervalBarRenderer now handles single category;
|
||||
- verticalTickLabels now possible in HorizontalNumberAxis3D;
|
||||
- removed unnecessary imports;
|
||||
|
||||
0.9.1 : (14-Jun-2002) Bug fixes and Javadoc updates.
|
||||
- fixed auto range calculation for category plots;
|
||||
- fixed event notification for XYPlot;
|
||||
- fixed auto axis range for Gantt charts;
|
||||
- check for null popup menu in ChartPanel.mouseDragged;
|
||||
- new checks for null info in renderers;
|
||||
- range markers now drawn only if in visible axis range;
|
||||
|
||||
0.9.0 : (7-Jun-2002) New plots including an area chart, a horizontal
|
||||
3D bar chart, a Gantt chart and a thermometer chart.
|
||||
Combination plots have been reworked to provide a
|
||||
simpler framework, and extends to allow category plots to be
|
||||
combined. There is now a facility to add a ChartMouseListener
|
||||
to the ChartPanel (formerly JFreeChartPanel). An interactive
|
||||
zooming feature (experimental at this point) is now available
|
||||
for XYPlots. A new Polish translation has been added. Several
|
||||
fixes have been applied to the default tool tip generators. A
|
||||
workaround has been added to fix the alignment between time
|
||||
series charts and the date axis. There are some improvements
|
||||
to the VerticalLogarithmicAxis class, and now a corresponding
|
||||
HorizontalLogarithmicAxis class. Additional demonstration
|
||||
applications have been added. Fixed the popup menu bug.
|
||||
|
||||
0.8.1 : (5-Apr-2002) Localised resource bundles for French, German and
|
||||
Spanish languages (thanks to Anthony Boulestreau, Thomas Meier
|
||||
and Hans-Jurgen Greiner for the translations). An area XY
|
||||
plot and meter chart contributed by Hari. Symbol charts
|
||||
contributed by Anthony Boulestreau. An improved
|
||||
CandleStickRenderer class from Sylvain Vieujot. Updated
|
||||
servlet code from Bryan Scott. XYItemRenderers now have a
|
||||
change listener mechanism and therefore do not have to be
|
||||
immutable. Additional demonstration applications for
|
||||
individual chart types. Minor bug fixes.
|
||||
|
||||
0.8.0 : (22-Mar-2002) All the category plots are now controlled
|
||||
through the one class (CategoryPlot) with plug-in renderers.
|
||||
Added a ResourceBundle for user interface items that require
|
||||
localisation. Added a logarithmic axis class contributed by
|
||||
Mike Duffy and some new JDBC and servlet code contributed by
|
||||
Bryan Scott. Updated the JCommon class library to improve
|
||||
handling of time periods in different time zones.
|
||||
|
||||
0.7.4 : (6-Mar-2002) Bug fixes in the JCommon Class Library. Various
|
||||
Javadoc comment updates. Some minor changes to the
|
||||
code. Added new domain name (http://www.object-refinery.com)
|
||||
in the source headers.
|
||||
|
||||
0.7.3 : (14-Feb-2002) Bug fixes.
|
||||
|
||||
0.7.2 : (8-Feb-2002) Integrated the WindPlot code from Achilleus
|
||||
Mantzios. Added an optional background image for the
|
||||
JFreeChart class, and another optional background image for
|
||||
the Plot class. Added alpha-transparency for the plot
|
||||
foreground and background. Added new pie chart label types
|
||||
that show values. Fixed a bug with the legend that results in
|
||||
a loop at small chart sizes. Added some tooltip methods that
|
||||
were missing from the previous version. Changed the Insets
|
||||
class on chart titles to a new Spacer class that will allow
|
||||
for relative or absolute insets (the plan is to eventually
|
||||
replace all Insets in the JFreeChart classes). Fixed a bug in
|
||||
the setAutoRangeIncludesZero method of the NumberAxis class.
|
||||
Added the instructions that were missing from the copies of
|
||||
the GNU Lesser General Public Licence included with JFreeChart.
|
||||
|
||||
0.7.1 : (25-Jan-2002) Added tooltips, crosshairs and zooming
|
||||
functions, thanks to Jonathan Nash and Hans-Jurgen Greiner
|
||||
for contributing the code that these features are based on.
|
||||
Moved the combination charts into the package
|
||||
com.jrefinery.chart.combination, made a number of other small
|
||||
API changes and fixed some bugs. Removed the Javadoc HTML
|
||||
from the download to save space (you can regenerate it from
|
||||
the source code if you need it).
|
||||
|
||||
0.7.0 : (11-Dec-2001) New combination plots developed by Bill
|
||||
Kelemen. Added Wolfgang Irler's servlet demo to the standard
|
||||
download. The About window in the demo application now
|
||||
includes a list of developers that have contributed to the
|
||||
project.
|
||||
|
||||
0.6.0 : (27-Nov-2001) New plots including scatter plot, stacked bar
|
||||
charts and 3D bar charts. Improved pie chart. Data
|
||||
interfaces and classes moved to the JCommon class library.
|
||||
New properties to control spacing on bar charts. New
|
||||
auto-tick mechanism. JFreeChartPanel now incorporates
|
||||
buffering, and popup menu. Javadocs revised. Fixed numerous
|
||||
bugs from version 0.5.6. Demo application updated.
|
||||
|
||||
----------------
|
||||
10. CONTRIBUTORS
|
||||
----------------
|
||||
JFreeChart wouldn't be half the library that it is today without the
|
||||
contributions (large and small) that have been made by the developers listed
|
||||
below:
|
||||
|
||||
- Eric Alexander
|
||||
- Richard Atkinson
|
||||
- David Basten
|
||||
- David Berry
|
||||
- Chris Boek
|
||||
- Zoheb Borbora
|
||||
- Anthony Boulestreau
|
||||
- Jeremy Bowman
|
||||
- Nicolas Brodu
|
||||
- Jody Brownell
|
||||
- David Browning
|
||||
- Soren Caspersen
|
||||
- Thomas A Caswell
|
||||
- Chuanhao Chiu
|
||||
- Brian Cole
|
||||
- Pascal Collet
|
||||
- Martin Cordova
|
||||
- Paolo Cova
|
||||
- Greg Darke
|
||||
- Mike Duffy
|
||||
- Don Elliott
|
||||
- Rune Fauske
|
||||
- Jonathan Gabbai
|
||||
- Serge V. Grachov
|
||||
- Daniel Gredler
|
||||
- Joao Guilherme Del Valle
|
||||
- Hans-Jurgen Greiner
|
||||
- Nick Guenther
|
||||
- Aiman Han
|
||||
- Cameron Hayne
|
||||
- Martin Hoeller (xS+S)
|
||||
- Jon Iles
|
||||
- Wolfgang Irler
|
||||
- Sergei Ivanov
|
||||
- Nina Jeliazkova
|
||||
- Adriaan Joubert
|
||||
- Darren Jung
|
||||
- Xun Kang
|
||||
- Bill Kelemen
|
||||
- Norbert Kiesel
|
||||
- Petr Kopac
|
||||
- Gideon Krause
|
||||
- Dave Law;
|
||||
- Pierre-Marie Le Biot
|
||||
- Arnaud Lelievre
|
||||
- Wolfgang Lenhard
|
||||
- Leo Leung
|
||||
- David Li
|
||||
- Yan Liu
|
||||
- Tin Luu
|
||||
- Craig MacFarlane
|
||||
- Achilleus Mantzios
|
||||
- Thomas Meier
|
||||
- Jim Moore
|
||||
- Jonathan Nash
|
||||
- Barak Naveh
|
||||
- David M. O'Donnell
|
||||
- Krzysztof Paz
|
||||
- Eric Penfold
|
||||
- Tomer Peretz
|
||||
- Xavier Poinsard
|
||||
- Andrzej Porebski
|
||||
- Viktor Rajewski
|
||||
- Eduardo Ramalho
|
||||
- Michael Rauch
|
||||
- Cameron Riley
|
||||
- Klaus Rheinwald
|
||||
- Dan Rivett
|
||||
- Scott Sams
|
||||
- Michel Santos
|
||||
- Thierry Saura
|
||||
- Patrick Schlott
|
||||
- Andreas Schneider
|
||||
- Christoph Schroeder
|
||||
- Jean-Luc SCHWAB
|
||||
- Bryan Scott
|
||||
- Tobias Selb
|
||||
- Darshan Shah
|
||||
- Mofeed Shahin
|
||||
- Michael Siemer
|
||||
- Pady Srinivasan
|
||||
- Greg Steckman
|
||||
- Roger Studner
|
||||
- Gerald Struck
|
||||
- Irv Thomae
|
||||
- Eric Thomas
|
||||
- Rich Unger
|
||||
- Daniel van Enckevort
|
||||
- Laurence Vanhelsuwe
|
||||
- Sylvain Vieujot
|
||||
- Jelai Wang
|
||||
- Mark Watson
|
||||
- Alex Weber
|
||||
- Richard West
|
||||
- Matthew Wright
|
||||
- Benoit Xhenseval
|
||||
- Christian W. Zuckschwerdt
|
||||
- Hari
|
||||
- Sam (oldman)
|
||||
|
||||
It is possible that I have missed someone on this list, if that
|
||||
applies to you, please e-mail me.
|
||||
|
||||
Dave Gilbert (david.gilbert@object-refinery.com)
|
||||
JFreeChart Project Leader
|
||||
@@ -0,0 +1,87 @@
|
||||
<project name="jfreechart-swt" default="all" basedir="..">
|
||||
|
||||
<!-- Initialisation. -->
|
||||
<target name="initialise" description="Initialise required settings.">
|
||||
<tstamp />
|
||||
<property name="jfreechart.name" value="jfreechart" />
|
||||
<property name="jfreechart.version" value="1.0.17" />
|
||||
<property name="jcommon.name" value="jcommon" />
|
||||
<property name="jcommon.version" value="1.0.21" />
|
||||
<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"/>
|
||||
<!-- Edit the next line to link to the swt library you want, see README file in the swt folder -->
|
||||
<property name="swt.jar" value="/Users/dgilbert/swt-4/swt.jar"/>
|
||||
<path id="build.classpath">
|
||||
<pathelement location="${jcommon.jar}"/>
|
||||
<pathelement location="${jfreechart.jar}"/>
|
||||
<pathelement location="${swt.jar}"/>
|
||||
</path>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Compile the JFreeChart SWT classes -->
|
||||
<target name="compile-swtgraphics" depends="initialise"
|
||||
description="Compile and package some utility SWT source code.">
|
||||
|
||||
<!-- create a temp build directory -->
|
||||
<mkdir dir="${basedir}/build" />
|
||||
|
||||
<!-- compile the source -->
|
||||
<javac srcdir="${basedir}/swt"
|
||||
destdir="${basedir}/build"
|
||||
debug="on"
|
||||
deprecation="on"
|
||||
source="1.6"
|
||||
target="1.6">
|
||||
<classpath refid="build.classpath" />
|
||||
<include name="org/jfree/experimental/swt/**/*.java"/>
|
||||
</javac>
|
||||
|
||||
<!-- make the jar -->
|
||||
<jar jarfile="${basedir}/lib/swtgraphics2d.jar"
|
||||
basedir="${basedir}/build" >
|
||||
</jar>
|
||||
|
||||
<!-- delete the temp directory -->
|
||||
<delete dir="${basedir}/build" />
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Compile the JFreeChart SWT classes -->
|
||||
<target name="compile-swt" depends="initialise"
|
||||
description="Compile and package the JFreeChart SWT source code.">
|
||||
|
||||
<!-- create a temp build directory -->
|
||||
<mkdir dir="${basedir}/build" />
|
||||
|
||||
<!-- compile the source -->
|
||||
<javac srcdir="${basedir}/swt"
|
||||
destdir="${basedir}/build"
|
||||
debug="on"
|
||||
deprecation="on"
|
||||
source="1.6"
|
||||
target="1.6">
|
||||
<classpath refid="build.classpath" />
|
||||
<include name="org/jfree/experimental/chart/**/*.java"/>
|
||||
</javac>
|
||||
|
||||
<!-- make the jar -->
|
||||
<jar jarfile="${basedir}/lib/${jfreechart.name}-${jfreechart.version}-swt.jar"
|
||||
basedir="${basedir}/build" >
|
||||
</jar>
|
||||
|
||||
<!-- delete the temp directory -->
|
||||
<delete dir="${basedir}/build" />
|
||||
|
||||
</target>
|
||||
|
||||
<!-- ALL -->
|
||||
<target name="all"
|
||||
depends="compile-swtgraphics,compile-swt"
|
||||
description="Compiles and package in jar files all the SWT related code in JFreeChart.">
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,391 @@
|
||||
<!-- An ANT build file for JFreeChart -->
|
||||
|
||||
<!-- Written by David Gilbert. -->
|
||||
|
||||
<!-- Tested recently with Ant 1.8.2 -->
|
||||
<!-- To run this script, you need to make sure the libraries used by -->
|
||||
<!-- JFreeChart are copied to the ../lib directory (or edit the -->
|
||||
<!-- initialise task to point to the appropriate jar files). -->
|
||||
|
||||
<!-- This script will create temporary directories ../build and -->
|
||||
<!-- ../distribution, as working areas. A ../javadoc directory will -->
|
||||
<!-- be created for the Javadoc HTML pages. -->
|
||||
|
||||
<!-- If you have comments about this script, please post a message -->
|
||||
<!-- on the JFreeChart developers mailing list. -->
|
||||
|
||||
<project name="jfreechart" default="all" basedir="..">
|
||||
|
||||
<!-- Initialisation. -->
|
||||
<target name="initialise" description="Initialise required settings.">
|
||||
<tstamp />
|
||||
<property name="jfreechart.name" value="jfreechart" />
|
||||
<property name="jfreechart.version" value="1.0.17" />
|
||||
<property name="jfreechart-bundle-file" value="${jfreechart.name}-${jfreechart.version}-bundle.jar" />
|
||||
<property name="jcommon.name" value="jcommon" />
|
||||
<property name="jcommon.version" value="1.0.21" />
|
||||
<property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/>
|
||||
<property name="jfreesvg.name" value="jfreesvg" />
|
||||
<property name="jfreesvg.version" value="1.4" />
|
||||
<property name="orsonpdf.name" value="orsonpdf" />
|
||||
<property name="orsonpdf.version" value="1.3-eval" />
|
||||
<property name="orsoncharts.version" value="1.0-eval" />
|
||||
<property name="builddir" value="${basedir}/build" />
|
||||
<property name="servlet.jar" value="${basedir}/lib/servlet.jar"/>
|
||||
<property name="junit.jar" value="${basedir}/lib/junit-4.11.jar"/>
|
||||
<property name="hamcrest.jar" value="${basedir}/lib/hamcrest-core-1.3.jar"/>
|
||||
<property name="src.version" value="1.6"/>
|
||||
<property name="target.version" value="1.6"/>
|
||||
<path id="build.classpath">
|
||||
<fileset dir="${basedir}/lib/">
|
||||
<include name="${jcommon.name}-${jcommon.version}.jar"/>
|
||||
<include name="servlet.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Compile the JFreeChart classes -->
|
||||
<target name="compile" depends="initialise"
|
||||
description="Compile the JFreeChart source code.">
|
||||
|
||||
<!-- create a temp build directory -->
|
||||
<mkdir dir="${basedir}/build" />
|
||||
|
||||
<!-- compile the source -->
|
||||
<javac srcdir="${basedir}/source"
|
||||
destdir="${basedir}/build"
|
||||
debug="on"
|
||||
deprecation="false"
|
||||
source="${src.version}"
|
||||
target="${target.version}">
|
||||
<classpath refid="build.classpath" />
|
||||
<include name="org/jfree/**"/>
|
||||
<exclude name="org/jfree/chart/xml/**"/>
|
||||
</javac>
|
||||
|
||||
<!-- copy across gorilla.jpg -->
|
||||
<copy file="${basedir}/source/org/jfree/chart/gorilla.jpg" tofile="${basedir}/build/org/jfree/chart/gorilla.jpg" />
|
||||
|
||||
<!-- copy across .properties files -->
|
||||
<copy todir="${basedir}/build/org/jfree/chart/">
|
||||
<fileset dir="${basedir}/source/org/jfree/chart">
|
||||
<include name="*.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${basedir}/build/org/jfree/chart/plot">
|
||||
<fileset dir="${basedir}/source/org/jfree/chart/plot">
|
||||
<include name="*.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${basedir}/build/org/jfree/chart/editor">
|
||||
<fileset dir="${basedir}/source/org/jfree/chart/editor">
|
||||
<include name="*.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- make the jar -->
|
||||
<jar jarfile="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar"
|
||||
basedir="${basedir}/build" >
|
||||
<manifest>
|
||||
<attribute name="Specification-Title" value="JFreeChart" />
|
||||
<attribute name="Specification-Version" value="${jfreechart.version}" />
|
||||
<attribute name="Specification-Vendor" value="jfree.org" />
|
||||
<attribute name="Implementation-Title" value="JFreeChart" />
|
||||
<attribute name="Implementation-Version" value="${jfreechart.version}" />
|
||||
<attribute name="Implementation-Vendor" value="jfree.org" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<!-- delete the temp directory -->
|
||||
<delete dir="${basedir}/build" />
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<!-- Compile the experimental classes -->
|
||||
<target name="compile-experimental" depends="compile"
|
||||
description="Compile the JFreeChart experimental classes">
|
||||
|
||||
<!-- create a temp build directory -->
|
||||
<mkdir dir="${basedir}/build" />
|
||||
|
||||
<path id="build.experimental.classpath">
|
||||
<pathelement location="${jcommon.jar}"/>
|
||||
<pathelement location="${servlet.jar}"/>
|
||||
<pathelement location="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar"/>
|
||||
</path>
|
||||
|
||||
<!-- compile the source -->
|
||||
<javac srcdir="${basedir}/experimental"
|
||||
destdir="${basedir}/build"
|
||||
debug="on"
|
||||
deprecation="false"
|
||||
source="${src.version}"
|
||||
target="${target.version}">
|
||||
<classpath refid="build.experimental.classpath" />
|
||||
<include name="org/jfree/experimental/**"/>
|
||||
<exclude name="org/jfree/experimental/**/junit/*"/>
|
||||
</javac>
|
||||
|
||||
<!-- make the jar -->
|
||||
<jar jarfile="${basedir}/lib/${jfreechart.name}-${jfreechart.version}-experimental.jar"
|
||||
basedir="${basedir}/build" >
|
||||
</jar>
|
||||
|
||||
<!-- delete the temp directory -->
|
||||
<delete dir="${basedir}/build" />
|
||||
</target>
|
||||
|
||||
|
||||
<!-- Generate the JFreeChart API HTML pages -->
|
||||
<target name="javadoc"
|
||||
description="Generate the Javadoc HTML pages."
|
||||
depends="initialise">
|
||||
<delete dir="${basedir}/javadoc" />
|
||||
<mkdir dir="${basedir}/javadoc" />
|
||||
<javadoc destdir="${basedir}/javadoc"
|
||||
windowtitle="JFreeChart Class Library (version ${jfreechart.version})"
|
||||
overview="${basedir}/source/overview.html"
|
||||
use="yes"
|
||||
linksource="yes"
|
||||
splitindex="yes">
|
||||
<classpath refid="build.classpath" />
|
||||
<packageset dir="${basedir}/source" defaultexcludes="yes">
|
||||
<include name="org/jfree/**"/>
|
||||
<exclude name="org/jfree/chart/xml/**"/>
|
||||
</packageset>
|
||||
</javadoc>
|
||||
<!-- copy across .png files -->
|
||||
<copy todir="${basedir}/javadoc/images">
|
||||
<fileset dir="${basedir}/docfiles">
|
||||
<include name="*.png" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- Create zip file containing the API HTML pages. -->
|
||||
<target name="zip-javadocs"
|
||||
description="Create ZIP file containing Javadoc HTML pages."
|
||||
depends="javadoc">
|
||||
<!-- make the zip file -->
|
||||
<zip zipfile="${basedir}/${jfreechart.name}-${jfreechart.version}-javadocs.zip">
|
||||
<zipfileset dir="${basedir}/javadoc"
|
||||
prefix="${jfreechart.name}-${jfreechart.version}-javadocs" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- Fill the 'distribution' directory. -->
|
||||
<target name="fill-distribution" depends="compile">
|
||||
|
||||
<!-- delete the temporary distribution directory, if there is one -->
|
||||
<delete dir="${basedir}/distribution" />
|
||||
|
||||
<!-- make a temporary distribution directory -->
|
||||
<mkdir dir="${basedir}/distribution" />
|
||||
|
||||
<!-- copy across README and CHANGELOG -->
|
||||
<copy file="${basedir}/README.txt" tofile="${basedir}/distribution/README.txt" />
|
||||
<copy file="${basedir}/NEWS" tofile="${basedir}/distribution/NEWS" />
|
||||
<copy file="${basedir}/ChangeLog" tofile="${basedir}/distribution/ChangeLog" />
|
||||
<copy file="${basedir}/pom.xml" tofile="${basedir}/distribution/pom.xml" />
|
||||
|
||||
<!-- copy across LICENCE -->
|
||||
<copy file="${basedir}/licence-LGPL.txt" tofile="${basedir}/distribution/licence-LGPL.txt" />
|
||||
|
||||
<!-- copy across runtime jar file and demo jar file -->
|
||||
<copy file="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar" tofile="${basedir}/distribution/lib/${jfreechart.name}-${jfreechart.version}.jar" />
|
||||
<copy file="${basedir}/lib/${jfreechart.name}-${jfreechart.version}-experimental.jar" tofile="${basedir}/distribution/lib/${jfreechart.name}-${jfreechart.version}-experimental.jar" />
|
||||
<copy file="${basedir}/${jfreechart.name}-${jfreechart.version}-demo.jar" tofile="${basedir}/distribution/${jfreechart.name}-${jfreechart.version}-demo.jar" failonerror="false" />
|
||||
|
||||
<!-- copy across source files -->
|
||||
<copy todir="${basedir}/distribution/source">
|
||||
<fileset dir="${basedir}/source">
|
||||
<exclude name="**/CVS/*"/>
|
||||
<exclude name="org/jfree/chart/xml/**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/distribution/experimental">
|
||||
<fileset dir="${basedir}/experimental">
|
||||
<exclude name="**/CVS/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/distribution/tests">
|
||||
<fileset dir="${basedir}/tests">
|
||||
<exclude name="**/CVS/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/distribution/swt">
|
||||
<fileset dir="${basedir}/swt">
|
||||
<exclude name="**/CVS/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/distribution/docfiles">
|
||||
<fileset dir="${basedir}/docfiles">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- copy across lib files -->
|
||||
<copy file="${jcommon.jar}" tofile="${basedir}/distribution/lib/${jcommon.name}-${jcommon.version}.jar" />
|
||||
<copy file="${basedir}/lib/swtgraphics2d.jar" tofile="${basedir}/distribution/lib/swtgraphics2d.jar" failonerror="false" />
|
||||
<copy file="${basedir}/lib/jfreechart-${jfreechart.version}-swt.jar" tofile="${basedir}/distribution/lib/${jfreechart.name}-${jfreechart.version}-swt.jar" failonerror="false" />
|
||||
<copy file="${servlet.jar}" tofile="${basedir}/distribution/lib/servlet.jar" />
|
||||
<copy file="${junit.jar}" tofile="${basedir}/distribution/lib/junit-4.11.jar" />
|
||||
<copy file="${hamcrest.jar}" tofile="${basedir}/distribution/lib/hamcrest-core-1.3.jar" />
|
||||
<copy file="${basedir}/lib/${jfreesvg.name}-${jfreesvg.version}.jar" tofile="${basedir}/distribution/lib/${jfreesvg.name}-${jfreesvg.version}.jar" />
|
||||
<copy file="${basedir}/lib/${orsonpdf.name}-${orsonpdf.version}.jar" tofile="${basedir}/distribution/lib/${orsonpdf.name}-${orsonpdf.version}.jar" />
|
||||
<copy file="${basedir}/lib/orsoncharts-${orsoncharts.version}.jar" tofile="${basedir}/distribution/lib/orsoncharts-${orsoncharts.version}.jar" failonerror="false" />
|
||||
|
||||
<!-- copy across ant build files -->
|
||||
<copy file="${basedir}/ant/build.xml" tofile="${basedir}/distribution/ant/build.xml" />
|
||||
<copy file="${basedir}/ant/build-swt.xml" tofile="${basedir}/distribution/ant/build-swt.xml" />
|
||||
|
||||
<!-- copy across checkstyle property file -->
|
||||
<copy todir="${basedir}/distribution/checkstyle">
|
||||
<fileset dir="${basedir}/checkstyle" />
|
||||
</copy>
|
||||
|
||||
<!-- convert end-of-line characters in text files -->
|
||||
<fixcrlf srcdir="${basedir}/distribution/source"
|
||||
eol="crlf" eof="remove"
|
||||
excludes="**/*.jpg" />
|
||||
|
||||
<fixcrlf srcdir="${basedir}/distribution/experimental"
|
||||
eol="lf" eof="remove"
|
||||
excludes="**/*.jpg" />
|
||||
|
||||
<fixcrlf srcdir="${basedir}/distribution/swt"
|
||||
eol="lf" eof="remove"
|
||||
excludes="**/*.jpg" />
|
||||
|
||||
<fixcrlf srcdir="${basedir}/distribution/tests"
|
||||
eol="lf" eof="remove"
|
||||
excludes="**/*.jpg" />
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Make .zip distribution for JFreeChart -->
|
||||
<target name="zip" depends="fill-distribution">
|
||||
|
||||
<!-- make the zip file -->
|
||||
<zip zipfile="${basedir}/${jfreechart.name}-${jfreechart.version}.zip">
|
||||
<zipfileset dir="${basedir}/distribution"
|
||||
prefix="${jfreechart.name}-${jfreechart.version}" />
|
||||
</zip>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Make .tar.gz distribution for JFreeChart -->
|
||||
<target name="targz" depends="fill-distribution">
|
||||
|
||||
<!-- make the tar.gz file -->
|
||||
<tar tarfile="${basedir}/${jfreechart.name}-${jfreechart.version}.tar">
|
||||
<tarfileset dir="${basedir}/distribution"
|
||||
prefix="${jfreechart.name}-${jfreechart.version}" />
|
||||
</tar>
|
||||
<gzip zipfile="${basedir}/${jfreechart.name}-${jfreechart.version}.tar.gz"
|
||||
src="${basedir}/${jfreechart.name}-${jfreechart.version}.tar" />
|
||||
<delete file="${basedir}/${jfreechart.name}-${jfreechart.version}.tar" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="maven-bundle" depends="zip" >
|
||||
<!-- make a temporary distribution directory -->
|
||||
<mkdir dir="distribution"/>
|
||||
<!-- copy across LICENCE -->
|
||||
<copy file="licence-LGPL.txt" tofile="distribution/LICENSE.txt"/>
|
||||
|
||||
<filterchain id="version.filters">
|
||||
<replacetokens>
|
||||
<token key="VERSION" value="${jfreechart.version}"/>
|
||||
<token key="JCOMMON.VERSION" value="${jcommon.version}"/>
|
||||
</replacetokens>
|
||||
</filterchain>
|
||||
<copy file="pom.xml" tofile="distribution/pom.xml">
|
||||
<filterchain refid="version.filters"/>
|
||||
</copy>
|
||||
|
||||
<!-- copy across runtime jar file -->
|
||||
<copy file="lib/${jfreechart.name}-${jfreechart.version}.jar" tofile="distribution/${jfreechart.name}-${jfreechart.version}.jar"/>
|
||||
|
||||
<!-- make the jar -->
|
||||
<jar jarfile="${jfreechart-bundle-file}" basedir="distribution"/>
|
||||
|
||||
<!-- delete the temporary distribution directory -->
|
||||
<delete dir="distribution"/>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- COMPILE THE JUNIT TESTS. -->
|
||||
<target name="compile-tests"
|
||||
depends="compile,compile-experimental"
|
||||
description="Compile the test code">
|
||||
|
||||
<mkdir dir="${basedir}/build-tests"/>
|
||||
<javac srcdir="${basedir}/tests"
|
||||
destdir="${basedir}/build-tests"
|
||||
source="1.6"
|
||||
target="1.6"
|
||||
debug="true"
|
||||
deprecation="false"
|
||||
optimize="false">
|
||||
<classpath>
|
||||
<path refid="build.classpath"/>
|
||||
<pathelement location="${junit.jar}"/>
|
||||
<pathelement location="${hamcrest.jar}"/>
|
||||
<pathelement location="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar"/>
|
||||
<pathelement location="${basedir}/lib/${jfreechart.name}-${jfreechart.version}-experimental.jar"/>
|
||||
<pathelement location="${basedir}/build-tests"/>
|
||||
</classpath>
|
||||
</javac>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<!-- RUN THE JUNIT TESTS. -->
|
||||
<target name="test"
|
||||
depends="compile-tests"
|
||||
description="Run the test cases">
|
||||
|
||||
<mkdir dir="${basedir}/build-tests-reports"/>
|
||||
|
||||
<junit printSummary="yes"
|
||||
haltonerror="false"
|
||||
haltonfailure="false"
|
||||
fork="false"
|
||||
dir=".">
|
||||
|
||||
<sysproperty key="basedir" value="."/>
|
||||
<formatter type="plain" usefile="false"/>
|
||||
<classpath>
|
||||
<path refid="build.classpath"/>
|
||||
<pathelement location="${junit.jar}"/>
|
||||
<pathelement location="${hamcrest.jar}"/>
|
||||
<pathelement location="${basedir}/lib/${jfreechart.name}-${jfreechart.version}.jar"/>
|
||||
<pathelement location="${basedir}/lib/${jfreechart.name}-${jfreechart.version}-experimental.jar"/>
|
||||
<pathelement location="${basedir}/build-tests"/>
|
||||
</classpath>
|
||||
<batchtest todir="${basedir}/build-tests-reports">
|
||||
<fileset dir="${basedir}/tests">
|
||||
<include name="**/*Test.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
</target>
|
||||
|
||||
<!-- ALL -->
|
||||
<target name="all"
|
||||
depends="compile,compile-experimental,zip-javadocs,zip,targz,maven-bundle"
|
||||
description="Compiles JFreeChart, builds the jar files, generates the Javadoc HTML pages and creates distribution files (.zip and .tar.gz).">
|
||||
|
||||
<!-- delete the temporary distribution directory -->
|
||||
<delete dir="${basedir}/distribution" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Checkstyle configuration for checking Javadocs
|
||||
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
|
||||
<!-- Checks that a package.html file exists for each package. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
|
||||
<module name="PackageHtml"/>
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
||||
<module name="JavadocMethod"/>
|
||||
<module name="JavadocType"/>
|
||||
<module name="JavadocVariable"/>
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
|
||||
|
||||
<!--
|
||||
Just the whitespace checks...
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
|
||||
|
||||
<!-- Checks whether files end with a new line. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
||||
<!-- <module name="NewlineAtEndOfFile"/> -->
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
||||
<module name="LineLength">
|
||||
<property name="max" value="80"/>
|
||||
</module>
|
||||
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
@@ -0,0 +1,6 @@
|
||||
checkstyle.allow.tabs no
|
||||
checkstyle.maxlinelen 100
|
||||
checkstyle.maxparameters 20
|
||||
checkstyle.rcurly alone
|
||||
checkstyle.ignore.public.in.interface yes
|
||||
checkstyle.javadoc.checkUnusedThrows yes
|
||||
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Checkstyle configuration that checks the sun coding conventions from:
|
||||
|
||||
- the Java Language Specification at
|
||||
http://java.sun.com/docs/books/jls/second_edition/html/index.html
|
||||
|
||||
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
|
||||
|
||||
- the Javadoc guidelines at
|
||||
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
|
||||
|
||||
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
|
||||
|
||||
- some best practices
|
||||
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
http://checkstyle.sf.net (or in your downloaded distribution).
|
||||
|
||||
Most Checks are configurable, be sure to consult the documentation.
|
||||
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
|
||||
Finally, it is worth reading the documentation.
|
||||
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
|
||||
<!-- Checks that a package.html file exists for each package. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
|
||||
<module name="PackageHtml"/>
|
||||
|
||||
<!-- Checks whether files end with a new line. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
||||
<!-- <module name="NewlineAtEndOfFile"/> -->
|
||||
|
||||
<!-- Checks that property files contain the same keys. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
|
||||
<module name="Translation"/>
|
||||
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
||||
<module name="JavadocMethod"/>
|
||||
<module name="JavadocType"/>
|
||||
<module name="JavadocVariable"/>
|
||||
|
||||
|
||||
<!-- Checks for Naming Conventions. -->
|
||||
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
||||
<module name="ConstantName"/>
|
||||
<module name="LocalFinalVariableName"/>
|
||||
<module name="LocalVariableName"/>
|
||||
<module name="MemberName"/>
|
||||
<module name="MethodName"/>
|
||||
<module name="PackageName"/>
|
||||
<module name="ParameterName"/>
|
||||
<module name="StaticVariableName"/>
|
||||
<module name="TypeName"/>
|
||||
|
||||
|
||||
<!-- Checks for Headers -->
|
||||
<!-- See http://checkstyle.sf.net/config_header.html -->
|
||||
<!-- <module name="Header"> -->
|
||||
<!-- The follow property value demonstrates the ability -->
|
||||
<!-- to have access to ANT properties. In this case it uses -->
|
||||
<!-- the ${basedir} property to allow Checkstyle to be run -->
|
||||
<!-- from any directory within a project. -->
|
||||
<!-- <property name="headerFile" value="${basedir}/java.header"/> -->
|
||||
<!-- </module> -->
|
||||
|
||||
<!-- Following interprets the header file as regular expressions. -->
|
||||
<!-- <module name="RegexpHeader"/> -->
|
||||
|
||||
|
||||
<!-- Checks for imports -->
|
||||
<!-- See http://checkstyle.sf.net/config_import.html -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
||||
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
||||
<!-- <module name="FileLength"/> -->
|
||||
<module name="LineLength">
|
||||
<property name="max" value="80"/>
|
||||
</module>
|
||||
<!-- <module name="MethodLength"/> -->
|
||||
<module name="ParameterNumber">
|
||||
<property name="max" value="12"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="EmptyForIteratorPad"/>
|
||||
<module name="NoWhitespaceAfter"/>
|
||||
<module name="NoWhitespaceBefore"/>
|
||||
<module name="OperatorWrap"/>
|
||||
<module name="ParenPad"/>
|
||||
<module name="TabCharacter"/>
|
||||
<module name="WhitespaceAfter"/>
|
||||
<module name="WhitespaceAround"/>
|
||||
|
||||
|
||||
<!-- Modifier Checks -->
|
||||
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
||||
<module name="ModifierOrder"/>
|
||||
<!-- <module name="RedundantModifier"/> -->
|
||||
|
||||
|
||||
<!-- Checks for blocks. You know, those {}'s -->
|
||||
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
||||
<module name="AvoidNestedBlocks"/>
|
||||
<module name="EmptyBlock"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="RightCurly">
|
||||
<property name="option" value="alone"/>
|
||||
</module>
|
||||
|
||||
|
||||
<!-- Checks for common coding problems -->
|
||||
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
||||
<!-- <module name="AvoidInlineConditionals"/> -->
|
||||
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
|
||||
<module name="EmptyStatement"/>
|
||||
<!-- <module name="EqualsHashCode"/> -->
|
||||
<module name="HiddenField">
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
</module>
|
||||
<module name="IllegalInstantiation"/>
|
||||
<module name="InnerAssignment"/>
|
||||
<!-- <module name="MagicNumber"/> -->
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="RedundantThrows"/>
|
||||
<module name="SimplifyBooleanExpression"/>
|
||||
<module name="SimplifyBooleanReturn"/>
|
||||
|
||||
<!-- Checks for class design -->
|
||||
<!-- See http://checkstyle.sf.net/config_design.html -->
|
||||
<!--<module name="DesignForExtension"/> -->
|
||||
<module name="FinalClass"/>
|
||||
<module name="HideUtilityClassConstructor"/>
|
||||
<module name="InterfaceIsType"/>
|
||||
<module name="VisibilityModifier"/>
|
||||
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<!-- <module name="FinalParameters"/> -->
|
||||
<!-- <module name="GenericIllegalRegexp"> -->
|
||||
<!-- <property name="format" value="\s+$"/> -->
|
||||
<!-- <property name="message" value="Line has trailing spaces."/> -->
|
||||
<!-- </module> -->
|
||||
<module name="TodoComment"/>
|
||||
<module name="UpperEll"/>
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
|
||||
|
||||
<!--
|
||||
Just the whitespace checks...
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
|
||||
|
||||
<!-- Checks whether files end with a new line. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
||||
<!-- <module name="NewlineAtEndOfFile"/> -->
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="EmptyForIteratorPad"/>
|
||||
<module name="NoWhitespaceAfter"/>
|
||||
<module name="NoWhitespaceBefore"/>
|
||||
<module name="OperatorWrap"/>
|
||||
<module name="ParenPad"/>
|
||||
<module name="TabCharacter"/>
|
||||
<module name="WhitespaceAfter"/>
|
||||
<module name="WhitespaceAround"/>
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,223 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ------------------------------
|
||||
* CombinedCategoryPlotDemo1.java
|
||||
* ------------------------------
|
||||
* (C) Copyright 2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): ;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.demo;
|
||||
|
||||
import java.awt.Font;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.CategoryAxis;
|
||||
import org.jfree.chart.axis.NumberAxis;
|
||||
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.renderer.category.BarRenderer;
|
||||
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
|
||||
import org.jfree.data.category.CategoryDataset;
|
||||
import org.jfree.data.category.DefaultCategoryDataset;
|
||||
import org.jfree.experimental.chart.plot.CombinedCategoryPlot;
|
||||
import org.jfree.ui.ApplicationFrame;
|
||||
import org.jfree.ui.RefineryUtilities;
|
||||
|
||||
/**
|
||||
* A demo for the {@link CombinedCategoryPlot} class.
|
||||
*/
|
||||
public class CombinedCategoryPlotDemo1 extends ApplicationFrame {
|
||||
|
||||
/**
|
||||
* Creates a new demo instance.
|
||||
*
|
||||
* @param title the frame title.
|
||||
*/
|
||||
public CombinedCategoryPlotDemo1(String title) {
|
||||
super(title);
|
||||
JPanel chartPanel = createDemoPanel();
|
||||
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
|
||||
setContentPane(chartPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dataset.
|
||||
*
|
||||
* @return A dataset.
|
||||
*/
|
||||
public static CategoryDataset createDataset1() {
|
||||
DefaultCategoryDataset result = new DefaultCategoryDataset();
|
||||
String series1 = "First";
|
||||
String series2 = "Second";
|
||||
String type1 = "Type 1";
|
||||
String type2 = "Type 2";
|
||||
String type3 = "Type 3";
|
||||
String type4 = "Type 4";
|
||||
String type5 = "Type 5";
|
||||
String type6 = "Type 6";
|
||||
String type7 = "Type 7";
|
||||
String type8 = "Type 8";
|
||||
|
||||
result.addValue(1.0, series1, type1);
|
||||
result.addValue(4.0, series1, type2);
|
||||
result.addValue(3.0, series1, type3);
|
||||
result.addValue(5.0, series1, type4);
|
||||
result.addValue(5.0, series1, type5);
|
||||
result.addValue(7.0, series1, type6);
|
||||
result.addValue(7.0, series1, type7);
|
||||
result.addValue(8.0, series1, type8);
|
||||
|
||||
result.addValue(5.0, series2, type1);
|
||||
result.addValue(7.0, series2, type2);
|
||||
result.addValue(6.0, series2, type3);
|
||||
result.addValue(8.0, series2, type4);
|
||||
result.addValue(4.0, series2, type5);
|
||||
result.addValue(4.0, series2, type6);
|
||||
result.addValue(2.0, series2, type7);
|
||||
result.addValue(1.0, series2, type8);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dataset.
|
||||
*
|
||||
* @return A dataset.
|
||||
*/
|
||||
public static CategoryDataset createDataset2() {
|
||||
|
||||
DefaultCategoryDataset result = new DefaultCategoryDataset();
|
||||
|
||||
String series1 = "Third";
|
||||
String series2 = "Fourth";
|
||||
|
||||
String type1 = "Type 1";
|
||||
String type2 = "Type 2";
|
||||
String type3 = "Type 3";
|
||||
String type4 = "Type 4";
|
||||
String type5 = "Type 5";
|
||||
String type6 = "Type 6";
|
||||
String type7 = "Type 7";
|
||||
String type8 = "Type 8";
|
||||
|
||||
result.addValue(11.0, series1, type1);
|
||||
result.addValue(14.0, series1, type2);
|
||||
result.addValue(13.0, series1, type3);
|
||||
result.addValue(15.0, series1, type4);
|
||||
result.addValue(15.0, series1, type5);
|
||||
result.addValue(17.0, series1, type6);
|
||||
result.addValue(17.0, series1, type7);
|
||||
result.addValue(18.0, series1, type8);
|
||||
|
||||
result.addValue(15.0, series2, type1);
|
||||
result.addValue(17.0, series2, type2);
|
||||
result.addValue(16.0, series2, type3);
|
||||
result.addValue(18.0, series2, type4);
|
||||
result.addValue(14.0, series2, type5);
|
||||
result.addValue(14.0, series2, type6);
|
||||
result.addValue(12.0, series2, type7);
|
||||
result.addValue(11.0, series2, type8);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a chart.
|
||||
*
|
||||
* @return A chart.
|
||||
*/
|
||||
private static JFreeChart createChart() {
|
||||
|
||||
CategoryDataset dataset1 = createDataset1();
|
||||
NumberAxis rangeAxis1 = new NumberAxis("Value");
|
||||
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
|
||||
renderer1.setBaseToolTipGenerator(
|
||||
new StandardCategoryToolTipGenerator());
|
||||
CategoryPlot subplot1 = new CategoryPlot(dataset1, null, rangeAxis1,
|
||||
renderer1);
|
||||
subplot1.setDomainGridlinesVisible(true);
|
||||
|
||||
CategoryDataset dataset2 = createDataset2();
|
||||
NumberAxis rangeAxis2 = new NumberAxis("Value");
|
||||
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
BarRenderer renderer2 = new BarRenderer();
|
||||
renderer2.setBaseToolTipGenerator(
|
||||
new StandardCategoryToolTipGenerator());
|
||||
CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2,
|
||||
renderer2);
|
||||
subplot2.setDomainGridlinesVisible(true);
|
||||
|
||||
CategoryAxis domainAxis = new CategoryAxis("Category");
|
||||
CombinedCategoryPlot plot = new CombinedCategoryPlot(
|
||||
domainAxis, new NumberAxis("Range"));
|
||||
plot.add(subplot1, 2);
|
||||
plot.add(subplot2, 1);
|
||||
|
||||
JFreeChart result = new JFreeChart(
|
||||
"Combined Domain Category Plot Demo",
|
||||
new Font("SansSerif", Font.BOLD, 12), plot, true);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a panel for the demo (used by SuperDemo.java).
|
||||
*
|
||||
* @return A panel.
|
||||
*/
|
||||
public static JPanel createDemoPanel() {
|
||||
JFreeChart chart = createChart();
|
||||
return new ChartPanel(chart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starting point for the demonstration application.
|
||||
*
|
||||
* @param args ignored.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
String title = "Combined Category Plot Demo 1";
|
||||
CombinedCategoryPlotDemo1 demo = new CombinedCategoryPlotDemo1(title);
|
||||
demo.pack();
|
||||
RefineryUtilities.centerFrameOnScreen(demo);
|
||||
demo.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ------------------------
|
||||
* CombinedXYPlotDemo1.java
|
||||
* ------------------------
|
||||
* (C) Copyright 2008, 2009, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): ;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.demo;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Paint;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.DateAxis;
|
||||
import org.jfree.chart.axis.NumberAxis;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.labels.StandardXYToolTipGenerator;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYBarRenderer;
|
||||
import org.jfree.chart.renderer.xy.XYItemRenderer;
|
||||
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
|
||||
import org.jfree.chart.title.LegendTitle;
|
||||
import org.jfree.data.time.Month;
|
||||
import org.jfree.data.time.TimeSeries;
|
||||
import org.jfree.data.time.TimeSeriesCollection;
|
||||
import org.jfree.data.xy.IntervalXYDataset;
|
||||
import org.jfree.data.xy.XYDataset;
|
||||
import org.jfree.experimental.chart.plot.CombinedXYPlot;
|
||||
import org.jfree.ui.ApplicationFrame;
|
||||
import org.jfree.ui.RefineryUtilities;
|
||||
|
||||
/**
|
||||
* A demonstration application showing a {@link CombinedXYPlot} with
|
||||
* two subplots.
|
||||
*/
|
||||
public class CombinedXYPlotDemo1 extends ApplicationFrame {
|
||||
|
||||
/**
|
||||
* Constructs a new demonstration application.
|
||||
*
|
||||
* @param title the frame title.
|
||||
*/
|
||||
public CombinedXYPlotDemo1(String title) {
|
||||
super(title);
|
||||
JPanel panel = createDemoPanel();
|
||||
panel.setPreferredSize(new java.awt.Dimension(500, 270));
|
||||
setContentPane(panel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an overlaid chart.
|
||||
*
|
||||
* @return The chart.
|
||||
*/
|
||||
private static JFreeChart createCombinedChart() {
|
||||
|
||||
// create plot ...
|
||||
IntervalXYDataset data1 = createDataset1();
|
||||
XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
|
||||
renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
|
||||
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
|
||||
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
|
||||
renderer1.setSeriesStroke(0, new BasicStroke(4.0f,
|
||||
BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
|
||||
renderer1.setSeriesPaint(0, Color.blue);
|
||||
|
||||
DateAxis domainAxis = new DateAxis("Year");
|
||||
domainAxis.setLowerMargin(0.0);
|
||||
domainAxis.setUpperMargin(0.02);
|
||||
ValueAxis rangeAxis = new NumberAxis("$billion");
|
||||
XYPlot plot1 = new XYPlot(data1, null, rangeAxis, renderer1);
|
||||
plot1.setBackgroundPaint(Color.lightGray);
|
||||
plot1.setDomainGridlinePaint(Color.white);
|
||||
plot1.setRangeGridlinePaint(Color.white);
|
||||
|
||||
// add a second dataset and renderer...
|
||||
IntervalXYDataset data2 = createDataset2();
|
||||
XYBarRenderer renderer2 = new XYBarRenderer() {
|
||||
public Paint getItemPaint(int series, int item) {
|
||||
XYDataset dataset = getPlot().getDataset();
|
||||
if (dataset.getYValue(series, item) >= 0.0) {
|
||||
return Color.red;
|
||||
}
|
||||
else {
|
||||
return Color.green;
|
||||
}
|
||||
}
|
||||
};
|
||||
renderer2.setSeriesPaint(0, Color.red);
|
||||
renderer2.setDrawBarOutline(false);
|
||||
renderer2.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
|
||||
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
|
||||
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
|
||||
|
||||
XYPlot plot2 = new XYPlot(data2, null, new NumberAxis("$billion"),
|
||||
renderer2);
|
||||
plot2.setBackgroundPaint(Color.lightGray);
|
||||
plot2.setDomainGridlinePaint(Color.white);
|
||||
plot2.setRangeGridlinePaint(Color.white);
|
||||
|
||||
CombinedXYPlot cplot = new CombinedXYPlot(domainAxis, rangeAxis);
|
||||
cplot.add(plot1, 3);
|
||||
cplot.add(plot2, 2);
|
||||
cplot.setGap(8.0);
|
||||
cplot.setDomainGridlinePaint(Color.white);
|
||||
cplot.setDomainGridlinesVisible(true);
|
||||
|
||||
// return a new chart containing the overlaid plot...
|
||||
JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1",
|
||||
JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
|
||||
chart.setBackgroundPaint(Color.white);
|
||||
LegendTitle legend = new LegendTitle(cplot);
|
||||
chart.addSubtitle(legend);
|
||||
return chart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sample dataset. You wouldn't normally hard-code the
|
||||
* population of a dataset in this way (it would be better to read the
|
||||
* values from a file or a database query), but for a self-contained demo
|
||||
* this is the least complicated solution.
|
||||
*
|
||||
* @return The dataset.
|
||||
*/
|
||||
private static IntervalXYDataset createDataset1() {
|
||||
|
||||
// create dataset 1...
|
||||
TimeSeries series1 = new TimeSeries("Series 1");
|
||||
series1.add(new Month(1, 2005), 7627.743);
|
||||
series1.add(new Month(2, 2005), 7713.138);
|
||||
series1.add(new Month(3, 2005), 6776.939);
|
||||
series1.add(new Month(4, 2005), 5764.537);
|
||||
series1.add(new Month(5, 2005), 4777.880);
|
||||
series1.add(new Month(6, 2005), 4836.496);
|
||||
series1.add(new Month(7, 2005), 3887.618);
|
||||
series1.add(new Month(8, 2005), 3926.933);
|
||||
series1.add(new Month(9, 2005), 4932.710);
|
||||
series1.add(new Month(10, 2005), 4027.123);
|
||||
series1.add(new Month(11, 2005), 8092.322);
|
||||
series1.add(new Month(12, 2005), 8170.414);
|
||||
series1.add(new Month(1, 2006), 8196.070);
|
||||
series1.add(new Month(2, 2006), 8269.886);
|
||||
series1.add(new Month(3, 2006), 5371.156);
|
||||
series1.add(new Month(4, 2006), 5355.718);
|
||||
series1.add(new Month(5, 2006), 5356.777);
|
||||
series1.add(new Month(6, 2006), 8420.042);
|
||||
series1.add(new Month(7, 2006), 8444.347);
|
||||
series1.add(new Month(8, 2006), 8515.034);
|
||||
series1.add(new Month(9, 2006), 8506.974);
|
||||
series1.add(new Month(10, 2006), 8584.329);
|
||||
series1.add(new Month(11, 2006), 8633.246);
|
||||
series1.add(new Month(12, 2006), 8680.224);
|
||||
series1.add(new Month(1, 2007), 8707.561);
|
||||
return new TimeSeriesCollection(series1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sample dataset. You wouldn't normally hard-code the
|
||||
* population of a dataset in this way (it would be better to read the
|
||||
* values from a file or a database query), but for a self-contained demo
|
||||
* this is the least complicated solution.
|
||||
*
|
||||
* @return A sample dataset.
|
||||
*/
|
||||
private static IntervalXYDataset createDataset2() {
|
||||
TimeSeriesCollection dataset = new TimeSeriesCollection();
|
||||
|
||||
TimeSeries series1 = new TimeSeries("Series 2");
|
||||
series1.add(new Month(1, 2005), 1200);
|
||||
series1.add(new Month(2, 2005), 1400);
|
||||
series1.add(new Month(3, 2005), 1500);
|
||||
series1.add(new Month(4, 2005), 1700);
|
||||
series1.add(new Month(5, 2005), 1600);
|
||||
series1.add(new Month(6, 2005), 2400);
|
||||
series1.add(new Month(7, 2005), 2100);
|
||||
series1.add(new Month(8, 2005), 2200);
|
||||
series1.add(new Month(9, 2005), 800);
|
||||
series1.add(new Month(10, 2005), 2350);
|
||||
series1.add(new Month(11, 2005), 500);
|
||||
series1.add(new Month(12, 2005), 700);
|
||||
series1.add(new Month(1, 2006), 900);
|
||||
series1.add(new Month(2, 2006), 1500);
|
||||
series1.add(new Month(3, 2006), 2100);
|
||||
series1.add(new Month(4, 2006), 2200);
|
||||
series1.add(new Month(5, 2006), 1900);
|
||||
series1.add(new Month(6, 2006), 3000);
|
||||
series1.add(new Month(7, 2006), 3780);
|
||||
series1.add(new Month(8, 2006), 4000);
|
||||
series1.add(new Month(9, 2006), 4500);
|
||||
series1.add(new Month(10, 2006), 7000);
|
||||
series1.add(new Month(11, 2006), 5500);
|
||||
series1.add(new Month(12, 2006), 6000);
|
||||
series1.add(new Month(1, 2007), 6500);
|
||||
dataset.addSeries(series1);
|
||||
return dataset;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a panel for the demo (used by SuperDemo.java).
|
||||
*
|
||||
* @return A panel.
|
||||
*/
|
||||
public static JPanel createDemoPanel() {
|
||||
JFreeChart chart = createCombinedChart();
|
||||
return new ChartPanel(chart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starting point for the demonstration application.
|
||||
*
|
||||
* @param args ignored.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
CombinedXYPlotDemo1 demo = new CombinedXYPlotDemo1(
|
||||
"JFreeChart : CombinedXYPlotDemo1");
|
||||
demo.pack();
|
||||
RefineryUtilities.centerFrameOnScreen(demo);
|
||||
demo.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------------------
|
||||
* CombinedCategoryPlot.java
|
||||
* -------------------------
|
||||
* (C) Copyright 2008, by Richard West and Contributors.
|
||||
*
|
||||
* Original Author: Richard West, Advanced Micro Devices, Inc.;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 02-Feb-2007 : Version 1, contributed by Richard West - see
|
||||
* patch 1924543 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.plot;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jfree.chart.axis.CategoryAxis;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.plot.CombinedDomainCategoryPlot;
|
||||
import org.jfree.data.Range;
|
||||
|
||||
/**
|
||||
* A specialised form of {@link CombinedDomainCategoryPlot} where the
|
||||
* subplots share not only the same x-axis, but also the same y-axis.
|
||||
*/
|
||||
public class CombinedCategoryPlot extends CombinedDomainCategoryPlot {
|
||||
|
||||
/**
|
||||
* Creates a new instance with the specified axes.
|
||||
*
|
||||
* @param domainAxis the x-axis.
|
||||
* @param rangeAxis the y-axis.
|
||||
*/
|
||||
public CombinedCategoryPlot (CategoryAxis domainAxis, ValueAxis rangeAxis) {
|
||||
super(domainAxis);
|
||||
super.setGap(10.0);
|
||||
super.setRangeAxis(rangeAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with weight <code>1</code>.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
*/
|
||||
public void add(CategoryPlot subplot) {
|
||||
this.add(subplot, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with the specified weight.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
* @param weight the weight for the subplot.
|
||||
*/
|
||||
public void add(CategoryPlot subplot, int weight) {
|
||||
super.add(subplot, weight);
|
||||
|
||||
ValueAxis l_range = super.getRangeAxis();
|
||||
subplot.setRangeAxis(0, l_range, false);
|
||||
|
||||
super.setRangeAxis(l_range);
|
||||
if (null == l_range) {
|
||||
return;
|
||||
}
|
||||
|
||||
l_range.configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bounds of the data values that will be plotted against
|
||||
* the specified axis.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*
|
||||
* @return The bounds.
|
||||
*/
|
||||
public Range getDataRange(ValueAxis axis) {
|
||||
Range l_result = null;
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
|
||||
|
||||
l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
|
||||
}
|
||||
return l_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the range axis that is shared by all the subplots.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*/
|
||||
public void setRangeAxis(ValueAxis axis) {
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
|
||||
l_subplot.setRangeAxis(0, axis, false);
|
||||
}
|
||||
|
||||
super.setRangeAxis(axis);
|
||||
if (null == axis) {
|
||||
return;
|
||||
}
|
||||
|
||||
axis.configure();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------------
|
||||
* CombinedXYPlot.java
|
||||
* -------------------
|
||||
* (C) Copyright 2008, by Richard West and Contributors.
|
||||
*
|
||||
* Original Author: Richard West, Advanced Micro Devices, Inc.;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1, contributed by Richard West - see
|
||||
* patch 1924543 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.plot;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.CombinedDomainCategoryPlot;
|
||||
import org.jfree.chart.plot.CombinedDomainXYPlot;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.data.Range;
|
||||
|
||||
/**
|
||||
* A specialised form of {@link CombinedDomainCategoryPlot} where the
|
||||
* subplots share not only the same x-axis, but also the same y-axis.
|
||||
*/
|
||||
public class CombinedXYPlot extends CombinedDomainXYPlot {
|
||||
|
||||
/**
|
||||
* Creates a new instance with the specified axes.
|
||||
*
|
||||
* @param domainAxis the x-axis.
|
||||
* @param rangeAxis the y-axis.
|
||||
*/
|
||||
public CombinedXYPlot(ValueAxis domainAxis, ValueAxis rangeAxis) {
|
||||
super(domainAxis);
|
||||
super.setGap(10.0);
|
||||
super.setRangeAxis(rangeAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with weight <code>1</code>.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
*/
|
||||
public void add(XYPlot subplot) {
|
||||
this.add(subplot, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with the specified weight.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
* @param weight the weight for the subplot.
|
||||
*/
|
||||
public void add(XYPlot subplot, int weight) {
|
||||
super.add(subplot, weight);
|
||||
|
||||
ValueAxis l_range = super.getRangeAxis();
|
||||
subplot.setRangeAxis(0, l_range, false);
|
||||
|
||||
super.setRangeAxis(l_range);
|
||||
if (null == l_range) {
|
||||
return;
|
||||
}
|
||||
|
||||
l_range.configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bounds of the data values that will be plotted against
|
||||
* the specified axis.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*
|
||||
* @return The bounds.
|
||||
*/
|
||||
public Range getDataRange(ValueAxis axis) {
|
||||
Range l_result = null;
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
XYPlot l_subplot = (XYPlot) l_itr.next();
|
||||
|
||||
l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
|
||||
}
|
||||
return l_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the range axis that is shared by all the subplots.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*/
|
||||
public void setRangeAxis(ValueAxis axis) {
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
XYPlot l_subplot = (XYPlot) l_itr.next();
|
||||
l_subplot.setRangeAxis(0, axis, false);
|
||||
}
|
||||
|
||||
super.setRangeAxis(axis);
|
||||
if (null == axis) {
|
||||
return;
|
||||
}
|
||||
|
||||
axis.configure();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ---------------------------------
|
||||
* XYSmoothLineAndShapeRenderer.java
|
||||
* ---------------------------------
|
||||
* (C) Copyright 2007, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: -;
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 14-Jun-2007 : Version 1;
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.renderer.xy;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.entity.EntityCollection;
|
||||
import org.jfree.chart.plot.CrosshairState;
|
||||
import org.jfree.chart.plot.PlotOrientation;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYItemRendererState;
|
||||
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
|
||||
import org.jfree.data.xy.XYDataset;
|
||||
import org.jfree.ui.RectangleEdge;
|
||||
|
||||
/**
|
||||
* A line and shape renderer that performs line smoothing. See
|
||||
* http://www.jfree.org/phpBB2/viewtopic.php?t=20671
|
||||
*
|
||||
* WARNING: THIS CLASS IS NOT PART OF THE STANDARD JFREECHART API AND IS
|
||||
* SUBJECT TO ALTERATION OR REMOVAL. DO NOT RELY ON THIS CLASS FOR
|
||||
* PRODUCTION USE. Please experiment with this code and provide feedback.
|
||||
*/
|
||||
public class XYSmoothLineAndShapeRenderer extends XYLineAndShapeRenderer {
|
||||
|
||||
/**
|
||||
* Draws the item (first pass). This method draws the lines
|
||||
* connecting the items.
|
||||
*
|
||||
* @param g2 the graphics device.
|
||||
* @param state the renderer state.
|
||||
* @param dataArea the area within which the data is being drawn.
|
||||
* @param plot the plot (can be used to obtain standard color
|
||||
* information etc).
|
||||
* @param domainAxis the domain axis.
|
||||
* @param rangeAxis the range axis.
|
||||
* @param dataset the dataset.
|
||||
* @param pass the pass.
|
||||
* @param series the series index (zero-based).
|
||||
* @param item the item index (zero-based).
|
||||
*/
|
||||
protected void drawPrimaryLine(XYItemRendererState state, Graphics2D g2,
|
||||
XYPlot plot, XYDataset dataset, int pass, int series, int item,
|
||||
ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea) {
|
||||
|
||||
if (item == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get the data point...
|
||||
double x1 = dataset.getXValue(series, item);
|
||||
double y1 = dataset.getYValue(series, item);
|
||||
if (Double.isNaN(y1) || Double.isNaN(x1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double x0 = dataset.getXValue(series, item - 1);
|
||||
double y0 = dataset.getYValue(series, item - 1);
|
||||
if (Double.isNaN(y0) || Double.isNaN(x0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
|
||||
RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
|
||||
|
||||
double transX0 = domainAxis.valueToJava2D(x0, dataArea, xAxisLocation);
|
||||
double transY0 = rangeAxis.valueToJava2D(y0, dataArea, yAxisLocation);
|
||||
|
||||
double transX1 = domainAxis.valueToJava2D(x1, dataArea, xAxisLocation);
|
||||
double transY1 = rangeAxis.valueToJava2D(y1, dataArea, yAxisLocation);
|
||||
|
||||
// only draw if we have good values
|
||||
if (Double.isNaN(transX0) || Double.isNaN(transY0)
|
||||
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Point2D.Double point0 = new Point2D.Double();
|
||||
Point2D.Double point1 = new Point2D.Double();
|
||||
Point2D.Double point2 = new Point2D.Double();
|
||||
Point2D.Double point3 = new Point2D.Double();
|
||||
|
||||
if (item == 1) {
|
||||
point0 = null;
|
||||
}
|
||||
else {
|
||||
point0.x = domainAxis.valueToJava2D(dataset.getXValue(series,
|
||||
item - 2), dataArea, xAxisLocation);
|
||||
point0.y = rangeAxis.valueToJava2D(dataset.getYValue(series,
|
||||
item - 2), dataArea, yAxisLocation);
|
||||
}
|
||||
|
||||
point1.x = transX0;
|
||||
point1.y = transY0;
|
||||
|
||||
point2.x = transX1;
|
||||
point2.y = transY1;
|
||||
|
||||
if ((item + 1) == dataset.getItemCount(series)) {
|
||||
point3 = null;
|
||||
}
|
||||
else {
|
||||
point3.x = domainAxis.valueToJava2D(dataset.getXValue(series,
|
||||
item + 1), dataArea, xAxisLocation);
|
||||
point3.y = rangeAxis.valueToJava2D(dataset.getYValue(series,
|
||||
item + 1), dataArea, yAxisLocation);
|
||||
}
|
||||
|
||||
int steps = ((int) ((point2.x - point1.x) / 0.2) < 30)
|
||||
? (int) ((point2.x - point1.x) / 0.2) : 30;
|
||||
|
||||
Point2D.Double[] points = getBezierCurve(point0, point1, point2,
|
||||
point3, 1, steps);
|
||||
|
||||
for (int i = 1; i < points.length; i++) {
|
||||
transX0 = points[i - 1].x;
|
||||
transY0 = points[i - 1].y;
|
||||
transX1 = points[i].x;
|
||||
transY1 = points[i].y;
|
||||
|
||||
PlotOrientation orientation = plot.getOrientation();
|
||||
if (orientation == PlotOrientation.HORIZONTAL) {
|
||||
state.workingLine.setLine(transY0, transX0, transY1, transX1);
|
||||
}
|
||||
else if (orientation == PlotOrientation.VERTICAL) {
|
||||
state.workingLine.setLine(transX0, transY0, transX1, transY1);
|
||||
}
|
||||
|
||||
if (state.workingLine.intersects(dataArea)) {
|
||||
drawFirstPassShape(g2, pass, series, item, state.workingLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the item shapes and adds chart entities (second pass). This method
|
||||
* draws the shapes which mark the item positions. If <code>entities</code>
|
||||
* is not <code>null</code> it will be populated with entity information
|
||||
* for points that fall within the data area.
|
||||
*
|
||||
* @param g2 the graphics device.
|
||||
* @param plot the plot (can be used to obtain standard color
|
||||
* information etc).
|
||||
* @param domainAxis the domain axis.
|
||||
* @param dataArea the area within which the data is being drawn.
|
||||
* @param rangeAxis the range axis.
|
||||
* @param dataset the dataset.
|
||||
* @param pass the pass.
|
||||
* @param series the series index (zero-based).
|
||||
* @param item the item index (zero-based).
|
||||
* @param crosshairState the crosshair state.
|
||||
* @param entities the entity collection.
|
||||
*/
|
||||
protected void drawSecondaryPass(Graphics2D g2, XYPlot plot,
|
||||
XYDataset dataset, int pass, int series, int item,
|
||||
ValueAxis domainAxis, Rectangle2D dataArea,
|
||||
ValueAxis rangeAxis, CrosshairState crosshairState,
|
||||
EntityCollection entities) {
|
||||
// super.drawSecondaryPass(g2, plot, dataset, pass, series, item,
|
||||
// domainAxis, dataArea, rangeAxis, crosshairState, entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the control points.
|
||||
*
|
||||
* @param point0
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @param point3
|
||||
* @param control1
|
||||
* @param control2
|
||||
* @param smooth
|
||||
*/
|
||||
public static void getControlPoints(Point2D.Double point0,
|
||||
Point2D.Double point1, Point2D.Double point2,
|
||||
Point2D.Double point3, Point2D.Double control1,
|
||||
Point2D.Double control2, double smooth) {
|
||||
|
||||
// Reference: http://www.antigrain.com/research/bezier_interpolation/
|
||||
|
||||
if (point0 == null) {
|
||||
point0 = point1;
|
||||
} //new Point2D.Double(0, 0);
|
||||
if (point3 == null) {
|
||||
point3 = point2;
|
||||
} //new Point2D.Double(0, 0);
|
||||
|
||||
Point2D.Double c1 = new Point2D.Double(
|
||||
(point0.x + point1.x) / 2.0, (point0.y + point1.y) / 2.0);
|
||||
Point2D.Double c2 = new Point2D.Double(
|
||||
(point1.x + point2.x) / 2.0, (point1.y + point2.y) / 2.0);
|
||||
Point2D.Double c3 = new Point2D.Double(
|
||||
(point2.x + point3.x) / 2.0, (point2.y + point3.y) / 2.0);
|
||||
|
||||
double len1 = point1.distance(point0);
|
||||
double len2 = point2.distance(point1);
|
||||
double len3 = point3.distance(point2);
|
||||
|
||||
double k1 = len1 / (len1 + len2);
|
||||
double k2 = len2 / (len2 + len3);
|
||||
|
||||
Point2D.Double m1 = new Point2D.Double(
|
||||
c1.x + (c2.x - c1.x) * k1, c1.y + (c2.y - c1.y) * k1);
|
||||
Point2D.Double m2 = new Point2D.Double(
|
||||
c2.x + (c3.x - c2.x) * k2, c2.y + (c3.y - c2.y) * k2);
|
||||
|
||||
control1.setLocation(new Point2D.Double(
|
||||
m1.x + (c2.x - m1.x) * smooth + point1.x - m1.x,
|
||||
m1.y + (c2.y - m1.y) * smooth + point1.y - m1.y));
|
||||
control2.setLocation(new Point2D.Double(
|
||||
m2.x + (c2.x - m2.x) * smooth + point2.x - m2.x,
|
||||
m2.y + (c2.y - m2.y) * smooth + point2.y - m2.y));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the points for a bezier curve.
|
||||
*
|
||||
* @param point0
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @param point3
|
||||
* @param smooth
|
||||
* @param steps
|
||||
*
|
||||
* @return The curve points.
|
||||
*/
|
||||
public static Point2D.Double[] getBezierCurve(Point2D.Double point0,
|
||||
Point2D.Double point1, Point2D.Double point2,
|
||||
Point2D.Double point3, double smooth, int steps) {
|
||||
Point2D.Double control1 = new Point2D.Double();
|
||||
Point2D.Double control2 = new Point2D.Double();
|
||||
|
||||
getControlPoints(point0, point1, point2, point3, control1, control2,
|
||||
smooth);
|
||||
|
||||
Point2D.Double C = new Point2D.Double(
|
||||
3 * (control1.x - point1.x), 3 * (control1.y - point1.y));
|
||||
Point2D.Double B = new Point2D.Double(3 * (control2.x - control1.x)
|
||||
- C.x, 3 * (control2.y - control1.y) - C.y);
|
||||
Point2D.Double A = new Point2D.Double(point2.x - point1.x - C.x - B.x,
|
||||
point2.y - point1.y - C.y - B.y);
|
||||
|
||||
Point2D.Double[] res = new Point2D.Double[steps + 1];
|
||||
double stepSize = 1.0 / steps;
|
||||
double step = stepSize;
|
||||
|
||||
res[0] = point1;
|
||||
for (int i = 1; i < steps; i++) {
|
||||
res[i] = new Point2D.Double(A.x * Math.pow(step, 3) + B.x
|
||||
* Math.pow(step, 2) + C.x * step + point1.x, A.y
|
||||
* Math.pow(step, 3) + B.y * Math.pow(step, 2) + C.y * step
|
||||
+ point1.y);
|
||||
step += stepSize;
|
||||
}
|
||||
res[steps] = point2;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
[Dolphin]
|
||||
Timestamp=2014,5,14,11,57,56
|
||||
Version=3
|
||||
ViewMode=2
|
||||
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
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 this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<name>JFreeChart</name>
|
||||
|
||||
<artifactId>jfreechart</artifactId>
|
||||
<groupId>org.jfree</groupId>
|
||||
<version>1.0.17-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- this is required to host it on Sonatype's OSSRH -->
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>7</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
<name>JFree.org</name>
|
||||
<url>http://www.jfree.org/</url>
|
||||
</organization>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
|
||||
<description>
|
||||
JFreeChart is a class library, written in Java, for generating charts.
|
||||
Utilising the Java2D APIs, it currently supports bar charts, pie charts,
|
||||
line charts, XY-plots and time series plots.
|
||||
</description>
|
||||
|
||||
<url>http://www.jfree.org/jfreechart/</url>
|
||||
<issueManagement>
|
||||
<url>http://sourceforge.net/tracker/?group_id=15494</url>
|
||||
</issueManagement>
|
||||
<scm>
|
||||
<connection>scm:svn:https://jfreechart.svn.sourceforge.net/svnroot/jfreechart jfreechart</connection>
|
||||
<url>http://jfreechart.svn.sourceforge.net/viewvc/jfreechart/</url>
|
||||
</scm>
|
||||
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>JFreeChart Developer List</name>
|
||||
<subscribe>
|
||||
jfreechart-dev-request@lists.sourceforge.net?subject=subscribe
|
||||
</subscribe>
|
||||
<unsubscribe>
|
||||
jfreechart-dev-request@lists.sourceforge.net?subject=unsubscribe
|
||||
</unsubscribe>
|
||||
<archive>
|
||||
http://sourceforge.net/mailarchive/forum.php?forum=jfreechart-dev
|
||||
</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
|
||||
<developers>
|
||||
<!--
|
||||
For an up to date list of developers and contributors have a look at
|
||||
the project info implementations.
|
||||
-->
|
||||
</developers>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>GNU Lesser General Public Licence</name>
|
||||
<url>http://www.gnu.org/licenses/lgpl.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jfree</groupId>
|
||||
<artifactId>jcommon</artifactId>
|
||||
<version>1.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>1.3.04</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
<version>1.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>source</sourceDirectory>
|
||||
<testSourceDirectory>tests</testSourceDirectory>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>source</directory>
|
||||
<includes>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.jpg</include>
|
||||
<include>**/*.</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<configuration>
|
||||
<signature>
|
||||
<groupId>org.codehaus.mojo.signature</groupId>
|
||||
<artifactId>java16</artifactId>
|
||||
<version>1.0</version>
|
||||
</signature>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<inherited>true</inherited>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadoc</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>${project.source.level}</source>
|
||||
<target>${project.target.level}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/JFreeChartTestSuite.java</exclude>
|
||||
<exclude>**/*PackageTests.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.source.level>1.6</project.source.level>
|
||||
<project.target.level>1.6</project.target.level>
|
||||
</properties>
|
||||
</project>
|
||||
@@ -0,0 +1,189 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ---------------
|
||||
* ChartColor.java
|
||||
* ---------------
|
||||
* (C) Copyright 2003-2011, by Cameron Riley and Contributors.
|
||||
*
|
||||
* Original Author: Cameron Riley;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 23-Jan-2003 : Version 1, contributed by Cameron Riley (DG);
|
||||
* 25-Nov-2004 : Changed first 7 colors to softer shades (DG);
|
||||
* 03-Nov-2005 : Removed orange color, too close to yellow - see bug
|
||||
* report 1328408 (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Paint;
|
||||
|
||||
/**
|
||||
* Class to extend the number of Colors available to the charts. This
|
||||
* extends the java.awt.Color object and extends the number of final
|
||||
* Colors publically accessible.
|
||||
*/
|
||||
public class ChartColor extends Color {
|
||||
|
||||
/** A very dark red color. */
|
||||
public static final Color VERY_DARK_RED = new Color(0x80, 0x00, 0x00);
|
||||
|
||||
/** A dark red color. */
|
||||
public static final Color DARK_RED = new Color(0xc0, 0x00, 0x00);
|
||||
|
||||
/** A light red color. */
|
||||
public static final Color LIGHT_RED = new Color(0xFF, 0x40, 0x40);
|
||||
|
||||
/** A very light red color. */
|
||||
public static final Color VERY_LIGHT_RED = new Color(0xFF, 0x80, 0x80);
|
||||
|
||||
/** A very dark yellow color. */
|
||||
public static final Color VERY_DARK_YELLOW = new Color(0x80, 0x80, 0x00);
|
||||
|
||||
/** A dark yellow color. */
|
||||
public static final Color DARK_YELLOW = new Color(0xC0, 0xC0, 0x00);
|
||||
|
||||
/** A light yellow color. */
|
||||
public static final Color LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x40);
|
||||
|
||||
/** A very light yellow color. */
|
||||
public static final Color VERY_LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x80);
|
||||
|
||||
/** A very dark green color. */
|
||||
public static final Color VERY_DARK_GREEN = new Color(0x00, 0x80, 0x00);
|
||||
|
||||
/** A dark green color. */
|
||||
public static final Color DARK_GREEN = new Color(0x00, 0xC0, 0x00);
|
||||
|
||||
/** A light green color. */
|
||||
public static final Color LIGHT_GREEN = new Color(0x40, 0xFF, 0x40);
|
||||
|
||||
/** A very light green color. */
|
||||
public static final Color VERY_LIGHT_GREEN = new Color(0x80, 0xFF, 0x80);
|
||||
|
||||
/** A very dark cyan color. */
|
||||
public static final Color VERY_DARK_CYAN = new Color(0x00, 0x80, 0x80);
|
||||
|
||||
/** A dark cyan color. */
|
||||
public static final Color DARK_CYAN = new Color(0x00, 0xC0, 0xC0);
|
||||
|
||||
/** A light cyan color. */
|
||||
public static final Color LIGHT_CYAN = new Color(0x40, 0xFF, 0xFF);
|
||||
|
||||
/** Aa very light cyan color. */
|
||||
public static final Color VERY_LIGHT_CYAN = new Color(0x80, 0xFF, 0xFF);
|
||||
|
||||
/** A very dark blue color. */
|
||||
public static final Color VERY_DARK_BLUE = new Color(0x00, 0x00, 0x80);
|
||||
|
||||
/** A dark blue color. */
|
||||
public static final Color DARK_BLUE = new Color(0x00, 0x00, 0xC0);
|
||||
|
||||
/** A light blue color. */
|
||||
public static final Color LIGHT_BLUE = new Color(0x40, 0x40, 0xFF);
|
||||
|
||||
/** A very light blue color. */
|
||||
public static final Color VERY_LIGHT_BLUE = new Color(0x80, 0x80, 0xFF);
|
||||
|
||||
/** A very dark magenta/purple color. */
|
||||
public static final Color VERY_DARK_MAGENTA = new Color(0x80, 0x00, 0x80);
|
||||
|
||||
/** A dark magenta color. */
|
||||
public static final Color DARK_MAGENTA = new Color(0xC0, 0x00, 0xC0);
|
||||
|
||||
/** A light magenta color. */
|
||||
public static final Color LIGHT_MAGENTA = new Color(0xFF, 0x40, 0xFF);
|
||||
|
||||
/** A very light magenta color. */
|
||||
public static final Color VERY_LIGHT_MAGENTA = new Color(0xFF, 0x80, 0xFF);
|
||||
|
||||
/**
|
||||
* Creates a Color with an opaque sRGB with red, green and blue values in
|
||||
* range 0-255.
|
||||
*
|
||||
* @param r the red component in range 0x00-0xFF.
|
||||
* @param g the green component in range 0x00-0xFF.
|
||||
* @param b the blue component in range 0x00-0xFF.
|
||||
*/
|
||||
public ChartColor(int r, int g, int b) {
|
||||
super(r, g, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to return an array of <code>Paint</code> objects that
|
||||
* represent the pre-defined colors in the <code>Color</code> and
|
||||
* <code>ChartColor</code> objects.
|
||||
*
|
||||
* @return An array of objects with the <code>Paint</code> interface.
|
||||
*/
|
||||
public static Paint[] createDefaultPaintArray() {
|
||||
|
||||
return new Paint[] {
|
||||
new Color(0xFF, 0x55, 0x55),
|
||||
new Color(0x55, 0x55, 0xFF),
|
||||
new Color(0x55, 0xFF, 0x55),
|
||||
new Color(0xFF, 0xFF, 0x55),
|
||||
new Color(0xFF, 0x55, 0xFF),
|
||||
new Color(0x55, 0xFF, 0xFF),
|
||||
Color.pink,
|
||||
Color.gray,
|
||||
ChartColor.DARK_RED,
|
||||
ChartColor.DARK_BLUE,
|
||||
ChartColor.DARK_GREEN,
|
||||
ChartColor.DARK_YELLOW,
|
||||
ChartColor.DARK_MAGENTA,
|
||||
ChartColor.DARK_CYAN,
|
||||
Color.darkGray,
|
||||
ChartColor.LIGHT_RED,
|
||||
ChartColor.LIGHT_BLUE,
|
||||
ChartColor.LIGHT_GREEN,
|
||||
ChartColor.LIGHT_YELLOW,
|
||||
ChartColor.LIGHT_MAGENTA,
|
||||
ChartColor.LIGHT_CYAN,
|
||||
Color.lightGray,
|
||||
ChartColor.VERY_DARK_RED,
|
||||
ChartColor.VERY_DARK_BLUE,
|
||||
ChartColor.VERY_DARK_GREEN,
|
||||
ChartColor.VERY_DARK_YELLOW,
|
||||
ChartColor.VERY_DARK_MAGENTA,
|
||||
ChartColor.VERY_DARK_CYAN,
|
||||
ChartColor.VERY_LIGHT_RED,
|
||||
ChartColor.VERY_LIGHT_BLUE,
|
||||
ChartColor.VERY_LIGHT_GREEN,
|
||||
ChartColor.VERY_LIGHT_YELLOW,
|
||||
ChartColor.VERY_LIGHT_MAGENTA,
|
||||
ChartColor.VERY_LIGHT_CYAN
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ---------------
|
||||
* ChartFrame.java
|
||||
* ---------------
|
||||
* (C) Copyright 2001-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 22-Nov-2001 : Version 1 (DG);
|
||||
* 08-Jan-2001 : Added chartPanel attribute (DG);
|
||||
* 24-May-2002 : Renamed JFreeChartFrame --> ChartFrame (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
/**
|
||||
* A frame for displaying a chart.
|
||||
*/
|
||||
public class ChartFrame extends JFrame {
|
||||
|
||||
/** The chart panel. */
|
||||
private ChartPanel chartPanel;
|
||||
|
||||
/**
|
||||
* Constructs a frame for a chart.
|
||||
*
|
||||
* @param title the frame title.
|
||||
* @param chart the chart.
|
||||
*/
|
||||
public ChartFrame(String title, JFreeChart chart) {
|
||||
this(title, chart, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a frame for a chart.
|
||||
*
|
||||
* @param title the frame title.
|
||||
* @param chart the chart.
|
||||
* @param scrollPane if <code>true</code>, put the Chart(Panel) into a
|
||||
* JScrollPane.
|
||||
*/
|
||||
public ChartFrame(String title, JFreeChart chart, boolean scrollPane) {
|
||||
super(title);
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
this.chartPanel = new ChartPanel(chart);
|
||||
if (scrollPane) {
|
||||
setContentPane(new JScrollPane(this.chartPanel));
|
||||
}
|
||||
else {
|
||||
setContentPane(this.chartPanel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chart panel for the frame.
|
||||
*
|
||||
* @return The chart panel.
|
||||
*/
|
||||
public ChartPanel getChartPanel() {
|
||||
return this.chartPanel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* --------------------
|
||||
* ChartMouseEvent.java
|
||||
* --------------------
|
||||
* (C) Copyright 2002-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): Alex Weber;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 27-May-2002 : Version 1, incorporating code and ideas by Alex Weber (DG);
|
||||
* 13-Jun-2002 : Added Javadoc comments (DG);
|
||||
* 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 05-Nov-2002 : Added a reference to the source chart (DG);
|
||||
* 13-Jul-2004 : Now extends EventObject and implements Serializable (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 24-May-2007 : Updated API docs (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.Serializable;
|
||||
import java.util.EventObject;
|
||||
|
||||
import org.jfree.chart.entity.ChartEntity;
|
||||
|
||||
/**
|
||||
* A mouse event for a chart that is displayed in a {@link ChartPanel}.
|
||||
*
|
||||
* @see ChartMouseListener
|
||||
*/
|
||||
public class ChartMouseEvent extends EventObject implements Serializable {
|
||||
|
||||
/** For serialization. */
|
||||
private static final long serialVersionUID = -682393837314562149L;
|
||||
|
||||
/** The chart that the mouse event relates to. */
|
||||
private JFreeChart chart;
|
||||
|
||||
/** The Java mouse event that triggered this event. */
|
||||
private MouseEvent trigger;
|
||||
|
||||
/** The chart entity (if any). */
|
||||
private ChartEntity entity;
|
||||
|
||||
/**
|
||||
* Constructs a new event.
|
||||
*
|
||||
* @param chart the source chart (<code>null</code> not permitted).
|
||||
* @param trigger the mouse event that triggered this event
|
||||
* (<code>null</code> not permitted).
|
||||
* @param entity the chart entity (if any) under the mouse point
|
||||
* (<code>null</code> permitted).
|
||||
*/
|
||||
public ChartMouseEvent(JFreeChart chart, MouseEvent trigger,
|
||||
ChartEntity entity) {
|
||||
super(chart);
|
||||
this.chart = chart;
|
||||
this.trigger = trigger;
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chart that the mouse event relates to.
|
||||
*
|
||||
* @return The chart (never <code>null</code>).
|
||||
*/
|
||||
public JFreeChart getChart() {
|
||||
return this.chart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the mouse event that triggered this event.
|
||||
*
|
||||
* @return The event (never <code>null</code>).
|
||||
*/
|
||||
public MouseEvent getTrigger() {
|
||||
return this.trigger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chart entity (if any) under the mouse point.
|
||||
*
|
||||
* @return The chart entity (possibly <code>null</code>).
|
||||
*/
|
||||
public ChartEntity getEntity() {
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -----------------------
|
||||
* ChartMouseListener.java
|
||||
* -----------------------
|
||||
* (C) Copyright 2002-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): Alex Weber;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 27-May-2002 : Version 1, incorporating code and ideas by Alex Weber (DG);
|
||||
* 13-Jun-2002 : Added Javadocs (DG);
|
||||
* 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 23-Nov-2005 : Now extends EventListener (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 24-May-2007 : Updated API docs (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
/**
|
||||
* The interface that must be implemented by classes that wish to receive
|
||||
* {@link ChartMouseEvent} notifications from a {@link ChartPanel}.
|
||||
*
|
||||
* @see ChartPanel#addChartMouseListener(ChartMouseListener)
|
||||
*/
|
||||
public interface ChartMouseListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Callback method for receiving notification of a mouse click on a chart.
|
||||
*
|
||||
* @param event information about the event.
|
||||
*/
|
||||
void chartMouseClicked(ChartMouseEvent event);
|
||||
|
||||
/**
|
||||
* Callback method for receiving notification of a mouse movement on a
|
||||
* chart.
|
||||
*
|
||||
* @param event information about the event.
|
||||
*/
|
||||
void chartMouseMoved(ChartMouseEvent event);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -----------------------
|
||||
* ChartRenderingInfo.java
|
||||
* -----------------------
|
||||
* (C) Copyright 2002-2013, by Object Refinery Limited.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 22-Jan-2002 : Version 1 (DG);
|
||||
* 05-Feb-2002 : Added a new constructor, completed Javadoc comments (DG);
|
||||
* 05-Mar-2002 : Added a clear() method (DG);
|
||||
* 23-May-2002 : Renamed DrawInfo --> ChartRenderingInfo (DG);
|
||||
* 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 17-Sep-2003 : Added PlotRenderingInfo (DG);
|
||||
* 01-Nov-2005 : Updated equals() method (DG);
|
||||
* 30-Nov-2005 : Removed get/setPlotArea() (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 01-Dec-2006 : Fixed equals() and clone() (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jfree.chart.entity.EntityCollection;
|
||||
import org.jfree.chart.entity.StandardEntityCollection;
|
||||
import org.jfree.chart.plot.PlotRenderingInfo;
|
||||
import org.jfree.io.SerialUtilities;
|
||||
import org.jfree.util.ObjectUtilities;
|
||||
import org.jfree.util.PublicCloneable;
|
||||
|
||||
/**
|
||||
* A structure for storing rendering information from one call to the
|
||||
* JFreeChart.draw() method.
|
||||
* <P>
|
||||
* An instance of the {@link JFreeChart} class can draw itself within an
|
||||
* arbitrary rectangle on any <code>Graphics2D</code>. It is assumed that
|
||||
* client code will sometimes render the same chart in more than one view, so
|
||||
* the {@link JFreeChart} instance does not retain any information about its
|
||||
* rendered dimensions. This information can be useful sometimes, so you have
|
||||
* the option to collect the information at each call to
|
||||
* <code>JFreeChart.draw()</code>, by passing an instance of this
|
||||
* <code>ChartRenderingInfo</code> class.
|
||||
*/
|
||||
public class ChartRenderingInfo implements Cloneable, Serializable {
|
||||
|
||||
/** For serialization. */
|
||||
private static final long serialVersionUID = 2751952018173406822L;
|
||||
|
||||
/** The area in which the chart is drawn. */
|
||||
private transient Rectangle2D chartArea;
|
||||
|
||||
/** Rendering info for the chart's plot (and subplots, if any). */
|
||||
private PlotRenderingInfo plotInfo;
|
||||
|
||||
/**
|
||||
* Storage for the chart entities. Since retaining entity information for
|
||||
* charts with a large number of data points consumes a lot of memory, it
|
||||
* is intended that you can set this to <code>null</code> to prevent the
|
||||
* information being collected.
|
||||
*/
|
||||
private EntityCollection entities;
|
||||
|
||||
/**
|
||||
* Constructs a new ChartRenderingInfo structure that can be used to
|
||||
* collect information about the dimensions of a rendered chart.
|
||||
*/
|
||||
public ChartRenderingInfo() {
|
||||
this(new StandardEntityCollection());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new instance. If an entity collection is supplied, it will
|
||||
* be populated with information about the entities in a chart. If it is
|
||||
* <code>null</code>, no entity information (including tool tips) will
|
||||
* be collected.
|
||||
*
|
||||
* @param entities an entity collection (<code>null</code> permitted).
|
||||
*/
|
||||
public ChartRenderingInfo(EntityCollection entities) {
|
||||
this.chartArea = new Rectangle2D.Double();
|
||||
this.plotInfo = new PlotRenderingInfo(this);
|
||||
this.entities = entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the area in which the chart was drawn.
|
||||
*
|
||||
* @return The area in which the chart was drawn.
|
||||
*
|
||||
* @see #setChartArea(Rectangle2D)
|
||||
*/
|
||||
public Rectangle2D getChartArea() {
|
||||
return this.chartArea;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the area in which the chart was drawn.
|
||||
*
|
||||
* @param area the chart area.
|
||||
*
|
||||
* @see #getChartArea()
|
||||
*/
|
||||
public void setChartArea(Rectangle2D area) {
|
||||
this.chartArea.setRect(area);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the collection of entities maintained by this instance.
|
||||
*
|
||||
* @return The entity collection (possibly <code>null</code>).
|
||||
*
|
||||
* @see #setEntityCollection(EntityCollection)
|
||||
*/
|
||||
public EntityCollection getEntityCollection() {
|
||||
return this.entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the entity collection.
|
||||
*
|
||||
* @param entities the entity collection (<code>null</code> permitted).
|
||||
*
|
||||
* @see #getEntityCollection()
|
||||
*/
|
||||
public void setEntityCollection(EntityCollection entities) {
|
||||
this.entities = entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the information recorded by this object.
|
||||
*/
|
||||
public void clear() {
|
||||
this.chartArea.setRect(0.0, 0.0, 0.0, 0.0);
|
||||
this.plotInfo = new PlotRenderingInfo(this);
|
||||
if (this.entities != null) {
|
||||
this.entities.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rendering info for the chart's plot.
|
||||
*
|
||||
* @return The rendering info for the plot.
|
||||
*/
|
||||
public PlotRenderingInfo getPlotInfo() {
|
||||
return this.plotInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests this object for equality with an arbitrary object.
|
||||
*
|
||||
* @param obj the object to test against (<code>null</code> permitted).
|
||||
*
|
||||
* @return A boolean.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ChartRenderingInfo)) {
|
||||
return false;
|
||||
}
|
||||
ChartRenderingInfo that = (ChartRenderingInfo) obj;
|
||||
if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) {
|
||||
return false;
|
||||
}
|
||||
if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) {
|
||||
return false;
|
||||
}
|
||||
if (!ObjectUtilities.equal(this.entities, that.entities)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a clone of this object.
|
||||
*
|
||||
* @return A clone.
|
||||
*
|
||||
* @throws CloneNotSupportedException if the object cannot be cloned.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
ChartRenderingInfo clone = (ChartRenderingInfo) super.clone();
|
||||
if (this.chartArea != null) {
|
||||
clone.chartArea = (Rectangle2D) this.chartArea.clone();
|
||||
}
|
||||
if (this.entities instanceof PublicCloneable) {
|
||||
PublicCloneable pc = (PublicCloneable) this.entities;
|
||||
clone.entities = (EntityCollection) pc.clone();
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides serialization support.
|
||||
*
|
||||
* @param stream the output stream.
|
||||
*
|
||||
* @throws IOException if there is an I/O error.
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream stream) throws IOException {
|
||||
stream.defaultWriteObject();
|
||||
SerialUtilities.writeShape(this.chartArea, stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides serialization support.
|
||||
*
|
||||
* @param stream the input stream.
|
||||
*
|
||||
* @throws IOException if there is an I/O error.
|
||||
* @throws ClassNotFoundException if there is a classpath problem.
|
||||
*/
|
||||
private void readObject(ObjectInputStream stream)
|
||||
throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
this.chartArea = (Rectangle2D) SerialUtilities.readShape(stream);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ---------------
|
||||
* ChartTheme.java
|
||||
* ---------------
|
||||
* (C) Copyright 2008, 2012 by Object Refinery Limited.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 14-Aug-2008 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
/**
|
||||
* A {@link ChartTheme} a class that can apply a style or 'theme' to a chart.
|
||||
* It can be implemented in an arbitrary manner, with the styling applied to
|
||||
* the chart via the <code>apply(JFreeChart)</code> method. We provide one
|
||||
* implementation ({@link StandardChartTheme}) that just mimics the manual
|
||||
* process of calling methods to set various chart parameters.
|
||||
*
|
||||
* @since 1.0.11
|
||||
*/
|
||||
public interface ChartTheme {
|
||||
|
||||
/**
|
||||
* Applies this theme to the supplied chart.
|
||||
*
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
*/
|
||||
public void apply(JFreeChart chart);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ----------------------
|
||||
* ChartTransferable.java
|
||||
* ----------------------
|
||||
* (C) Copyright 2009-2013, by Object Refinery Limited.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 08-Apr-2009 : Version 1, with inspiration from patch 1460845 (DG);
|
||||
* 05-May-2009 : Match the scaling options provided by the ChartPanel
|
||||
* class (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* A class used to represent a chart on the clipboard.
|
||||
*
|
||||
* @since 1.0.13
|
||||
*/
|
||||
public class ChartTransferable implements Transferable {
|
||||
|
||||
/** The data flavor. */
|
||||
final DataFlavor imageFlavor = new DataFlavor(
|
||||
"image/x-java-image; class=java.awt.Image", "Image");
|
||||
|
||||
/** The chart. */
|
||||
private JFreeChart chart;
|
||||
|
||||
/** The width of the chart on the clipboard. */
|
||||
private int width;
|
||||
|
||||
/** The height of the chart on the clipboard. */
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* The smallest width at which the chart will be drawn (if necessary, the
|
||||
* chart will then be scaled down to fit the requested width).
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
private int minDrawWidth;
|
||||
|
||||
/**
|
||||
* The smallest height at which the chart will be drawn (if necessary, the
|
||||
* chart will then be scaled down to fit the requested height).
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
private int minDrawHeight;
|
||||
|
||||
/**
|
||||
* The largest width at which the chart will be drawn (if necessary, the
|
||||
* chart will then be scaled up to fit the requested width).
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
private int maxDrawWidth;
|
||||
|
||||
/**
|
||||
* The largest height at which the chart will be drawn (if necessary, the
|
||||
* chart will then be scaled up to fit the requested height).
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
private int maxDrawHeight;
|
||||
|
||||
/**
|
||||
* Creates a new chart selection.
|
||||
*
|
||||
* @param chart the chart.
|
||||
* @param width the chart width.
|
||||
* @param height the chart height.
|
||||
*/
|
||||
public ChartTransferable(JFreeChart chart, int width, int height) {
|
||||
this(chart, width, height, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new chart selection.
|
||||
*
|
||||
* @param chart the chart.
|
||||
* @param width the chart width.
|
||||
* @param height the chart height.
|
||||
* @param cloneData clone the dataset(s)?
|
||||
*/
|
||||
public ChartTransferable(JFreeChart chart, int width, int height,
|
||||
boolean cloneData) {
|
||||
this(chart, width, height, 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE,
|
||||
true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new chart selection. The minimum and maximum drawing
|
||||
* dimensions are used to match the scaling behaviour in the
|
||||
* {@link ChartPanel} class.
|
||||
*
|
||||
* @param chart the chart.
|
||||
* @param width the chart width.
|
||||
* @param height the chart height.
|
||||
* @param minDrawW the minimum drawing width.
|
||||
* @param minDrawH the minimum drawing height.
|
||||
* @param maxDrawW the maximum drawing width.
|
||||
* @param maxDrawH the maximum drawing height.
|
||||
* @param cloneData clone the dataset(s)?
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
public ChartTransferable(JFreeChart chart, int width, int height,
|
||||
int minDrawW, int minDrawH, int maxDrawW, int maxDrawH,
|
||||
boolean cloneData) {
|
||||
|
||||
// we clone the chart because presumably there can be some delay
|
||||
// between putting this instance on the system clipboard and
|
||||
// actually having the getTransferData() method called...
|
||||
try {
|
||||
this.chart = (JFreeChart) chart.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException e) {
|
||||
this.chart = chart;
|
||||
}
|
||||
// FIXME: we've cloned the chart, but the dataset(s) aren't cloned
|
||||
// and we should do that
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.minDrawWidth = minDrawW;
|
||||
this.minDrawHeight = minDrawH;
|
||||
this.maxDrawWidth = maxDrawW;
|
||||
this.maxDrawHeight = maxDrawH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data flavors supported.
|
||||
*
|
||||
* @return The data flavors supported.
|
||||
*/
|
||||
@Override
|
||||
public DataFlavor[] getTransferDataFlavors() {
|
||||
return new DataFlavor[] {this.imageFlavor};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the specified flavor is supported.
|
||||
*
|
||||
* @param flavor the flavor.
|
||||
*
|
||||
* @return A boolean.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDataFlavorSupported(DataFlavor flavor) {
|
||||
return this.imageFlavor.equals(flavor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content for the requested flavor, if it is supported.
|
||||
*
|
||||
* @param flavor the requested flavor.
|
||||
*
|
||||
* @return The content.
|
||||
*
|
||||
* @throws java.awt.datatransfer.UnsupportedFlavorException
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
@Override
|
||||
public Object getTransferData(DataFlavor flavor)
|
||||
throws UnsupportedFlavorException, IOException {
|
||||
|
||||
if (this.imageFlavor.equals(flavor)) {
|
||||
return createBufferedImage(this.chart, this.width, this.height,
|
||||
this.minDrawWidth, this.minDrawHeight, this.maxDrawWidth,
|
||||
this.maxDrawHeight);
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A utility method that creates an image of a chart, with scaling.
|
||||
*
|
||||
* @param chart the chart.
|
||||
* @param w the image width.
|
||||
* @param h the image height.
|
||||
* @param minDrawW the minimum width for chart drawing.
|
||||
* @param minDrawH the minimum height for chart drawing.
|
||||
* @param maxDrawW the maximum width for chart drawing.
|
||||
* @param maxDrawH the maximum height for chart drawing.
|
||||
*
|
||||
* @return A chart image.
|
||||
*
|
||||
* @since 1.0.14
|
||||
*/
|
||||
private BufferedImage createBufferedImage(JFreeChart chart, int w, int h,
|
||||
int minDrawW, int minDrawH, int maxDrawW, int maxDrawH) {
|
||||
|
||||
BufferedImage image = new BufferedImage(w, h,
|
||||
BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = image.createGraphics();
|
||||
|
||||
// work out if scaling is required...
|
||||
boolean scale = false;
|
||||
double drawWidth = w;
|
||||
double drawHeight = h;
|
||||
double scaleX = 1.0;
|
||||
double scaleY = 1.0;
|
||||
if (drawWidth < minDrawW) {
|
||||
scaleX = drawWidth / minDrawW;
|
||||
drawWidth = minDrawW;
|
||||
scale = true;
|
||||
}
|
||||
else if (drawWidth > maxDrawW) {
|
||||
scaleX = drawWidth / maxDrawW;
|
||||
drawWidth = maxDrawW;
|
||||
scale = true;
|
||||
}
|
||||
if (drawHeight < minDrawH) {
|
||||
scaleY = drawHeight / minDrawH;
|
||||
drawHeight = minDrawH;
|
||||
scale = true;
|
||||
}
|
||||
else if (drawHeight > maxDrawH) {
|
||||
scaleY = drawHeight / maxDrawH;
|
||||
drawHeight = maxDrawH;
|
||||
scale = true;
|
||||
}
|
||||
|
||||
Rectangle2D chartArea = new Rectangle2D.Double(0.0, 0.0, drawWidth,
|
||||
drawHeight);
|
||||
if (scale) {
|
||||
AffineTransform st = AffineTransform.getScaleInstance(scaleX,
|
||||
scaleY);
|
||||
g2.transform(st);
|
||||
}
|
||||
chart.draw(g2, chartArea, null, null);
|
||||
g2.dispose();
|
||||
return image;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,733 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------------
|
||||
* ChartUtilities.java
|
||||
* -------------------
|
||||
* (C) Copyright 2001-2013, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): Wolfgang Irler;
|
||||
* Richard Atkinson;
|
||||
* Xavier Poinsard;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 11-Dec-2001 : Version 1. The JPEG method comes from Wolfgang Irler's
|
||||
* JFreeChartServletDemo class (DG);
|
||||
* 23-Jan-2002 : Changed saveChartAsXXX() methods to pass IOExceptions back to
|
||||
* caller (DG);
|
||||
* 26-Jun-2002 : Added image map methods (DG);
|
||||
* 05-Aug-2002 : Added writeBufferedImage methods
|
||||
* Modified writeImageMap method to support flexible image
|
||||
* maps (RA);
|
||||
* 26-Aug-2002 : Added saveChartAsJPEG and writeChartAsJPEG methods with info
|
||||
* objects (RA);
|
||||
* 05-Sep-2002 : Added writeImageMap() method to support OverLIB
|
||||
* - http://www.bosrup.com/web/overlib (RA);
|
||||
* 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 17-Oct-2002 : Exposed JPEG quality setting and PNG compression level as
|
||||
* parameters (DG);
|
||||
* 25-Oct-2002 : Fixed writeChartAsJPEG() empty method bug (DG);
|
||||
* 13-Mar-2003 : Updated writeImageMap method as suggested by Xavier Poinsard
|
||||
* (see Feature Request 688079) (DG);
|
||||
* 12-Aug-2003 : Added support for custom image maps using
|
||||
* ToolTipTagFragmentGenerator and URLTagFragmentGenerator (RA);
|
||||
* 02-Sep-2003 : Separated PNG encoding from writing chart to an
|
||||
* OutputStream (RA);
|
||||
* 04-Dec-2003 : Chart draw() method modified to include anchor point (DG);
|
||||
* 20-Feb-2004 : Edited Javadocs and added argument checking (DG);
|
||||
* 05-Apr-2004 : Fixed problem with buffered image type (DG);
|
||||
* 01-Aug-2004 : Modified to use EncoderUtil for all image encoding (RA);
|
||||
* 02-Aug-2004 : Delegated image map related functionality to ImageMapUtil (RA);
|
||||
* 13-Jan-2005 : Renamed ImageMapUtil --> ImageMapUtilities, removed method
|
||||
* writeImageMap(PrintWriter, String, ChartRenderingInfo) which
|
||||
* exists in ImageMapUtilities (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 06-Feb-2006 : API doc update (DG);
|
||||
* 19-Mar-2007 : Use try-finally to close output stream in saveChartAsXXX()
|
||||
* methods (DG);
|
||||
* 10-Jan-2008 : Fix bug 1868251 - don't create image with transparency when
|
||||
* saving to JPEG format (DG);
|
||||
* 02-Jul-2013 : Use ParamChecks class (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import org.jfree.chart.encoders.EncoderUtil;
|
||||
import org.jfree.chart.encoders.ImageFormat;
|
||||
import org.jfree.chart.imagemap.ImageMapUtilities;
|
||||
import org.jfree.chart.imagemap.OverLIBToolTipTagFragmentGenerator;
|
||||
import org.jfree.chart.imagemap.StandardToolTipTagFragmentGenerator;
|
||||
import org.jfree.chart.imagemap.StandardURLTagFragmentGenerator;
|
||||
import org.jfree.chart.imagemap.ToolTipTagFragmentGenerator;
|
||||
import org.jfree.chart.imagemap.URLTagFragmentGenerator;
|
||||
import org.jfree.chart.util.ParamChecks;
|
||||
|
||||
/**
|
||||
* A collection of utility methods for JFreeChart. Includes methods for
|
||||
* converting charts to image formats (PNG and JPEG) plus creating simple HTML
|
||||
* image maps.
|
||||
*
|
||||
* @see ImageMapUtilities
|
||||
*/
|
||||
public abstract class ChartUtilities {
|
||||
|
||||
/**
|
||||
* Applies the current theme to the specified chart. This method is
|
||||
* provided for convenience, the theme itself is stored in the
|
||||
* {@link ChartFactory} class.
|
||||
*
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
*
|
||||
* @since 1.0.11
|
||||
*/
|
||||
public static void applyCurrentTheme(JFreeChart chart) {
|
||||
ChartFactory.getChartTheme().apply(chart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in PNG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
|
||||
int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
writeChartAsPNG(out, chart, width, height, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in PNG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param encodeAlpha encode alpha?
|
||||
* @param compression the compression level (0-9).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
|
||||
int width, int height, boolean encodeAlpha, int compression)
|
||||
throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
ChartUtilities.writeChartAsPNG(out, chart, width, height, null,
|
||||
encodeAlpha, compression);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in PNG format. This method allows
|
||||
* you to pass in a {@link ChartRenderingInfo} object, to collect
|
||||
* information about the chart dimensions/entities. You will need this
|
||||
* info if you want to create an HTML image map.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info)
|
||||
throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
BufferedImage bufferedImage
|
||||
= chart.createBufferedImage(width, height, info);
|
||||
EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in PNG format. This method allows
|
||||
* you to pass in a {@link ChartRenderingInfo} object, to collect
|
||||
* information about the chart dimensions/entities. You will need this
|
||||
* info if you want to create an HTML image map.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info carries back chart rendering info (<code>null</code>
|
||||
* permitted).
|
||||
* @param encodeAlpha encode alpha?
|
||||
* @param compression the PNG compression level (0-9).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info,
|
||||
boolean encodeAlpha, int compression) throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(out, "out");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
BufferedImage chartImage = chart.createBufferedImage(width, height,
|
||||
BufferedImage.TYPE_INT_ARGB, info);
|
||||
ChartUtilities.writeBufferedImageAsPNG(out, chartImage, encodeAlpha,
|
||||
compression);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a scaled version of a chart to an output stream in PNG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the unscaled chart width.
|
||||
* @param height the unscaled chart height.
|
||||
* @param widthScaleFactor the horizontal scale factor.
|
||||
* @param heightScaleFactor the vertical scale factor.
|
||||
*
|
||||
* @throws IOException if there are any I/O problems.
|
||||
*/
|
||||
public static void writeScaledChartAsPNG(OutputStream out,
|
||||
JFreeChart chart, int width, int height, int widthScaleFactor,
|
||||
int heightScaleFactor) throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(out, "out");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
|
||||
double desiredWidth = width * widthScaleFactor;
|
||||
double desiredHeight = height * heightScaleFactor;
|
||||
double defaultWidth = width;
|
||||
double defaultHeight = height;
|
||||
boolean scale = false;
|
||||
|
||||
// get desired width and height from somewhere then...
|
||||
if ((widthScaleFactor != 1) || (heightScaleFactor != 1)) {
|
||||
scale = true;
|
||||
}
|
||||
|
||||
double scaleX = desiredWidth / defaultWidth;
|
||||
double scaleY = desiredHeight / defaultHeight;
|
||||
|
||||
BufferedImage image = new BufferedImage((int) desiredWidth,
|
||||
(int) desiredHeight, BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = image.createGraphics();
|
||||
|
||||
if (scale) {
|
||||
AffineTransform saved = g2.getTransform();
|
||||
g2.transform(AffineTransform.getScaleInstance(scaleX, scaleY));
|
||||
chart.draw(g2, new Rectangle2D.Double(0, 0, defaultWidth,
|
||||
defaultHeight), null, null);
|
||||
g2.setTransform(saved);
|
||||
g2.dispose();
|
||||
}
|
||||
else {
|
||||
chart.draw(g2, new Rectangle2D.Double(0, 0, defaultWidth,
|
||||
defaultHeight), null, null);
|
||||
}
|
||||
out.write(encodeAsPNG(image));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to the specified file in PNG format.
|
||||
*
|
||||
* @param file the file name (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsPNG(File file, JFreeChart chart,
|
||||
int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
saveChartAsPNG(file, chart, width, height, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in PNG format. This method allows you to pass
|
||||
* in a {@link ChartRenderingInfo} object, to collect information about the
|
||||
* chart dimensions/entities. You will need this info if you want to
|
||||
* create an HTML image map.
|
||||
*
|
||||
* @param file the file (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsPNG(File file, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info)
|
||||
throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(file, "file");
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
try {
|
||||
ChartUtilities.writeChartAsPNG(out, chart, width, height, info);
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in PNG format. This method allows you to pass
|
||||
* in a {@link ChartRenderingInfo} object, to collect information about the
|
||||
* chart dimensions/entities. You will need this info if you want to
|
||||
* create an HTML image map.
|
||||
*
|
||||
* @param file the file (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
* @param encodeAlpha encode alpha?
|
||||
* @param compression the PNG compression level (0-9).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsPNG(File file, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info, boolean encodeAlpha,
|
||||
int compression) throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(file, "file");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
try {
|
||||
writeChartAsPNG(out, chart, width, height, info, encodeAlpha,
|
||||
compression);
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in JPEG format. Please note that
|
||||
* JPEG is a poor format for chart images, use PNG if possible.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsJPEG(OutputStream out,
|
||||
JFreeChart chart, int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
writeChartAsJPEG(out, chart, width, height, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in JPEG format. Please note that
|
||||
* JPEG is a poor format for chart images, use PNG if possible.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param quality the quality setting.
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsJPEG(OutputStream out, float quality,
|
||||
JFreeChart chart, int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
ChartUtilities.writeChartAsJPEG(out, quality, chart, width, height,
|
||||
null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in JPEG format. This method allows
|
||||
* you to pass in a {@link ChartRenderingInfo} object, to collect
|
||||
* information about the chart dimensions/entities. You will need this
|
||||
* info if you want to create an HTML image map.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info)
|
||||
throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(out, "out");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
BufferedImage image = chart.createBufferedImage(width, height,
|
||||
BufferedImage.TYPE_INT_RGB, info);
|
||||
EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a chart to an output stream in JPEG format. This method allows
|
||||
* you to pass in a {@link ChartRenderingInfo} object, to collect
|
||||
* information about the chart dimensions/entities. You will need this
|
||||
* info if you want to create an HTML image map.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param quality the output quality (0.0f to 1.0f).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeChartAsJPEG(OutputStream out, float quality,
|
||||
JFreeChart chart, int width, int height, ChartRenderingInfo info)
|
||||
throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(out, "out");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
BufferedImage image = chart.createBufferedImage(width, height,
|
||||
BufferedImage.TYPE_INT_RGB, info);
|
||||
EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in JPEG format.
|
||||
*
|
||||
* @param file the file (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsJPEG(File file, JFreeChart chart,
|
||||
int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
saveChartAsJPEG(file, chart, width, height, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in JPEG format.
|
||||
*
|
||||
* @param file the file (<code>null</code> not permitted).
|
||||
* @param quality the JPEG quality setting.
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsJPEG(File file, float quality,
|
||||
JFreeChart chart, int width, int height) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
saveChartAsJPEG(file, quality, chart, width, height, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in JPEG format. This method allows you to pass
|
||||
* in a {@link ChartRenderingInfo} object, to collect information about the
|
||||
* chart dimensions/entities. You will need this info if you want to
|
||||
* create an HTML image map.
|
||||
*
|
||||
* @param file the file name (<code>null</code> not permitted).
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsJPEG(File file, JFreeChart chart,
|
||||
int width, int height, ChartRenderingInfo info) throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(file, "file");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
try {
|
||||
writeChartAsJPEG(out, chart, width, height, info);
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a chart to a file in JPEG format. This method allows you to pass
|
||||
* in a {@link ChartRenderingInfo} object, to collect information about the
|
||||
* chart dimensions/entities. You will need this info if you want to
|
||||
* create an HTML image map.
|
||||
*
|
||||
* @param file the file name (<code>null</code> not permitted).
|
||||
* @param quality the quality setting.
|
||||
* @param chart the chart (<code>null</code> not permitted).
|
||||
* @param width the image width.
|
||||
* @param height the image height.
|
||||
* @param info the chart rendering info (<code>null</code> permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void saveChartAsJPEG(File file, float quality,
|
||||
JFreeChart chart, int width, int height,
|
||||
ChartRenderingInfo info) throws IOException {
|
||||
|
||||
ParamChecks.nullNotPermitted(file, "file");
|
||||
ParamChecks.nullNotPermitted(chart, "chart");
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(
|
||||
file));
|
||||
try {
|
||||
writeChartAsJPEG(out, quality, chart, width, height, info);
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link BufferedImage} to an output stream in JPEG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeBufferedImageAsJPEG(OutputStream out,
|
||||
BufferedImage image) throws IOException {
|
||||
|
||||
// defer argument checking...
|
||||
writeBufferedImageAsJPEG(out, 0.75f, image);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link BufferedImage} to an output stream in JPEG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param quality the image quality (0.0f to 1.0f).
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeBufferedImageAsJPEG(OutputStream out, float quality,
|
||||
BufferedImage image) throws IOException {
|
||||
|
||||
EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link BufferedImage} to an output stream in PNG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeBufferedImageAsPNG(OutputStream out,
|
||||
BufferedImage image) throws IOException {
|
||||
|
||||
EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@link BufferedImage} to an output stream in PNG format.
|
||||
*
|
||||
* @param out the output stream (<code>null</code> not permitted).
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
* @param encodeAlpha encode alpha?
|
||||
* @param compression the compression level (0-9).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeBufferedImageAsPNG(OutputStream out,
|
||||
BufferedImage image, boolean encodeAlpha, int compression)
|
||||
throws IOException {
|
||||
|
||||
EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
|
||||
compression, encodeAlpha);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a {@link BufferedImage} to PNG format.
|
||||
*
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
*
|
||||
* @return A byte array in PNG format.
|
||||
*
|
||||
* @throws IOException if there is an I/O problem.
|
||||
*/
|
||||
public static byte[] encodeAsPNG(BufferedImage image) throws IOException {
|
||||
return EncoderUtil.encode(image, ImageFormat.PNG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a {@link BufferedImage} to PNG format.
|
||||
*
|
||||
* @param image the image (<code>null</code> not permitted).
|
||||
* @param encodeAlpha encode alpha?
|
||||
* @param compression the PNG compression level (0-9).
|
||||
*
|
||||
* @return The byte array in PNG format.
|
||||
*
|
||||
* @throws IOException if there is an I/O problem.
|
||||
*/
|
||||
public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha,
|
||||
int compression) throws IOException {
|
||||
return EncoderUtil.encode(image, ImageFormat.PNG, compression,
|
||||
encodeAlpha);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes an image map to an output stream.
|
||||
*
|
||||
* @param writer the writer (<code>null</code> not permitted).
|
||||
* @param name the map name (<code>null</code> not permitted).
|
||||
* @param info the chart rendering info (<code>null</code> not permitted).
|
||||
* @param useOverLibForToolTips whether to use OverLIB for tooltips
|
||||
* (http://www.bosrup.com/web/overlib/).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeImageMap(PrintWriter writer, String name,
|
||||
ChartRenderingInfo info, boolean useOverLibForToolTips)
|
||||
throws IOException {
|
||||
|
||||
ToolTipTagFragmentGenerator toolTipTagFragmentGenerator;
|
||||
if (useOverLibForToolTips) {
|
||||
toolTipTagFragmentGenerator
|
||||
= new OverLIBToolTipTagFragmentGenerator();
|
||||
}
|
||||
else {
|
||||
toolTipTagFragmentGenerator
|
||||
= new StandardToolTipTagFragmentGenerator();
|
||||
}
|
||||
ImageMapUtilities.writeImageMap(writer, name, info,
|
||||
toolTipTagFragmentGenerator,
|
||||
new StandardURLTagFragmentGenerator());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes an image map to the specified writer.
|
||||
*
|
||||
* @param writer the writer (<code>null</code> not permitted).
|
||||
* @param name the map name (<code>null</code> not permitted).
|
||||
* @param info the chart rendering info (<code>null</code> not permitted).
|
||||
* @param toolTipTagFragmentGenerator a generator for the HTML fragment
|
||||
* that will contain the tooltip text (<code>null</code> not permitted
|
||||
* if <code>info</code> contains tooltip information).
|
||||
* @param urlTagFragmentGenerator a generator for the HTML fragment that
|
||||
* will contain the URL reference (<code>null</code> not permitted if
|
||||
* <code>info</code> contains URLs).
|
||||
*
|
||||
* @throws IOException if there are any I/O errors.
|
||||
*/
|
||||
public static void writeImageMap(PrintWriter writer, String name,
|
||||
ChartRenderingInfo info,
|
||||
ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
|
||||
URLTagFragmentGenerator urlTagFragmentGenerator)
|
||||
throws IOException {
|
||||
|
||||
writer.println(ImageMapUtilities.getImageMap(name, info,
|
||||
toolTipTagFragmentGenerator, urlTagFragmentGenerator));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an HTML image map. This method maps to
|
||||
* {@link ImageMapUtilities#getImageMap(String, ChartRenderingInfo,
|
||||
* ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}, using default
|
||||
* generators.
|
||||
*
|
||||
* @param name the map name (<code>null</code> not permitted).
|
||||
* @param info the chart rendering info (<code>null</code> not permitted).
|
||||
*
|
||||
* @return The map tag.
|
||||
*/
|
||||
public static String getImageMap(String name, ChartRenderingInfo info) {
|
||||
return ImageMapUtilities.getImageMap(name, info,
|
||||
new StandardToolTipTagFragmentGenerator(),
|
||||
new StandardURLTagFragmentGenerator());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an HTML image map. This method maps directly to
|
||||
* {@link ImageMapUtilities#getImageMap(String, ChartRenderingInfo,
|
||||
* ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}.
|
||||
*
|
||||
* @param name the map name (<code>null</code> not permitted).
|
||||
* @param info the chart rendering info (<code>null</code> not permitted).
|
||||
* @param toolTipTagFragmentGenerator a generator for the HTML fragment
|
||||
* that will contain the tooltip text (<code>null</code> not permitted
|
||||
* if <code>info</code> contains tooltip information).
|
||||
* @param urlTagFragmentGenerator a generator for the HTML fragment that
|
||||
* will contain the URL reference (<code>null</code> not permitted if
|
||||
* <code>info</code> contains URLs).
|
||||
*
|
||||
* @return The map tag.
|
||||
*/
|
||||
public static String getImageMap(String name, ChartRenderingInfo info,
|
||||
ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
|
||||
URLTagFragmentGenerator urlTagFragmentGenerator) {
|
||||
|
||||
return ImageMapUtilities.getImageMap(name, info,
|
||||
toolTipTagFragmentGenerator, urlTagFragmentGenerator);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,440 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------
|
||||
* ClipPath.java
|
||||
* -------------
|
||||
* (C) Copyright 2003-2013, by David M. O'Donnell and Contributors.
|
||||
*
|
||||
* Original Author: David M. O'Donnell;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
* Nicolas Brodu;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 22-Apr-2003 : Added standard header (DG);
|
||||
* 09-May-2003 : Added AxisLocation (DG);
|
||||
* 11-Sep-2003 : Implemented Cloneable (NB);
|
||||
* 21-Jan-2004 : Update for renamed method in ValueAxis (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 31-Jan-2007 : Deprecated (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Composite;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Paint;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYBlockRenderer;
|
||||
import org.jfree.ui.RectangleEdge;
|
||||
|
||||
/**
|
||||
* This class would typically be used with a
|
||||
* {@link org.jfree.chart.plot.ContourPlot}. It allows the user to define a
|
||||
* <code>GeneralPath</code> curve in plot coordinates. This curve can then be
|
||||
* used mask off or define regions within the contour plot. The data must be
|
||||
* sorted.
|
||||
*
|
||||
* @deprecated This class is no longer supported (as of version 1.0.4). If
|
||||
* you are creating contour plots, please try to use {@link XYPlot} and
|
||||
* {@link XYBlockRenderer}.
|
||||
*/
|
||||
public class ClipPath implements Cloneable {
|
||||
|
||||
/** The x values. */
|
||||
private double[] xValue = null;
|
||||
|
||||
/** The y values. */
|
||||
private double[] yValue = null;
|
||||
|
||||
/** Controls whether drawing will be clipped (
|
||||
* false would still allow the drawing or filling of path */
|
||||
private boolean clip = true;
|
||||
|
||||
/** Controls whether the path is drawn as an outline. */
|
||||
private boolean drawPath = false;
|
||||
|
||||
/** Controls whether the path is filled. */
|
||||
private boolean fillPath = false;
|
||||
|
||||
/** The fill paint. */
|
||||
private Paint fillPaint = null;
|
||||
|
||||
/** The draw paint. */
|
||||
private Paint drawPaint = null;
|
||||
|
||||
/** The draw stroke. */
|
||||
private Stroke drawStroke = null;
|
||||
|
||||
/** The composite. */
|
||||
private Composite composite = null;
|
||||
|
||||
/**
|
||||
* Constructor for ClipPath.
|
||||
*/
|
||||
public ClipPath() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for ClipPath.
|
||||
* Default values are assumed for the fillPath and drawPath options as
|
||||
* false and true respectively. The fillPaint is set to Color.GRAY, the
|
||||
* drawColor is Color.BLUE, the stroke is BasicStroke(1)
|
||||
* and the composite is AlphaComposite.Src.
|
||||
*
|
||||
* @param xValue x coordinates of curved to be created
|
||||
* @param yValue y coordinates of curved to be created
|
||||
*/
|
||||
public ClipPath(double[] xValue, double[] yValue) {
|
||||
this(xValue, yValue, true, false, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for ClipPath.
|
||||
* The fillPaint is set to Color.GRAY, the drawColor is Color.BLUE, the
|
||||
* stroke is BasicStroke(1) and the composite is AlphaComposite.Src.
|
||||
*
|
||||
* @param xValue x coordinates of curved to be created
|
||||
* @param yValue y coordinates of curved to be created
|
||||
* @param clip clip?
|
||||
* @param fillPath whether the path is to filled
|
||||
* @param drawPath whether the path is to drawn as an outline
|
||||
*/
|
||||
public ClipPath(double[] xValue, double[] yValue,
|
||||
boolean clip, boolean fillPath, boolean drawPath) {
|
||||
this.xValue = xValue;
|
||||
this.yValue = yValue;
|
||||
|
||||
this.clip = clip;
|
||||
this.fillPath = fillPath;
|
||||
this.drawPath = drawPath;
|
||||
|
||||
this.fillPaint = java.awt.Color.gray;
|
||||
this.drawPaint = java.awt.Color.blue;
|
||||
this.drawStroke = new BasicStroke(1);
|
||||
this.composite = java.awt.AlphaComposite.Src;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for ClipPath.
|
||||
*
|
||||
* @param xValue x coordinates of curved to be created
|
||||
* @param yValue y coordinates of curved to be created
|
||||
* @param fillPath whether the path is to filled
|
||||
* @param drawPath whether the path is to drawn as an outline
|
||||
* @param fillPaint the fill paint
|
||||
* @param drawPaint the outline stroke color
|
||||
* @param drawStroke the stroke style
|
||||
* @param composite the composite rule
|
||||
*/
|
||||
public ClipPath(double[] xValue, double[] yValue, boolean fillPath,
|
||||
boolean drawPath, Paint fillPaint, Paint drawPaint,
|
||||
Stroke drawStroke, Composite composite) {
|
||||
|
||||
this.xValue = xValue;
|
||||
this.yValue = yValue;
|
||||
|
||||
this.fillPath = fillPath;
|
||||
this.drawPath = drawPath;
|
||||
|
||||
this.fillPaint = fillPaint;
|
||||
this.drawPaint = drawPaint;
|
||||
this.drawStroke = drawStroke;
|
||||
this.composite = composite;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the clip path.
|
||||
*
|
||||
* @param g2 current graphics2D.
|
||||
* @param dataArea the dataArea that the plot is being draw in.
|
||||
* @param horizontalAxis the horizontal axis.
|
||||
* @param verticalAxis the vertical axis.
|
||||
*
|
||||
* @return The GeneralPath defining the outline
|
||||
*/
|
||||
public GeneralPath draw(Graphics2D g2,
|
||||
Rectangle2D dataArea,
|
||||
ValueAxis horizontalAxis, ValueAxis verticalAxis) {
|
||||
|
||||
GeneralPath generalPath = generateClipPath(
|
||||
dataArea, horizontalAxis, verticalAxis
|
||||
);
|
||||
if (this.fillPath || this.drawPath) {
|
||||
Composite saveComposite = g2.getComposite();
|
||||
Paint savePaint = g2.getPaint();
|
||||
Stroke saveStroke = g2.getStroke();
|
||||
|
||||
if (this.fillPaint != null) {
|
||||
g2.setPaint(this.fillPaint);
|
||||
}
|
||||
if (this.composite != null) {
|
||||
g2.setComposite(this.composite);
|
||||
}
|
||||
if (this.fillPath) {
|
||||
g2.fill(generalPath);
|
||||
}
|
||||
|
||||
if (this.drawStroke != null) {
|
||||
g2.setStroke(this.drawStroke);
|
||||
}
|
||||
if (this.drawPath) {
|
||||
g2.draw(generalPath);
|
||||
}
|
||||
g2.setPaint(savePaint);
|
||||
g2.setComposite(saveComposite);
|
||||
g2.setStroke(saveStroke);
|
||||
}
|
||||
return generalPath;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the clip path.
|
||||
*
|
||||
* @param dataArea the dataArea that the plot is being draw in.
|
||||
* @param horizontalAxis the horizontal axis.
|
||||
* @param verticalAxis the vertical axis.
|
||||
*
|
||||
* @return The GeneralPath defining the outline
|
||||
*/
|
||||
public GeneralPath generateClipPath(Rectangle2D dataArea,
|
||||
ValueAxis horizontalAxis,
|
||||
ValueAxis verticalAxis) {
|
||||
|
||||
GeneralPath generalPath = new GeneralPath();
|
||||
double transX = horizontalAxis.valueToJava2D(
|
||||
this.xValue[0], dataArea, RectangleEdge.BOTTOM
|
||||
);
|
||||
double transY = verticalAxis.valueToJava2D(
|
||||
this.yValue[0], dataArea, RectangleEdge.LEFT
|
||||
);
|
||||
generalPath.moveTo((float) transX, (float) transY);
|
||||
for (int k = 0; k < this.yValue.length; k++) {
|
||||
transX = horizontalAxis.valueToJava2D(
|
||||
this.xValue[k], dataArea, RectangleEdge.BOTTOM
|
||||
);
|
||||
transY = verticalAxis.valueToJava2D(
|
||||
this.yValue[k], dataArea, RectangleEdge.LEFT
|
||||
);
|
||||
generalPath.lineTo((float) transX, (float) transY);
|
||||
}
|
||||
generalPath.closePath();
|
||||
|
||||
return generalPath;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the composite.
|
||||
*
|
||||
* @return Composite
|
||||
*/
|
||||
public Composite getComposite() {
|
||||
return this.composite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the drawPaint.
|
||||
*
|
||||
* @return Paint
|
||||
*/
|
||||
public Paint getDrawPaint() {
|
||||
return this.drawPaint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the drawPath.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDrawPath() {
|
||||
return this.drawPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the drawStroke.
|
||||
*
|
||||
* @return Stroke
|
||||
*/
|
||||
public Stroke getDrawStroke() {
|
||||
return this.drawStroke;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the fillPaint.
|
||||
*
|
||||
* @return Paint
|
||||
*/
|
||||
public Paint getFillPaint() {
|
||||
return this.fillPaint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the fillPath.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isFillPath() {
|
||||
return this.fillPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the xValue.
|
||||
*
|
||||
* @return double[]
|
||||
*/
|
||||
public double[] getXValue() {
|
||||
return this.xValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the yValue.
|
||||
*
|
||||
* @return double[]
|
||||
*/
|
||||
public double[] getYValue() {
|
||||
return this.yValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the composite.
|
||||
*
|
||||
* @param composite The composite to set
|
||||
*/
|
||||
public void setComposite(Composite composite) {
|
||||
this.composite = composite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the drawPaint.
|
||||
*
|
||||
* @param drawPaint The drawPaint to set
|
||||
*/
|
||||
public void setDrawPaint(Paint drawPaint) {
|
||||
this.drawPaint = drawPaint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the drawPath.
|
||||
*
|
||||
* @param drawPath The drawPath to set
|
||||
*/
|
||||
public void setDrawPath(boolean drawPath) {
|
||||
this.drawPath = drawPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the drawStroke.
|
||||
*
|
||||
* @param drawStroke The drawStroke to set
|
||||
*/
|
||||
public void setDrawStroke(Stroke drawStroke) {
|
||||
this.drawStroke = drawStroke;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fillPaint.
|
||||
*
|
||||
* @param fillPaint The fillPaint to set
|
||||
*/
|
||||
public void setFillPaint(Paint fillPaint) {
|
||||
this.fillPaint = fillPaint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fillPath.
|
||||
*
|
||||
* @param fillPath The fillPath to set
|
||||
*/
|
||||
public void setFillPath(boolean fillPath) {
|
||||
this.fillPath = fillPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the xValue.
|
||||
*
|
||||
* @param xValue The xValue to set
|
||||
*/
|
||||
public void setXValue(double[] xValue) {
|
||||
this.xValue = xValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the yValue.
|
||||
*
|
||||
* @param yValue The yValue to set
|
||||
*/
|
||||
public void setYValue(double[] yValue) {
|
||||
this.yValue = yValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the clip.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isClip() {
|
||||
return this.clip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the clip.
|
||||
*
|
||||
* @param clip The clip to set
|
||||
*/
|
||||
public void setClip(boolean clip) {
|
||||
this.clip = clip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a clone of the object (a deeper clone than default to avoid bugs
|
||||
* when setting values in cloned object).
|
||||
*
|
||||
* @return The clone.
|
||||
*
|
||||
* @throws CloneNotSupportedException if cloning is not supported.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
ClipPath clone = (ClipPath) super.clone();
|
||||
clone.xValue = (double[]) this.xValue.clone();
|
||||
clone.yValue = (double[]) this.yValue.clone();
|
||||
return clone;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -----------------------
|
||||
* DrawableLegendItem.java
|
||||
* -----------------------
|
||||
* (C) Copyright 2002-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): Luke Quinane;
|
||||
* Barak Naveh;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 07-Feb-2002 : Version 1 (DG);
|
||||
* 23-Sep-2002 : Renamed LegendItem --> DrawableLegendItem (DG);
|
||||
* 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 08-Oct-2003 : Applied patch for displaying series line style, contributed by
|
||||
* Luke Quinane (DG);
|
||||
* 27-Mar-2004 : Added getMaxX() and getMaxY() methods (BN);
|
||||
* 27-Jan-2005 : Cleared out code that belongs in the LegendItem class (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
/**
|
||||
* This class contains a single legend item along with position details for
|
||||
* drawing the item on a particular chart.
|
||||
*
|
||||
* @deprecated This class is not used by JFreeChart.
|
||||
*/
|
||||
public class DrawableLegendItem {
|
||||
|
||||
/**
|
||||
* The legend item (encapsulates information about the label, color and
|
||||
* shape).
|
||||
*/
|
||||
private LegendItem item;
|
||||
|
||||
/** The x-coordinate for the item's location. */
|
||||
private double x;
|
||||
|
||||
/** The y-coordinate for the item's location. */
|
||||
private double y;
|
||||
|
||||
/** The width of the item. */
|
||||
private double width;
|
||||
|
||||
/** The height of the item. */
|
||||
private double height;
|
||||
|
||||
/** A shape used to indicate color on the legend. */
|
||||
private Shape marker;
|
||||
|
||||
/** A line used to indicate the series stroke on the legend */
|
||||
private Line2D line;
|
||||
|
||||
/** The label position within the item. */
|
||||
private Point2D labelPosition;
|
||||
|
||||
/**
|
||||
* Create a legend item.
|
||||
*
|
||||
* @param item the legend item for display.
|
||||
*/
|
||||
public DrawableLegendItem(LegendItem item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the legend item.
|
||||
*
|
||||
* @return The legend item.
|
||||
*/
|
||||
public LegendItem getItem() {
|
||||
return this.item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the x-coordinate for the item's location.
|
||||
*
|
||||
* @return The x-coordinate for the item's location.
|
||||
*/
|
||||
public double getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the x-coordinate for the item's location.
|
||||
*
|
||||
* @param x the x-coordinate.
|
||||
*/
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the y-coordinate for the item's location.
|
||||
*
|
||||
* @return The y-coordinate for the item's location.
|
||||
*/
|
||||
public double getY() {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the y-coordinate for the item's location.
|
||||
*
|
||||
* @param y the y-coordinate.
|
||||
*/
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the width of this item.
|
||||
*
|
||||
* @return The width.
|
||||
*/
|
||||
public double getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the height of this item.
|
||||
*
|
||||
* @return The height.
|
||||
*/
|
||||
public double getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the largest X coordinate of the framing rectangle of this legend
|
||||
* item.
|
||||
*
|
||||
* @return The largest x coordinate of the framing rectangle of this legend
|
||||
* item.
|
||||
*/
|
||||
public double getMaxX() {
|
||||
return getX() + getWidth();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the largest Y coordinate of the framing rectangle of this legend
|
||||
* item.
|
||||
*
|
||||
* @return The largest Y coordinate of the framing rectangle of this legend
|
||||
* item.
|
||||
*/
|
||||
public double getMaxY() {
|
||||
return getY() + getHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the marker.
|
||||
*
|
||||
* @return The shape used to indicate color on the legend for this item.
|
||||
*/
|
||||
public Shape getMarker() {
|
||||
return this.marker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the marker.
|
||||
*
|
||||
* @param marker a shape used to indicate color on the legend for this
|
||||
* item.
|
||||
*/
|
||||
public void setMarker(Shape marker) {
|
||||
this.marker = marker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the line used to label this series.
|
||||
*
|
||||
* @param l the new line to use.
|
||||
*/
|
||||
public void setLine(Line2D l) {
|
||||
this.line = l;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list.
|
||||
*
|
||||
* @return The line.
|
||||
*/
|
||||
public Line2D getLine() {
|
||||
return this.line;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label position.
|
||||
*
|
||||
* @return The label position.
|
||||
*/
|
||||
public Point2D getLabelPosition() {
|
||||
return this.labelPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the label position.
|
||||
*
|
||||
* @param position the label position.
|
||||
*/
|
||||
public void setLabelPosition(Point2D position) {
|
||||
this.labelPosition = position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the bounds of this item.
|
||||
*
|
||||
* @param x x-coordinate for the item's location.
|
||||
* @param y y-coordinate for the item's location.
|
||||
* @param width the width of this item.
|
||||
* @param height the height of this item.
|
||||
*/
|
||||
public void setBounds(double x, double y, double width, double height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------
|
||||
* Effect3D.java
|
||||
* -------------
|
||||
* (C) Copyright 2002-2008, by Object Refinery Limited.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-Nov-2002 : Version 1 (DG);
|
||||
* 14-Nov-2002 : Modified to have independent x and y offsets (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
/**
|
||||
* An interface that should be implemented by renderers that use a 3D effect.
|
||||
* This allows the axes to mirror the same effect by querying the renderer.
|
||||
*/
|
||||
public interface Effect3D {
|
||||
|
||||
/**
|
||||
* Returns the x-offset (in Java2D units) for the 3D effect.
|
||||
*
|
||||
* @return The offset.
|
||||
*/
|
||||
public double getXOffset();
|
||||
|
||||
/**
|
||||
* Returns the y-offset (in Java2D units) for the 3D effect.
|
||||
*
|
||||
* @return The offset.
|
||||
*/
|
||||
public double getYOffset();
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ------------------
|
||||
* HashUtilities.java
|
||||
* ------------------
|
||||
* (C) Copyright 2006-2013, by Object Refinery Limited;
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 03-Oct-2006 : Version 1 (DG);
|
||||
* 06-Mar-2007 : Fix for hashCodeForDoubleArray() method (DG);
|
||||
* 13-Nov-2007 : Added new utility methods (DG);
|
||||
* 22-Nov-2007 : Added hashCode() method for 'int' (DG);
|
||||
* 05-Dec-2007 : Added special methods to handle BooleanList, PaintList,
|
||||
* and StrokeList (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.GradientPaint;
|
||||
import java.awt.Paint;
|
||||
import java.awt.Stroke;
|
||||
|
||||
import org.jfree.util.BooleanList;
|
||||
import org.jfree.util.PaintList;
|
||||
import org.jfree.util.StrokeList;
|
||||
|
||||
/**
|
||||
* Some utility methods for calculating hash codes.
|
||||
*
|
||||
* @since 1.0.3
|
||||
*/
|
||||
public class HashUtilities {
|
||||
|
||||
/**
|
||||
* Returns a hash code for a <code>Paint</code> instance. If
|
||||
* <code>p</code> is <code>null</code>, this method returns zero.
|
||||
*
|
||||
* @param p the paint (<code>null</code> permitted).
|
||||
*
|
||||
* @return The hash code.
|
||||
*/
|
||||
public static int hashCodeForPaint(Paint p) {
|
||||
if (p == null) {
|
||||
return 0;
|
||||
}
|
||||
int result;
|
||||
// handle GradientPaint as a special case
|
||||
if (p instanceof GradientPaint) {
|
||||
GradientPaint gp = (GradientPaint) p;
|
||||
result = 193;
|
||||
result = 37 * result + gp.getColor1().hashCode();
|
||||
result = 37 * result + gp.getPoint1().hashCode();
|
||||
result = 37 * result + gp.getColor2().hashCode();
|
||||
result = 37 * result + gp.getPoint2().hashCode();
|
||||
}
|
||||
else {
|
||||
// we assume that all other Paint instances implement equals() and
|
||||
// hashCode()...of course that might not be true, but what can we
|
||||
// do about it?
|
||||
result = p.hashCode();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash code for a <code>double[]</code> instance. If the array
|
||||
* is <code>null</code>, this method returns zero.
|
||||
*
|
||||
* @param a the array (<code>null</code> permitted).
|
||||
*
|
||||
* @return The hash code.
|
||||
*/
|
||||
public static int hashCodeForDoubleArray(double[] a) {
|
||||
if (a == null) {
|
||||
return 0;
|
||||
}
|
||||
int result = 193;
|
||||
long temp;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
temp = Double.doubleToLongBits(a[i]);
|
||||
result = 29 * result + (int) (temp ^ (temp >>> 32));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and the value of a boolean
|
||||
* primitive.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param b the boolean value.
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, boolean b) {
|
||||
return 37 * pre + (b ? 0 : 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and the value of an int
|
||||
* primitive.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param i the int value.
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.8
|
||||
*/
|
||||
public static int hashCode(int pre, int i) {
|
||||
return 37 * pre + i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and the value of a double
|
||||
* primitive.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param d the double value.
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, double d) {
|
||||
long l = Double.doubleToLongBits(d);
|
||||
return 37 * pre + (int) (l ^ (l >>> 32));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and a paint instance.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param p the paint (<code>null</code> permitted).
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, Paint p) {
|
||||
return 37 * pre + hashCodeForPaint(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and a stroke instance.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param s the stroke (<code>null</code> permitted).
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, Stroke s) {
|
||||
int h = (s != null ? s.hashCode() : 0);
|
||||
return 37 * pre + h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and a string instance.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param s the string (<code>null</code> permitted).
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, String s) {
|
||||
int h = (s != null ? s.hashCode() : 0);
|
||||
return 37 * pre + h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and a <code>Comparable</code>
|
||||
* instance.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param c the comparable (<code>null</code> permitted).
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*/
|
||||
public static int hashCode(int pre, Comparable c) {
|
||||
int h = (c != null ? c.hashCode() : 0);
|
||||
return 37 * pre + h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash value based on a seed value and an <code>Object</code>
|
||||
* instance.
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param obj the object (<code>null</code> permitted).
|
||||
*
|
||||
* @return A hash value.
|
||||
*
|
||||
* @since 1.0.8
|
||||
*/
|
||||
public static int hashCode(int pre, Object obj) {
|
||||
int h = (obj != null ? obj.hashCode() : 0);
|
||||
return 37 * pre + h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a hash code for a {@link BooleanList}. In the latest version
|
||||
* of JCommon, the {@link BooleanList} class should implement the hashCode()
|
||||
* method correctly, but we compute it here anyway so that we can work with
|
||||
* older versions of JCommon (back to 1.0.0).
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param list the list (<code>null</code> permitted).
|
||||
*
|
||||
* @return The hash code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*/
|
||||
public static int hashCode(int pre, BooleanList list) {
|
||||
if (list == null) {
|
||||
return pre;
|
||||
}
|
||||
int result = 127;
|
||||
int size = list.size();
|
||||
result = HashUtilities.hashCode(result, size);
|
||||
|
||||
// for efficiency, we just use the first, last and middle items to
|
||||
// compute a hashCode...
|
||||
if (size > 0) {
|
||||
result = HashUtilities.hashCode(result, list.getBoolean(0));
|
||||
if (size > 1) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getBoolean(size - 1));
|
||||
if (size > 2) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getBoolean(size / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
return 37 * pre + result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a hash code for a {@link PaintList}. In the latest version
|
||||
* of JCommon, the {@link PaintList} class should implement the hashCode()
|
||||
* method correctly, but we compute it here anyway so that we can work with
|
||||
* older versions of JCommon (back to 1.0.0).
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param list the list (<code>null</code> permitted).
|
||||
*
|
||||
* @return The hash code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*/
|
||||
public static int hashCode(int pre, PaintList list) {
|
||||
if (list == null) {
|
||||
return pre;
|
||||
}
|
||||
int result = 127;
|
||||
int size = list.size();
|
||||
result = HashUtilities.hashCode(result, size);
|
||||
|
||||
// for efficiency, we just use the first, last and middle items to
|
||||
// compute a hashCode...
|
||||
if (size > 0) {
|
||||
result = HashUtilities.hashCode(result, list.getPaint(0));
|
||||
if (size > 1) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getPaint(size - 1));
|
||||
if (size > 2) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getPaint(size / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
return 37 * pre + result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a hash code for a {@link StrokeList}. In the latest version
|
||||
* of JCommon, the {@link StrokeList} class should implement the hashCode()
|
||||
* method correctly, but we compute it here anyway so that we can work with
|
||||
* older versions of JCommon (back to 1.0.0).
|
||||
*
|
||||
* @param pre the seed value.
|
||||
* @param list the list (<code>null</code> permitted).
|
||||
*
|
||||
* @return The hash code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*/
|
||||
public static int hashCode(int pre, StrokeList list) {
|
||||
if (list == null) {
|
||||
return pre;
|
||||
}
|
||||
int result = 127;
|
||||
int size = list.size();
|
||||
result = HashUtilities.hashCode(result, size);
|
||||
|
||||
// for efficiency, we just use the first, last and middle items to
|
||||
// compute a hashCode...
|
||||
if (size > 0) {
|
||||
result = HashUtilities.hashCode(result, list.getStroke(0));
|
||||
if (size > 1) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getStroke(size - 1));
|
||||
if (size > 2) {
|
||||
result = HashUtilities.hashCode(result,
|
||||
list.getStroke(size / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
return 37 * pre + result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------------------
|
||||
* LegendItemCollection.java
|
||||
* -------------------------
|
||||
* (C) Copyright 2002-2013, by Object Refinery Limited.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 07-Feb-2002 : Version 1 (DG);
|
||||
* 24-Sep-2002 : Added get(int) and getItemCount() methods (DG);
|
||||
* 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);
|
||||
* 18-Apr-2005 : Added equals() method and implemented Cloneable and
|
||||
* Serializable (DG);
|
||||
* 23-Apr-2008 : Fixed clone() method (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jfree.util.ObjectUtilities;
|
||||
|
||||
/**
|
||||
* A collection of legend items.
|
||||
*/
|
||||
public class LegendItemCollection implements Cloneable, Serializable {
|
||||
|
||||
/** For serialization. */
|
||||
private static final long serialVersionUID = 1365215565589815953L;
|
||||
|
||||
/** Storage for the legend items. */
|
||||
private List items;
|
||||
|
||||
/**
|
||||
* Constructs a new legend item collection, initially empty.
|
||||
*/
|
||||
public LegendItemCollection() {
|
||||
this.items = new java.util.ArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a legend item to the collection.
|
||||
*
|
||||
* @param item the item to add.
|
||||
*/
|
||||
public void add(LegendItem item) {
|
||||
this.items.add(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the legend items from another collection to this collection.
|
||||
*
|
||||
* @param collection the other collection (<code>null</code> not
|
||||
* permitted).
|
||||
*/
|
||||
public void addAll(LegendItemCollection collection) {
|
||||
this.items.addAll(collection.items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a legend item from the collection.
|
||||
*
|
||||
* @param index the legend item index (zero-based).
|
||||
*
|
||||
* @return The legend item.
|
||||
*/
|
||||
public LegendItem get(int index) {
|
||||
return (LegendItem) this.items.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of legend items in the collection.
|
||||
*
|
||||
* @return The item count.
|
||||
*/
|
||||
public int getItemCount() {
|
||||
return this.items.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator that provides access to all the legend items.
|
||||
*
|
||||
* @return An iterator.
|
||||
*/
|
||||
public Iterator iterator() {
|
||||
return this.items.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests this collection 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 LegendItemCollection)) {
|
||||
return false;
|
||||
}
|
||||
LegendItemCollection that = (LegendItemCollection) obj;
|
||||
if (!this.items.equals(that.items)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a clone of the collection.
|
||||
*
|
||||
* @return A clone.
|
||||
*
|
||||
* @throws CloneNotSupportedException if an item in the collection is not
|
||||
* cloneable.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
LegendItemCollection clone = (LegendItemCollection) super.clone();
|
||||
clone.items = (List) ObjectUtilities.deepClone(this.items);
|
||||
return clone;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* ---------------------
|
||||
* LegendItemSource.java
|
||||
* ---------------------
|
||||
* (C) Copyright 2005-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 23-Feb-2005 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
/**
|
||||
* A source of legend items. A {@link org.jfree.chart.title.LegendTitle} will
|
||||
* maintain a list of sources (often just one) from which it obtains legend
|
||||
* items.
|
||||
*/
|
||||
public interface LegendItemSource {
|
||||
|
||||
/**
|
||||
* Returns a (possibly empty) collection of legend items.
|
||||
*
|
||||
* @return The legend item collection (never <code>null</code>).
|
||||
*/
|
||||
public LegendItemCollection getLegendItems();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2013, 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.]
|
||||
*
|
||||
* -------------------------
|
||||
* LegendRenderingOrder.java
|
||||
* -------------------------
|
||||
* (C) Copyright 2004-2013, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: Angel;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 26-Mar-2004 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Represents the order for rendering legend items.
|
||||
*/
|
||||
public final class LegendRenderingOrder implements Serializable {
|
||||
|
||||
/** For serialization. */
|
||||
private static final long serialVersionUID = -3832486612685808616L;
|
||||
|
||||
/** In order. */
|
||||
public static final LegendRenderingOrder STANDARD
|
||||
= new LegendRenderingOrder("LegendRenderingOrder.STANDARD");
|
||||
|
||||
/** In reverse order. */
|
||||
public static final LegendRenderingOrder REVERSE
|
||||
= new LegendRenderingOrder("LegendRenderingOrder.REVERSE");
|
||||
|
||||
/** The name. */
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Private constructor.
|
||||
*
|
||||
* @param name the name.
|
||||
*/
|
||||
private LegendRenderingOrder(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representing the object.
|
||||
*
|
||||
* @return The string.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this object is equal to the specified
|
||||
* object, and <code>false</code> otherwise.
|
||||
*
|
||||
* @param obj the other object.
|
||||
*
|
||||
* @return A boolean.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof LegendRenderingOrder)) {
|
||||
return false;
|
||||
}
|
||||
LegendRenderingOrder order = (LegendRenderingOrder) obj;
|
||||
if (!this.name.equals(order.toString())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that serialization returns the unique instances.
|
||||
*
|
||||
* @return The object.
|
||||
*
|
||||
* @throws ObjectStreamException if there is a problem.
|
||||
*/
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
if (this.equals(LegendRenderingOrder.STANDARD)) {
|
||||
return LegendRenderingOrder.STANDARD;
|
||||
}
|
||||
else if (this.equals(LegendRenderingOrder.REVERSE)) {
|
||||
return LegendRenderingOrder.REVERSE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# org.jfree.chart.ChartPanel ResourceBundle properties file
|
||||
#
|
||||
# Changes (from 31-Aug-2003)
|
||||
# --------------------------
|
||||
# 31-Aug-2003 : Initial version (AL);
|
||||
#
|
||||
|
||||
Auto_Range=Auto Range
|
||||
All_Axes=Both Axes
|
||||
Chart=Chart
|
||||
Chart_Properties=Chart Properties
|
||||
Copy=Copy
|
||||
Domain_Axis=Domain Axis
|
||||
FILE_EXISTS_CONFIRM_OVERWRITE=The file already exists, are you sure you want to overwrite it?
|
||||
PNG_Image_Files=PNG Image Files
|
||||
PDF_Files=PDF Files
|
||||
Print...=Print...
|
||||
Properties...=Properties...
|
||||
Range_Axis=Range Axis
|
||||
Save_as...=Save as...
|
||||
SVG_Files=SVG Files
|
||||
Zoom_In=Zoom In
|
||||
Zoom_Out=Zoom Out
|
||||
@@ -0,0 +1,21 @@
|
||||
# org.jfree.chart.ChartPanel ResourceBundle properties file
|
||||
#
|
||||
# Changes (from 31-Aug-2003)
|
||||
# --------------------------
|
||||
# 31-Aug-2003 : Initial version (AL);
|
||||
# 20-Mar-2010 : Czech translation;
|
||||
#
|
||||
|
||||
Auto_Range=Auto rozm\u011br
|
||||
All_Axes=Ob\u011b osy
|
||||
Chart=Chart
|
||||
Chart_Properties=Vlastnosti grafu
|
||||
Copy=Kop\u00edrovat
|
||||
Domain_Axis=Osa oblasti
|
||||
PNG_Image_Files=Obr\u00e1zky PNG
|
||||
Print...=Tisk...
|
||||
Properties...=Vlastnosti...
|
||||
Save_as...=Ulo\u017eit jako...
|
||||
Range_Axis=Osa rozsahu
|
||||
Zoom_In=P\u0159ibl\u00ed\u017eit
|
||||
Zoom_Out=Odd\u00e1lit
|
||||
@@ -0,0 +1,21 @@
|
||||
# org.jfree.chart.ChartPanel ResourceBundle properties file - german version
|
||||
#
|
||||
# Changes (from 31-Aug-2003)
|
||||
# --------------------------
|
||||
# 31-Aug-2003 : Initial version (AL);
|
||||
# 15-Mar-2004 : Revised version (Christian W. Zuckschwerdt);
|
||||
#
|
||||
|
||||
Auto_Range=Autojustage
|
||||
All_Axes=Beide Achsen
|
||||
Chart=Diagramm
|
||||
Chart_Properties=Diagramm-Eigenschaften
|
||||
Copy=Kopieren
|
||||
Domain_Axis=Horizontale Achse
|
||||
PNG_Image_Files=PNG Datei (Portable Network Graphics) (*.png)
|
||||
Print...=Drucken...
|
||||
Properties...=Eigenschaften...
|
||||
Save_as...=Speichern unter...
|
||||
Range_Axis=Vertikale Achse
|
||||
Zoom_In=Hineinzoomen
|
||||
Zoom_Out=Herauszoomen
|
||||
@@ -0,0 +1,20 @@
|
||||
# org.jfree.chart.ChartPanel ResourceBundle properties file - spanish version
|
||||
#
|
||||
# Changes (from 16-Dec-2003)
|
||||
# --------------------------
|
||||
# 16-Dec-2003 : Initial Version: Complejo Hospitalario Universitario Juan Canalejo
|
||||
#
|
||||
|
||||
Auto_Range=Escala autom\u00E1tica
|
||||
All_Axes=Todos los ejes
|
||||
Chart=Chart
|
||||
Chart_Properties=Propiedades del gr\u00E1fico
|
||||
Copy=Copiar
|
||||
Domain_Axis=Eje horizontal
|
||||
PNG_Image_Files=Formato PNG (Portable Network Graphics) (*.png)
|
||||
Print...=Imprimir...
|
||||
Properties...=Propiedades...
|
||||
Save_as...=Grabar como...
|
||||
Range_Axis=Eje vertical
|
||||
Zoom_In=Acercar
|
||||
Zoom_Out=Alejar
|
||||
@@ -0,0 +1,20 @@
|
||||
# org.jfree.chart.ChartPanel ResourceBundle properties file - french version
|
||||
#
|
||||
# Changes (from 31-Aug-2003)
|
||||
# --------------------------
|
||||
# 31-Aug-2003 : Initial version (AL);
|
||||
#
|
||||
|
||||
Auto_Range=Echelle automatique
|
||||
All_Axes=Les deux axes
|
||||
Chart=Chart
|
||||
Chart_Properties=Propri\u00E9t\u00E9s du graphique
|
||||
Copy=Copier
|
||||
Domain_Axis=Axe horizontal
|
||||
PNG_Image_Files=Format PNG (Portable Network Graphics) (*.png)
|
||||
Print...=Imprimer...
|
||||
Properties...=Propri\u00E9t\u00E9s...
|
||||
Save_as...=Enregistrer sous...
|
||||
Range_Axis=Axe vertical
|
||||
Zoom_In=Zoom avant
|
||||
Zoom_Out=Zoom arri\u00E8re
|
||||