You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(165) |
Nov
(296) |
Dec
(92) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(84) |
Feb
(20) |
Mar
(20) |
Apr
(42) |
May
(26) |
Jun
(30) |
Jul
(77) |
Aug
(151) |
Sep
(61) |
Oct
(259) |
Nov
(160) |
Dec
(76) |
| 2007 |
Jan
(159) |
Feb
(155) |
Mar
(183) |
Apr
(113) |
May
(110) |
Jun
(178) |
Jul
(56) |
Aug
(21) |
Sep
(50) |
Oct
(251) |
Nov
(218) |
Dec
(42) |
| 2008 |
Jan
(14) |
Feb
(37) |
Mar
(60) |
Apr
(77) |
May
(146) |
Jun
(256) |
Jul
(72) |
Aug
(51) |
Sep
(283) |
Oct
(22) |
Nov
(55) |
Dec
(53) |
| 2009 |
Jan
(56) |
Feb
(45) |
Mar
(56) |
Apr
(98) |
May
(84) |
Jun
(87) |
Jul
(32) |
Aug
(6) |
Sep
(19) |
Oct
|
Nov
(10) |
Dec
(6) |
| 2010 |
Jan
(2) |
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(158) |
Nov
(17) |
Dec
(15) |
| 2012 |
Jan
(9) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(22) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
|
Dec
|
| 2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(259) |
Aug
(125) |
Sep
(24) |
Oct
(8) |
Nov
(132) |
Dec
(3) |
| 2014 |
Jan
(3) |
Feb
(26) |
Mar
(17) |
Apr
(8) |
May
|
Jun
(31) |
Jul
(126) |
Aug
(22) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
|
Nov
(1) |
Dec
|
| 2016 |
Jan
(19) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <mu...@us...> - 2016-01-26 16:57:04
|
Revision: 3349
http://sourceforge.net/p/jfreechart/code/3349
Author: mungady
Date: 2016-01-26 16:57:02 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Update dependencies for Maven build with JavaFX support.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/pom-1.8.xml
Modified: branches/jfreechart-1.0.x-branch/pom-1.8.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/pom-1.8.xml 2016-01-26 16:56:26 UTC (rev 3348)
+++ branches/jfreechart-1.0.x-branch/pom-1.8.xml 2016-01-26 16:57:02 UTC (rev 3349)
@@ -8,9 +8,9 @@
<name>JFreeChart</name>
- <artifactId>jfreechart</artifactId>
+ <artifactId>jfreechart-fx</artifactId>
<groupId>org.jfree</groupId>
- <version>1.0.19</version>
+ <version>1.0.20-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- this is required to host it on Sonatype's OSSRH -->
@@ -44,15 +44,9 @@
<mailingLists>
<mailingList>
<name>JFreeChart Developer List</name>
- <subscribe>
- jfr...@li...?subject=subscribe
- </subscribe>
- <unsubscribe>
- jfr...@li...?subject=unsubscribe
- </unsubscribe>
- <archive>
- http://sourceforge.net/mailarchive/forum.php?forum=jfreechart-dev
- </archive>
+ <subscribe>jfr...@li...?subject=subscribe</subscribe>
+ <unsubscribe>jfr...@li...?subject=unsubscribe</unsubscribe>
+ <archive>http://sourceforge.net/mailarchive/forum.php?forum=jfreechart-dev</archive>
</mailingList>
</mailingLists>
@@ -77,7 +71,28 @@
<version>1.0.23</version>
</dependency>
+ <!-- FXGraphics2D is used for JavaFX support. -->
<dependency>
+ <groupId>org.jfree</groupId>
+ <artifactId>fxgraphics2d</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+
+ <!-- JFreeSVG enables SVG export -->
+ <dependency>
+ <groupId>org.jfree</groupId>
+ <artifactId>jfreesvg</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <!-- OrsonPDF enables PDF export -->
+ <dependency>
+ <groupId>com.orsonpdf</groupId>
+ <artifactId>orsonpdf</artifactId>
+ <version>1.7</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -116,7 +131,6 @@
</resources>
<plugins>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -240,8 +254,8 @@
<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>
+ <project.source.level>1.8</project.source.level>
+ <project.target.level>1.8</project.target.level>
</properties>
<profiles>
@@ -264,11 +278,10 @@
</executions>
<configuration>
<sourceFileExcludes>
- <exclude>org/jfree/chart/fx/**</exclude>
+ <!-- <exclude>org/jfree/chart/fx/**</exclude> -->
</sourceFileExcludes>
</configuration>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@@ -286,5 +299,4 @@
</build>
</profile>
</profiles>
-
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 16:56:28
|
Revision: 3348
http://sourceforge.net/p/jfreechart/code/3348
Author: mungady
Date: 2016-01-26 16:56:26 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Update dependencies for Maven build with JavaFX support.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/pom.xml
Modified: branches/jfreechart-1.0.x-branch/pom.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/pom.xml 2016-01-26 01:53:56 UTC (rev 3347)
+++ branches/jfreechart-1.0.x-branch/pom.xml 2016-01-26 16:56:26 UTC (rev 3348)
@@ -27,9 +27,9 @@
<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.
+ 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>
@@ -71,13 +71,28 @@
<version>1.0.23</version>
</dependency>
+ <!-- FXGraphics2D is used for JavaFX support. -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>fxgraphics2d</artifactId>
<version>1.2.1</version>
</dependency>
+ <!-- JFreeSVG enables SVG export -->
<dependency>
+ <groupId>org.jfree</groupId>
+ <artifactId>jfreesvg</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <!-- OrsonPDF enables PDF export -->
+ <dependency>
+ <groupId>com.orsonpdf</groupId>
+ <artifactId>orsonpdf</artifactId>
+ <version>1.7</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:53:59
|
Revision: 3347
http://sourceforge.net/p/jfreechart/code/3347
Author: mungady
Date: 2016-01-26 01:53:56 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Allow chart to be null (to support usage from FXML) and use existing context menu.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewer.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewer.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewer.java 2016-01-26 01:52:43 UTC (rev 3346)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewer.java 2016-01-26 01:53:56 UTC (rev 3347)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ----------------
* ChartViewer.java
* ----------------
- * (C) Copyright 2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2014-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -77,9 +77,6 @@
/** The chart to display. */
private JFreeChart chart;
-
- /** The context menu that will be attached to the canvas. */
- private ContextMenu contextMenu;
/** Does the viewer show tooltips from the chart? */
private boolean tooltipEnabled;
@@ -88,9 +85,20 @@
private transient List<ChartMouseListenerFX> chartMouseListeners;
/**
+ * Creates a new instance, initially with no chart to display. This
+ * constructor is required so that this control can be used within
+ * FXML.
+ *
+ * @since 1.0.20
+ */
+ public ChartViewer() {
+ this(null);
+ }
+
+ /**
* Creates a new viewer to display the supplied chart in JavaFX.
*
- * @param chart the chart ({@code null} not permitted).
+ * @param chart the chart ({@code null} permitted).
*/
public ChartViewer(JFreeChart chart) {
this(chart, true);
@@ -99,23 +107,19 @@
/**
* Creates a new viewer instance.
*
- * @param chart the chart ({@code null} not permitted).
+ * @param chart the chart ({@code null} permitted).
* @param contextMenuEnabled enable the context menu?
*/
public ChartViewer(JFreeChart chart, boolean contextMenuEnabled) {
- ParamChecks.nullNotPermitted(chart, "chart");
this.chart = chart;
getStyleClass().add("chart-control");
- this.contextMenu = createContextMenu();
- this.contextMenu.setOnShowing((WindowEvent event) -> {
- ChartViewer.this.setTooltipEnabled(false);
- });
- this.contextMenu.setOnHiding((WindowEvent event) -> {
- ChartViewer.this.setTooltipEnabled(true);
- });
- setContextMenu(this.contextMenu);
+ setContextMenu(createContextMenu());
+ getContextMenu().setOnShowing(
+ e -> ChartViewer.this.setTooltipEnabled(false));
+ getContextMenu().setOnHiding(
+ e -> ChartViewer.this.setTooltipEnabled(true));
this.tooltipEnabled = true;
- this.chartMouseListeners = new ArrayList<ChartMouseListenerFX>();
+ this.chartMouseListeners = new ArrayList<>();
}
@Override
@@ -127,7 +131,7 @@
/**
* Returns the chart that is being displayed by this node.
*
- * @return The chart (never {@code null}).
+ * @return The chart (possibly {@code null}).
*/
public JFreeChart getChart() {
return this.chart;
@@ -239,25 +243,21 @@
Menu export = new Menu("Export As");
MenuItem pngItem = new MenuItem("PNG...");
- pngItem.setOnAction((ActionEvent e) -> { handleExportToPNG(); });
+ pngItem.setOnAction(e -> handleExportToPNG());
export.getItems().add(pngItem);
MenuItem jpegItem = new MenuItem("JPEG...");
- jpegItem.setOnAction((ActionEvent e) -> { handleExportToJPEG(); });
+ jpegItem.setOnAction(e -> handleExportToJPEG());
export.getItems().add(jpegItem);
if (ExportUtils.isOrsonPDFAvailable()) {
MenuItem pdfItem = new MenuItem("PDF...");
- pdfItem.setOnAction((ActionEvent e) -> {
- handleExportToPDF();
- });
+ pdfItem.setOnAction(e -> handleExportToPDF());
export.getItems().add(pdfItem);
}
if (ExportUtils.isJFreeSVGAvailable()) {
MenuItem svgItem = new MenuItem("SVG...");
- svgItem.setOnAction((ActionEvent e) -> {
- handleExportToSVG();
- });
+ svgItem.setOnAction(e -> handleExportToSVG());
export.getItems().add(svgItem);
}
menu.getItems().add(export);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:52:45
|
Revision: 3346
http://sourceforge.net/p/jfreechart/code/3346
Author: mungady
Date: 2016-01-26 01:52:43 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Allow chart to be null (to support usage from FXML).
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewerSkin.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewerSkin.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewerSkin.java 2016-01-26 01:50:10 UTC (rev 3345)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartViewerSkin.java 2016-01-26 01:52:43 UTC (rev 3346)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* --------------------
* ChartViewerSkin.java
* --------------------
- * (C) Copyright 2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2014-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -35,12 +35,11 @@
* Changes:
* --------
* 20-Jun-2014 : Version 1 (DG);
+ *
*/
-
package org.jfree.chart.fx;
-import org.jfree.chart.fx.interaction.ZoomHandlerFX;
import javafx.scene.control.SkinBase;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
@@ -51,6 +50,7 @@
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.fx.interaction.ChartMouseListenerFX;
+import org.jfree.chart.fx.interaction.ZoomHandlerFX;
import org.jfree.chart.util.ParamChecks;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:50:12
|
Revision: 3345
http://sourceforge.net/p/jfreechart/code/3345
Author: mungady
Date: 2016-01-26 01:50:10 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Allow chart to be null (to support usage from FXML).
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartCanvas.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartCanvas.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartCanvas.java 2016-01-26 01:26:09 UTC (rev 3344)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/ChartCanvas.java 2016-01-26 01:50:10 UTC (rev 3345)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ----------------
* ChartCanvas.java
* ----------------
- * (C) Copyright 2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2014-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -68,6 +68,7 @@
import org.jfree.chart.fx.interaction.MouseHandlerFX;
import org.jfree.chart.plot.PlotRenderingInfo;
import org.jfree.chart.util.ParamChecks;
+import org.jfree.fx.FXGraphics2D;
/**
* A canvas for displaying a {@link JFreeChart} in JavaFX. You can use the
@@ -87,7 +88,7 @@
*/
public class ChartCanvas extends Canvas implements ChartChangeListener {
- /** The chart being displayed in the canvas (never null). */
+ /** The chart being displayed in the canvas. */
private JFreeChart chart;
/**
@@ -129,20 +130,22 @@
private List<MouseHandlerFX> auxiliaryMouseHandlers;
/**
- * Creates a new canvas to display the supplied chart in JavaFX.
+ * Creates a new canvas to display the supplied chart in JavaFX. If
+ * {@code chart} is null, a blank canvas will be displayed.
*
- * @param chart the chart ({@code null} not permitted).
+ * @param chart the chart.
*/
public ChartCanvas(JFreeChart chart) {
- ParamChecks.nullNotPermitted(chart, "chart");
this.chart = chart;
- this.chart.addChangeListener(this);
+ if (this.chart != null) {
+ this.chart.addChangeListener(this);
+ }
this.tooltip = null;
this.tooltipEnabled = true;
this.chartMouseListeners = new ArrayList<ChartMouseListenerFX>();
- widthProperty().addListener(evt -> draw());
- heightProperty().addListener(evt -> draw());
+ widthProperty().addListener(e -> draw());
+ heightProperty().addListener(e -> draw());
this.g2 = new FXGraphics2D(getGraphicsContext2D());
this.liveHandler = null;
this.availableMouseHandlers = new ArrayList<MouseHandlerFX>();
@@ -156,18 +159,18 @@
this.auxiliaryMouseHandlers.add(new AnchorHandlerFX("anchor"));
this.auxiliaryMouseHandlers.add(new DispatchHandlerFX("dispatch"));
- setOnMouseMoved((MouseEvent e) -> { handleMouseMoved(e); });
- setOnMouseClicked((MouseEvent e) -> { handleMouseClicked(e); });
- setOnMousePressed((MouseEvent e) -> { handleMousePressed(e); });
- setOnMouseDragged((MouseEvent e) -> { handleMouseDragged(e); });
- setOnMouseReleased((MouseEvent e) -> { handleMouseReleased(e); });
- setOnScroll((ScrollEvent event) -> { handleScroll(event); });
+ setOnMouseMoved(e -> handleMouseMoved(e));
+ setOnMouseClicked(e -> handleMouseClicked(e));
+ setOnMousePressed(e -> handleMousePressed(e));
+ setOnMouseDragged(e -> handleMouseDragged(e));
+ setOnMouseReleased(e -> handleMouseReleased(e));
+ setOnScroll(e -> handleScroll(e));
}
/**
* Returns the chart that is being displayed by this node.
*
- * @return The chart (never {@code null}).
+ * @return The chart (possibly {@code null}).
*/
public JFreeChart getChart() {
return this.chart;
@@ -176,13 +179,16 @@
/**
* Sets the chart to be displayed by this node.
*
- * @param chart the chart ({@code null} not permitted).
+ * @param chart the chart ({@code null} permitted).
*/
public void setChart(JFreeChart chart) {
- ParamChecks.nullNotPermitted(chart, "chart");
- this.chart.removeChangeListener(this);
+ if (this.chart != null) {
+ this.chart.removeChangeListener(this);
+ }
this.chart = chart;
- this.chart.addChangeListener(this);
+ if (this.chart != null) {
+ this.chart.addChangeListener(this);
+ }
draw();
}
@@ -225,7 +231,9 @@
*/
public void setAnchor(Point2D anchor) {
this.anchor = anchor;
- this.chart.setNotify(true); // force a redraw
+ if (this.chart != null) {
+ this.chart.setNotify(true); // force a redraw
+ }
}
/**
@@ -340,8 +348,10 @@
if (width > 0 && height > 0) {
ctx.clearRect(0, 0, width, height);
this.info = new ChartRenderingInfo();
- this.chart.draw(this.g2, new Rectangle((int) width, (int) height),
- this.anchor, this.info);
+ if (this.chart != null) {
+ this.chart.draw(this.g2, new Rectangle((int) width,
+ (int) height), this.anchor, this.info);
+ }
}
ctx.restore();
this.anchor = null;
@@ -359,8 +369,7 @@
Rectangle2D result;
if (plotInfo.getSubplotCount() == 0) {
result = plotInfo.getDataArea();
- }
- else {
+ } else {
int subplotIndex = plotInfo.getSubplotIndex(point);
if (subplotIndex == -1) {
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:26:11
|
Revision: 3344
http://sourceforge.net/p/jfreechart/code/3344
Author: mungady
Date: 2016-01-26 01:26:09 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Delete FXGraphics2D source files and include jar.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ChangeLog
Modified: branches/jfreechart-1.0.x-branch/ChangeLog
===================================================================
--- branches/jfreechart-1.0.x-branch/ChangeLog 2016-01-26 01:24:24 UTC (rev 3343)
+++ branches/jfreechart-1.0.x-branch/ChangeLog 2016-01-26 01:26:09 UTC (rev 3344)
@@ -1,3 +1,9 @@
+2016-01-25 David Gilbert <dav...@ob...>
+
+ * org/jfree/chart/fx/FXGraphics2D.java: Deleted,
+ * org/jfree/chart/fx/FXGraphicsConfiguration.java: Likewise,
+ * org/jfree/chart/fx/FXGraphicsDevice.java: Likewise.
+
2015-11-23 David Gilbert <dav...@ob...>
* org/jfree/chart/util/ParamChecks.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:24:26
|
Revision: 3343
http://sourceforge.net/p/jfreechart/code/3343
Author: mungady
Date: 2016-01-26 01:24:24 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Update OrsonPDF version to 1.7 and include FXGraphics2D 1.2.1
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ant/build-fx.xml
Modified: branches/jfreechart-1.0.x-branch/ant/build-fx.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2016-01-26 01:23:13 UTC (rev 3342)
+++ branches/jfreechart-1.0.x-branch/ant/build-fx.xml 2016-01-26 01:24:24 UTC (rev 3343)
@@ -24,10 +24,13 @@
<property name="jcommon.name" value="jcommon" />
<property name="jcommon.version" value="1.0.23" />
<property name="jcommon.jar" value="${basedir}/lib/${jcommon.name}-${jcommon.version}.jar"/>
+ <property name="fxgraphics2d.name" value="fxgraphics2d" />
+ <property name="fxgraphics2d.version" value="1.2.1" />
+ <property name="fxgraphics2d.jar" value="${basedir}/lib/${fxgraphics2d.name}-${fxgraphics2d.version}.jar" />
<property name="jfreesvg.name" value="jfreesvg" />
<property name="jfreesvg.version" value="3.0" />
<property name="orsonpdf.name" value="orsonpdf" />
- <property name="orsonpdf.version" value="1.6-eval" />
+ <property name="orsonpdf.version" value="1.7" />
<property name="orsoncharts.version" value="1.4-eval" />
<property name="builddir" value="${basedir}/build" />
<property name="servlet.jar" value="${basedir}/lib/servlet.jar"/>
@@ -37,7 +40,8 @@
<property name="target.version" value="1.8"/>
<path id="build.classpath">
<fileset dir="${basedir}/lib/">
- <include name="${jcommon.name}-${jcommon.version}.jar"/>
+ <include name="${jcommon.name}-${jcommon.version}.jar" />
+ <include name="${fxgraphics2d.name}-${fxgraphics2d.version}.jar" />
<include name="servlet.jar"/>
</fileset>
</path>
@@ -237,6 +241,7 @@
<!-- copy across lib files -->
<copy file="${jcommon.jar}" tofile="${basedir}/distribution/lib/${jcommon.name}-${jcommon.version}.jar" />
+ <copy file="${fxgraphics2d.jar}" tofile="${basedir}/distribution/lib/${fxgraphics2d.name}-${fxgraphics2d.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" />
@@ -308,8 +313,8 @@
<mkdir dir="${basedir}/build-tests"/>
<javac srcdir="${basedir}/tests"
destdir="${basedir}/build-tests"
- source="1.6"
- target="1.6"
+ source="1.8"
+ target="1.8"
debug="true"
deprecation="false"
optimize="false"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-26 01:23:15
|
Revision: 3342
http://sourceforge.net/p/jfreechart/code/3342
Author: mungady
Date: 2016-01-26 01:23:13 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
Update OrsonPDF version to 1.7
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ant/build.xml
Modified: branches/jfreechart-1.0.x-branch/ant/build.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/ant/build.xml 2016-01-25 21:01:04 UTC (rev 3341)
+++ branches/jfreechart-1.0.x-branch/ant/build.xml 2016-01-26 01:23:13 UTC (rev 3342)
@@ -27,7 +27,7 @@
<property name="jfreesvg.name" value="jfreesvg" />
<property name="jfreesvg.version" value="3.0" />
<property name="orsonpdf.name" value="orsonpdf" />
- <property name="orsonpdf.version" value="1.6-eval" />
+ <property name="orsonpdf.version" value="1.7" />
<property name="orsoncharts.version" value="1.4-eval-nofx" />
<property name="builddir" value="${basedir}/build" />
<property name="servlet.jar" value="${basedir}/lib/servlet.jar"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 21:01:06
|
Revision: 3341
http://sourceforge.net/p/jfreechart/code/3341
Author: mungady
Date: 2016-01-25 21:01:04 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Fix Javadoc warning.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2016-01-25 20:53:41 UTC (rev 3340)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2016-01-25 21:01:04 UTC (rev 3341)
@@ -311,7 +311,7 @@
*/
@Override
public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea,
- XYPlot plot, XYDataset data, PlotRenderingInfo info) {
+ XYPlot plot, XYDataset dataset, PlotRenderingInfo info) {
return new XYItemRendererState(info);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 20:53:44
|
Revision: 3340
http://sourceforge.net/p/jfreechart/code/3340
Author: mungady
Date: 2016-01-25 20:53:41 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Add FXGraphics2D jar file.
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar
Added: branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar
===================================================================
(Binary files differ)
Index: branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar
===================================================================
--- branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar 2016-01-25 20:40:16 UTC (rev 3339)
+++ branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar 2016-01-25 20:53:41 UTC (rev 3340)
Property changes on: branches/jfreechart-1.0.x-branch/lib/fxgraphics2d-1.2.1.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 20:40:18
|
Revision: 3339
http://sourceforge.net/p/jfreechart/code/3339
Author: mungady
Date: 2016-01-25 20:40:16 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Update OrsonPDF dependency
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar
Removed Paths:
-------------
branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.6-eval.jar
Deleted: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.6-eval.jar
===================================================================
(Binary files differ)
Added: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar
===================================================================
(Binary files differ)
Index: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar
===================================================================
--- branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar 2016-01-25 20:36:47 UTC (rev 3338)
+++ branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar 2016-01-25 20:40:16 UTC (rev 3339)
Property changes on: branches/jfreechart-1.0.x-branch/lib/orsonpdf-1.7.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 20:36:49
|
Revision: 3338
http://sourceforge.net/p/jfreechart/code/3338
Author: mungady
Date: 2016-01-25 20:36:47 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Removed FXGraphics2D source files (use lib instead)
Removed Paths:
-------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsConfiguration.java
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsDevice.java
Deleted: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2016-01-25 20:34:39 UTC (rev 3337)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2016-01-25 20:36:47 UTC (rev 3338)
@@ -1,1920 +0,0 @@
-/* ===========================================================
- * JFreeChart : a free chart library for the Java(tm) platform
- * ===========================================================
- *
- * (C) Copyright 2000-2015, 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.]
- *
- * -----------------
- * FXGraphics2D.java
- * -----------------
- * (C) Copyright 2014, 2015 by Object Refinery Limited and Contributors.
- *
- * Original Author: David Gilbert (for Object Refinery Limited);
- * Contributor(s): -;
-
- * Changes:
- * --------
- * 20-Jun-2014 : Version 1 (DG);
- *
- */
-
-package org.jfree.chart.fx;
-
-import java.awt.AlphaComposite;
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.GradientPaint;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.Image;
-import java.awt.LinearGradientPaint;
-import java.awt.MultipleGradientPaint;
-import java.awt.Paint;
-import java.awt.RadialGradientPaint;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.font.TextLayout;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Arc2D;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Line2D;
-import java.awt.geom.NoninvertibleTransformException;
-import java.awt.geom.Path2D;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.RoundRectangle2D;
-import java.awt.image.BufferedImage;
-import java.awt.image.BufferedImageOp;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.RenderedImage;
-import java.awt.image.WritableRaster;
-import java.awt.image.renderable.RenderableImage;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.text.AttributedCharacterIterator;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-import javafx.embed.swing.SwingFXUtils;
-import javafx.scene.canvas.Canvas;
-import javafx.scene.canvas.GraphicsContext;
-import javafx.scene.paint.CycleMethod;
-import javafx.scene.paint.LinearGradient;
-import javafx.scene.paint.RadialGradient;
-import javafx.scene.paint.Stop;
-import javafx.scene.shape.ArcType;
-import javafx.scene.shape.StrokeLineCap;
-import javafx.scene.shape.StrokeLineJoin;
-import javafx.scene.text.FontPosture;
-import javafx.scene.text.FontWeight;
-
-/**
- * A {@link Graphics2D} implementation that writes to a JavaFX {@link Canvas}.
- * This class is copied directly from the FXGraphics2D project, we keep a local
- * copy to avoid having a dependency to manage.
- *
- * @since 1.0.18
- */
-public class FXGraphics2D extends Graphics2D {
-
- /** The graphics context for the JavaFX canvas. */
- private final GraphicsContext gc;
-
- /** The number of times the graphics state has been saved. */
- private int saveCount = 0;
-
- /** A flag to permit clipping to be disabled (because...JavaFX bugs). */
- private boolean clippingDisabled = false;
-
- /** Rendering hints. */
- private final RenderingHints hints;
-
- private Shape clip;
-
- /** Stores the AWT Paint object for get/setPaint(). */
- private Paint paint = Color.BLACK;
-
- /** Stores the AWT Color object for get/setColor(). */
- private Color awtColor = Color.BLACK;
-
- private Composite composite = AlphaComposite.getInstance(
- AlphaComposite.SRC_OVER, 1.0f);
-
- private Stroke stroke = new BasicStroke(1.0f);
-
- /**
- * The width of the stroke to use when the user supplies a
- * BasicStroke with a width of 0.0 (in this case the Java specification
- * says "If width is set to 0.0f, the stroke is rendered as the thinnest
- * possible line for the target device and the antialias hint setting.")
- */
- private double zeroStrokeWidth;
-
- private Font font = new Font("SansSerif", Font.PLAIN, 12);
-
- private final FontRenderContext fontRenderContext = new FontRenderContext(
- null, false, true);
-
- private AffineTransform transform = new AffineTransform();
-
- /** The background color, presently ignored. */
- private Color background = Color.BLACK;
-
- /**
- * An instance that is lazily instantiated in drawLine and then
- * subsequently reused to avoid creating a lot of garbage.
- */
- private Line2D line;
-
- /**
- * An instance that is lazily instantiated in fillRect and then
- * subsequently reused to avoid creating a lot of garbage.
- */
- Rectangle2D rect;
-
- /**
- * An instance that is lazily instantiated in draw/fillRoundRect and then
- * subsequently reused to avoid creating a lot of garbage.
- */
- private RoundRectangle2D roundRect;
-
- /**
- * An instance that is lazily instantiated in draw/fillOval and then
- * subsequently reused to avoid creating a lot of garbage.
- */
- private Ellipse2D oval;
-
- /**
- * An instance that is lazily instantiated in draw/fillArc and then
- * subsequently reused to avoid creating a lot of garbage.
- */
- private Arc2D arc;
-
- /** A hidden image used for font metrics. */
- private final BufferedImage fmImage = new BufferedImage(10, 10,
- BufferedImage.TYPE_INT_RGB);
-
- /**
- * A Graphics2D instance for the hidden image that is used for font
- * metrics. Used in the getFontMetrics(Font f) method.
- */
- private final Graphics2D fmImageG2 = fmImage.createGraphics();
-
- /**
- * The device configuration (this is lazily instantiated in the
- * getDeviceConfiguration() method).
- */
- private GraphicsConfiguration deviceConfiguration;
-
- /**
- * Throws an {@code IllegalArgumentException} if {@code arg} is
- * {@code null}.
- *
- * @param arg the argument to check.
- * @param name the name of the argument (to display in the exception
- * message).
- */
- private static void nullNotPermitted(Object arg, String name) {
- if (arg == null) {
- throw new IllegalArgumentException("Null '" + name + "' argument.");
- }
- }
-
- /**
- * Creates a new instance that will render to the specified JavaFX
- * {@code GraphicsContext}.
- *
- * @param gc the graphics context ({@code null} not permitted).
- */
- public FXGraphics2D(GraphicsContext gc) {
- nullNotPermitted(gc, "gc");
- this.gc = gc;
- this.zeroStrokeWidth = 0.5;
- this.hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_DEFAULT);
- }
-
- /**
- * Returns the width to use for the stroke when the AWT stroke
- * specified has a zero width (the default value is {@code 0.5}).
- * <p>In the Java specification for {@code BasicStroke} it states "If width
- * is set to 0.0f, the stroke is rendered as the thinnest possible
- * line for the target device and the antialias hint setting." We don't
- * have a means to implement that accurately since we must specify a fixed
- * width to the JavaFX canvas - this attribute is the width that is
- * used.</p>
- *
- * @return The width.
- */
- public double getZeroStrokeWidth() {
- return this.zeroStrokeWidth;
- }
-
- /**
- * Sets the width to use for the stroke when the current AWT stroke
- * has a width of {@code 0.0}.
- *
- * @param width the new width (must be 0 or greater).
- */
- public void setZeroStrokeWidth(double width) {
- if (width < 0.0) {
- throw new IllegalArgumentException("Width cannot be negative.");
- }
- this.zeroStrokeWidth = width;
- }
-
- /**
- * Returns the flag that controls whether or not clipping is actually
- * applied to the JavaFX canvas. The default value is currently
- * {@code false} (the clipping is ENABLED) but since it does not always
- * work correctly you have the option to disable it. See
- * <a href="https://javafx-jira.kenai.com/browse/RT-36891">
- * https://javafx-jira.kenai.com/browse/RT-36891</a> for details (requires
- * an account).
- *
- * @return A boolean.
- *
- * @see #setClippingDisabled(boolean)
- */
- public boolean isClippingDisabled() {
- return this.clippingDisabled;
- }
-
- /**
- * Sets the flag that controls whether or not clipping is disabled.
- *
- * @param disabled the new flag value.
- *
- * @see #isClippingDisabled()
- */
- public void setClippingDisabled(boolean disabled) {
- this.clippingDisabled = disabled;
- }
-
- /**
- * Returns the device configuration.
- *
- * @return The device configuration (never {@code null}).
- */
- @Override
- public GraphicsConfiguration getDeviceConfiguration() {
- if (this.deviceConfiguration == null) {
- int width = (int) this.gc.getCanvas().getWidth();
- int height = (int) this.gc.getCanvas().getHeight();
- this.deviceConfiguration = new FXGraphicsConfiguration(width,
- height);
- }
- return this.deviceConfiguration;
- }
-
- /**
- * Creates a new graphics object that is a copy of this graphics object.
- *
- * @return A new graphics object.
- */
- @Override
- public Graphics create() {
- FXGraphics2D copy = new FXGraphics2D(this.gc);
- copy.setRenderingHints(getRenderingHints());
- copy.setClip(getClip());
- copy.setPaint(getPaint());
- copy.setColor(getColor());
- copy.setComposite(getComposite());
- copy.setStroke(getStroke());
- copy.setFont(getFont());
- copy.setTransform(getTransform());
- copy.setBackground(getBackground());
- return copy;
- }
-
- /**
- * Returns the paint used to draw or fill shapes (or text). The default
- * value is {@link Color#BLACK}.
- *
- * @return The paint (never {@code null}).
- *
- * @see #setPaint(java.awt.Paint)
- */
- @Override
- public Paint getPaint() {
- return this.paint;
- }
-
- /**
- * Sets the paint used to draw or fill shapes (or text). If
- * {@code paint} is an instance of {@code Color}, this method will
- * also update the current color attribute (see {@link #getColor()}). If
- * you pass {@code null} to this method, it does nothing (in
- * accordance with the JDK specification).
- * <br><br>
- * Note that this implementation will map {@link Color},
- * {@link GradientPaint}, {@link LinearGradientPaint} and
- * {@link RadialGradientPaint}, other paint implementations are not
- * handled.
- *
- * @param paint the paint ({@code null} is permitted but ignored).
- *
- * @see #getPaint()
- */
- @Override
- public void setPaint(Paint paint) {
- if (paint == null) {
- return;
- }
- this.paint = paint;
- if (paint instanceof Color) {
- setColor((Color) paint);
- } else if (paint instanceof GradientPaint) {
- GradientPaint gp = (GradientPaint) paint;
- Stop[] stops = new Stop[] { new Stop(0,
- awtColorToJavaFX(gp.getColor1())),
- new Stop(1, awtColorToJavaFX(gp.getColor2())) };
- Point2D p1 = gp.getPoint1();
- Point2D p2 = gp.getPoint2();
- LinearGradient lg = new LinearGradient(p1.getX(), p1.getY(),
- p2.getX(), p2.getY(), false, CycleMethod.NO_CYCLE, stops);
- this.gc.setStroke(lg);
- this.gc.setFill(lg);
- } else if (paint instanceof MultipleGradientPaint) {
- MultipleGradientPaint mgp = (MultipleGradientPaint) paint;
- Color[] colors = mgp.getColors();
- float[] fractions = mgp.getFractions();
- Stop[] stops = new Stop[colors.length];
- for (int i = 0; i < colors.length; i++) {
- stops[i] = new Stop(fractions[i], awtColorToJavaFX(colors[i]));
- }
-
- if (paint instanceof RadialGradientPaint) {
- RadialGradientPaint rgp = (RadialGradientPaint) paint;
- Point2D center = rgp.getCenterPoint();
- Point2D focus = rgp.getFocusPoint();
- double focusDistance = focus.distance(center);
- double focusAngle = 0.0;
- if (!focus.equals(center)) {
- focusAngle = Math.atan2(focus.getY() - center.getY(),
- focus.getX() - center.getX());
- }
- double radius = rgp.getRadius();
- RadialGradient rg = new RadialGradient(
- focusAngle * Math.PI / 180, focusDistance,
- center.getX(), center.getY(), radius, false,
- CycleMethod.NO_CYCLE, stops);
- this.gc.setStroke(rg);
- this.gc.setFill(rg);
- } else if (paint instanceof LinearGradientPaint) {
- LinearGradientPaint lgp = (LinearGradientPaint) paint;
- Point2D start = lgp.getStartPoint();
- Point2D end = lgp.getEndPoint();
- LinearGradient lg = new LinearGradient(start.getX(),
- start.getY(), end.getX(), end.getY(), false,
- CycleMethod.NO_CYCLE, stops);
- this.gc.setStroke(lg);
- this.gc.setFill(lg);
- }
- } else {
- // this is a paint we don't recognise
- }
- }
-
- /**
- * Returns the foreground color. This method exists for backwards
- * compatibility in AWT, you should use the {@link #getPaint()} method.
- * This attribute is updated by the {@link #setColor(java.awt.Color)}
- * method, and also by the {@link #setPaint(java.awt.Paint)} method if
- * a {@code Color} instance is passed to the method.
- *
- * @return The foreground color (never {@code null}).
- *
- * @see #getPaint()
- */
- @Override
- public Color getColor() {
- return this.awtColor;
- }
-
- /**
- * Sets the foreground color. This method exists for backwards
- * compatibility in AWT, you should use the
- * {@link #setPaint(java.awt.Paint)} method.
- *
- * @param c the color ({@code null} permitted but ignored).
- *
- * @see #setPaint(java.awt.Paint)
- */
- @Override
- public void setColor(Color c) {
- if (c == null) {
- return;
- }
- this.awtColor = c;
- this.paint = c;
- javafx.scene.paint.Color fxcolor = awtColorToJavaFX(c);
- this.gc.setFill(fxcolor);
- this.gc.setStroke(fxcolor);
- }
-
- /**
- * Returns a JavaFX color that is equivalent to the specified AWT color.
- *
- * @param c the color ({@code null} not permitted).
- *
- * @return A JavaFX color.
- */
- private javafx.scene.paint.Color awtColorToJavaFX(Color c) {
- return javafx.scene.paint.Color.rgb(c.getRed(), c.getGreen(),
- c.getBlue(), c.getAlpha() / 255.0);
- }
-
- /**
- * Returns the background color (the default value is {@link Color#BLACK}).
- * This attribute is used by the {@link #clearRect(int, int, int, int)}
- * method.
- *
- * @return The background color (possibly {@code null}).
- *
- * @see #setBackground(java.awt.Color)
- */
- @Override
- public Color getBackground() {
- return this.background;
- }
-
- /**
- * Sets the background color. This attribute is used by the
- * {@link #clearRect(int, int, int, int)} method. The reference
- * implementation allows {@code null} for the background color so
- * we allow that too (but for that case, the {@link #clearRect(int, int, int, int)}
- * method will do nothing).
- *
- * @param color the color ({@code null} permitted).
- *
- * @see #getBackground()
- */
- @Override
- public void setBackground(Color color) {
- this.background = color;
- }
-
- /**
- * Returns the current composite.
- *
- * @return The current composite (never {@code null}).
- *
- * @see #setComposite(java.awt.Composite)
- */
- @Override
- public Composite getComposite() {
- return this.composite;
- }
-
- /**
- * Sets the composite (only {@code AlphaComposite} is handled).
- *
- * @param comp the composite ({@code null} not permitted).
- *
- * @see #getComposite()
- */
- @Override
- public void setComposite(Composite comp) {
- nullNotPermitted(comp, "comp");
- this.composite = comp;
- }
-
- /**
- * Returns the current stroke (this attribute is used when drawing shapes).
- *
- * @return The current stroke (never {@code null}).
- *
- * @see #setStroke(java.awt.Stroke)
- */
- @Override
- public Stroke getStroke() {
- return this.stroke;
- }
-
- /**
- * Sets the stroke that will be used to draw shapes.
- *
- * @param s the stroke ({@code null} not permitted).
- *
- * @see #getStroke()
- */
- @Override
- public void setStroke(Stroke s) {
- nullNotPermitted(s, "s");
- this.stroke = s;
- if (stroke instanceof BasicStroke) {
- BasicStroke bs = (BasicStroke) s;
- double lineWidth = bs.getLineWidth();
- if (lineWidth == 0.0) {
- lineWidth = this.zeroStrokeWidth;
- }
- this.gc.setLineWidth(lineWidth);
- this.gc.setLineCap(awtToJavaFXLineCap(bs.getEndCap()));
- this.gc.setLineJoin(awtToJavaFXLineJoin(bs.getLineJoin()));
- this.gc.setMiterLimit(bs.getMiterLimit());
- }
- }
-
- /**
- * Maps a line cap code from AWT to the corresponding JavaFX StrokeLineCap
- * enum value.
- *
- * @param c the line cap code.
- *
- * @return A JavaFX line cap value.
- */
- private StrokeLineCap awtToJavaFXLineCap(int c) {
- if (c == BasicStroke.CAP_BUTT) {
- return StrokeLineCap.BUTT;
- } else if (c == BasicStroke.CAP_ROUND) {
- return StrokeLineCap.ROUND;
- } else if (c == BasicStroke.CAP_SQUARE) {
- return StrokeLineCap.SQUARE;
- } else {
- throw new IllegalArgumentException("Unrecognised cap code: " + c);
- }
- }
-
- /**
- * Maps a line join code from AWT to the corresponding JavaFX
- * StrokeLineJoin enum value.
- *
- * @param j the line join code.
- *
- * @return A JavaFX line join value.
- */
- private StrokeLineJoin awtToJavaFXLineJoin(int j) {
- if (j == BasicStroke.JOIN_BEVEL) {
- return StrokeLineJoin.BEVEL;
- } else if (j == BasicStroke.JOIN_MITER) {
- return StrokeLineJoin.MITER;
- } else if (j == BasicStroke.JOIN_ROUND) {
- return StrokeLineJoin.ROUND;
- } else {
- throw new IllegalArgumentException("Unrecognised join code: " + j);
- }
- }
-
- private double[] floatToDoubleArray(float[] f) {
- if (f == null) {
- return null;
- }
- double[] d = new double[f.length];
- for (int i = 0; i < f.length; i++) {
- d[i] = (double) f[i];
- }
- return d;
- }
-
- /**
- * A utility method that calls {@code GraphicsContext.setLineDashes()}
- * using reflection (since this method is only available in 8u40). On
- * runtimes where the method is not available, this method will do nothing.
- *
- * @param gc the graphics context ({@code null} permitted).
- * @param dashes the dashes.
- */
- private void setLineDashes(GraphicsContext gc, double... dashes) {
- if (dashes == null) {
- dashes = new double[] { 0.0 };
- }
- try {
- Method m = GraphicsContext.class.getMethod("setLineDashes",
- double[].class);
- try {
- m.invoke(gc, dashes);
- } catch (IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- // ignore
- }
- } catch (NoSuchMethodException | SecurityException e) {
- // ignore
- }
- }
-
- /**
- * A utility method that calls {@code GraphicsContext.setLineDashOffset()}
- * using reflection (since this method is only available in 8u40). On
- * runtimes where the method is not available, this method will do nothing.
- *
- * @param gc the graphics context ({@code null} not permitted).
- * @param dashes the dashes.
- */
- private void setLineDashOffset(GraphicsContext gc, double dashOffset) {
- try {
- Method m = GraphicsContext.class.getMethod("setLineDashOffset",
- double.class);
- try {
- m.invoke(gc, dashOffset);
- } catch (IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- // ignore
- }
- } catch (NoSuchMethodException | SecurityException e) {
- // ignore
- }
- }
-
- /**
- * Returns the current value for the specified hint. Note that all hints
- * are currently ignored in this implementation.
- *
- * @param hintKey the hint key ({@code null} permitted, but the
- * result will be {@code null} also in that case).
- *
- * @return The current value for the specified hint
- * (possibly {@code null}).
- *
- * @see #setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object)
- */
- @Override
- public Object getRenderingHint(RenderingHints.Key hintKey) {
- return this.hints.get(hintKey);
- }
-
- /**
- * Sets the value for a hint. Note that all hints are currently
- * ignored in this implementation.
- *
- * @param hintKey the hint key ({@code null} not permitted).
- * @param hintValue the hint value.
- *
- * @see #getRenderingHint(java.awt.RenderingHints.Key)
- */
- @Override
- public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) {
- this.hints.put(hintKey, hintValue);
- }
-
- /**
- * Returns a copy of the rendering hints. Modifying the returned copy
- * will have no impact on the state of this {@code Graphics2D}
- * instance.
- *
- * @return The rendering hints (never {@code null}).
- *
- * @see #setRenderingHints(java.util.Map)
- */
- @Override
- public RenderingHints getRenderingHints() {
- return (RenderingHints) this.hints.clone();
- }
-
- /**
- * Sets the rendering hints to the specified collection.
- *
- * @param hints the new set of hints ({@code null} not permitted).
- *
- * @see #getRenderingHints()
- */
- @Override
- public void setRenderingHints(Map<?, ?> hints) {
- this.hints.clear();
- this.hints.putAll(hints);
- }
-
- /**
- * Adds all the supplied rendering hints.
- *
- * @param hints the hints ({@code null} not permitted).
- */
- @Override
- public void addRenderingHints(Map<?, ?> hints) {
- this.hints.putAll(hints);
- }
-
- /**
- * Draws the specified shape with the current {@code paint} and
- * {@code stroke}. There is direct handling for {@code Line2D},
- * {@code Rectangle2D}, {@code Ellipse2D}, {@code Arc2D} and
- * {@code Path2D}. All other shapes are mapped to a path outline and then
- * drawn.
- *
- * @param s the shape ({@code null} not permitted).
- *
- * @see #fill(java.awt.Shape)
- */
- @Override
- public void draw(Shape s) {
- // if the current stroke is not a BasicStroke then it is handled as
- // a special case
- if (!(this.stroke instanceof BasicStroke)) {
- fill(this.stroke.createStrokedShape(s));
- return;
- }
- if (s instanceof Line2D) {
- Line2D l = (Line2D) s;
- Object hint = getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);
- if (hint != RenderingHints.VALUE_STROKE_PURE) {
- double x1 = Math.rint(l.getX1()) - 0.5;
- double y1 = Math.rint(l.getY1()) - 0.5;
- double x2 = Math.rint(l.getX2()) - 0.5;
- double y2 = Math.rint(l.getY2()) - 0.5;
- l.setLine(x1, y1, x2, y2);
- }
- this.gc.strokeLine(l.getX1(), l.getY1(), l.getX2(), l.getY2());
- } else if (s instanceof RoundRectangle2D) {
- RoundRectangle2D rr = (RoundRectangle2D) s;
- this.gc.strokeRoundRect(rr.getX(), rr.getY(), rr.getWidth(),
- rr.getHeight(), rr.getArcWidth(), rr.getArcHeight());
- } else if (s instanceof Rectangle2D) {
- Rectangle2D r = (Rectangle2D) s;
- if (s instanceof Rectangle) {
- // special case - if the underlying rectangle uses ints we
- // need to create one that uses doubles
- r = new Rectangle2D.Double(r.getX(), r.getY(), r.getWidth(),
- r.getHeight());
- }
- Object hint = getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);
- if (hint != RenderingHints.VALUE_STROKE_PURE) {
- double x = Math.rint(r.getX()) - 0.5;
- double y = Math.rint(r.getY()) - 0.5;
- double w = Math.floor(r.getWidth());
- double h = Math.floor(r.getHeight());
- r.setRect(x, y, w, h);
- }
- this.gc.strokeRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- } else if (s instanceof Ellipse2D) {
- Ellipse2D e = (Ellipse2D) s;
- this.gc.strokeOval(e.getX(), e.getY(), e.getWidth(), e.getHeight());
- } else if (s instanceof Arc2D) {
- Arc2D a = (Arc2D) s;
- this.gc.strokeArc(a.getX(), a.getY(), a.getWidth(), a.getHeight(),
- a.getAngleStart(), a.getAngleExtent(),
- intToArcType(a.getArcType()));
- } else {
- shapeToPath(s);
- this.gc.stroke();
- }
- }
-
- private double[] coords = new double[6];
-
- /**
- * Maps a shape to a path in the graphics context.
- *
- * @param s the shape ({@code null} not permitted).
- */
- private void shapeToPath(Shape s) {
- this.gc.beginPath();
- PathIterator iterator = s.getPathIterator(null);
- while (!iterator.isDone()) {
- int segType = iterator.currentSegment(coords);
- switch (segType) {
- case PathIterator.SEG_MOVETO:
- this.gc.moveTo(coords[0], coords[1]);
- break;
- case PathIterator.SEG_LINETO:
- this.gc.lineTo(coords[0], coords[1]);
- break;
- case PathIterator.SEG_QUADTO:
- this.gc.quadraticCurveTo(coords[0], coords[1], coords[2],
- coords[3]);
- break;
- case PathIterator.SEG_CUBICTO:
- this.gc.bezierCurveTo(coords[0], coords[1], coords[2],
- coords[3], coords[4], coords[5]);
- break;
- case PathIterator.SEG_CLOSE:
- this.gc.closePath();
- break;
- default:
- throw new RuntimeException("Unrecognised segment type "
- + segType);
- }
- iterator.next();
- }
- }
-
- private ArcType intToArcType(int t) {
- if (t == Arc2D.CHORD) {
- return ArcType.CHORD;
- } else if (t == Arc2D.OPEN) {
- return ArcType.OPEN;
- } else if (t == Arc2D.PIE) {
- return ArcType.ROUND;
- }
- throw new IllegalArgumentException("Unrecognised t: " + t);
- }
-
- /**
- * Fills the specified shape with the current {@code paint}. There is
- * direct handling for {@code RoundRectangle2D},
- * {@code Rectangle2D}, {@code Ellipse2D} and {@code Arc2D}.
- * All other shapes are mapped to a path outline and then filled.
- *
- * @param s the shape ({@code null} not permitted).
- *
- * @see #draw(java.awt.Shape)
- */
- @Override
- public void fill(Shape s) {
- if (s instanceof RoundRectangle2D) {
- RoundRectangle2D rr = (RoundRectangle2D) s;
- this.gc.fillRoundRect(rr.getX(), rr.getY(), rr.getWidth(),
- rr.getHeight(), rr.getArcWidth(), rr.getArcHeight());
- } else if (s instanceof Rectangle2D) {
- Rectangle2D r = (Rectangle2D) s;
- this.gc.fillRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
- } else if (s instanceof Ellipse2D) {
- Ellipse2D e = (Ellipse2D) s;
- this.gc.fillOval(e.getX(), e.getY(), e.getWidth(), e.getHeight());
- } else if (s instanceof Arc2D) {
- Arc2D a = (Arc2D) s;
- this.gc.fillArc(a.getX(), a.getY(), a.getWidth(), a.getHeight(),
- a.getAngleStart(), a.getAngleExtent(),
- intToArcType(a.getArcType()));
- } else {
- shapeToPath(s);
- this.gc.fill();
- }
- }
-
- /**
- * Returns the current font used for drawing text.
- *
- * @return The current font (never {@code null}).
- *
- * @see #setFont(java.awt.Font)
- */
- @Override
- public Font getFont() {
- return this.font;
- }
-
- /**
- * Sets the font to be used for drawing text.
- *
- * @param font the font ({@code null} is permitted but ignored).
- *
- * @see #getFont()
- */
- @Override
- public void setFont(Font font) {
- if (font == null) {
- return;
- }
- this.font = font;
- FontWeight weight = font.isBold() ? FontWeight.BOLD : FontWeight.NORMAL;
- FontPosture posture = font.isItalic()
- ? FontPosture.ITALIC : FontPosture.REGULAR;
- this.gc.setFont(javafx.scene.text.Font.font(font.getFamily(),
- weight, posture, font.getSize()));
- }
-
- /**
- * Returns the font metrics for the specified font.
- *
- * @param f the font.
- *
- * @return The font metrics.
- */
- @Override
- public FontMetrics getFontMetrics(Font f) {
- return this.fmImage.createGraphics().getFontMetrics(f);
- }
-
- /**
- * Returns the font render context. The implementation here returns the
- * {@code FontRenderContext} for an image that is maintained
- * internally (as for {@link #getFontMetrics}).
- *
- * @return The font render context.
- */
- @Override
- public FontRenderContext getFontRenderContext() {
- return this.fontRenderContext;
- }
-
- /**
- * Draws a string at {@code (x, y)}. The start of the text at the
- * baseline level will be aligned with the {@code (x, y)} point.
- *
- * @param str the string ({@code null} not permitted).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- *
- * @see #drawString(java.lang.String, float, float)
- */
- @Override
- public void drawString(String str, int x, int y) {
- drawString(str, (float) x, (float) y);
- }
-
- /**
- * Draws a string at {@code (x, y)}. The start of the text at the
- * baseline level will be aligned with the {@code (x, y)} point.
- *
- * @param str the string ({@code null} not permitted).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- */
- @Override
- public void drawString(String str, float x, float y) {
- if (str == null) {
- throw new NullPointerException("Null 'str' argument.");
- }
- this.gc.fillText(str, x, y);
- }
-
- /**
- * Draws a string of attributed characters at {@code (x, y)}. The
- * call is delegated to
- * {@link #drawString(AttributedCharacterIterator, float, float)}.
- *
- * @param iterator an iterator for the characters.
- * @param x the x-coordinate.
- * @param y the x-coordinate.
- */
- @Override
- public void drawString(AttributedCharacterIterator iterator, int x, int y) {
- drawString(iterator, (float) x, (float) y);
- }
-
- /**
- * Draws a string of attributed characters at {@code (x, y)}.
- *
- * @param iterator an iterator over the characters ({@code null} not
- * permitted).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- */
- @Override
- public void drawString(AttributedCharacterIterator iterator, float x,
- float y) {
- Set<AttributedCharacterIterator.Attribute>
- s = iterator.getAllAttributeKeys();
- if (!s.isEmpty()) {
- TextLayout layout = new TextLayout(iterator,
- getFontRenderContext());
- layout.draw(this, x, y);
- } else {
- StringBuilder strb = new StringBuilder();
- iterator.first();
- for (int i = iterator.getBeginIndex(); i < iterator.getEndIndex();
- i++) {
- strb.append(iterator.current());
- iterator.next();
- }
- drawString(strb.toString(), x, y);
- }
- }
-
- /**
- * Draws the specified glyph vector at the location {@code (x, y)}.
- *
- * @param g the glyph vector ({@code null} not permitted).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- */
- @Override
- public void drawGlyphVector(GlyphVector g, float x, float y) {
- fill(g.getOutline(x, y));
- }
-
- /**
- * Applies the translation {@code (tx, ty)}. This call is delegated
- * to {@link #translate(double, double)}.
- *
- * @param tx the x-translation.
- * @param ty the y-translation.
- *
- * @see #translate(double, double)
- */
- @Override
- public void translate(int tx, int ty) {
- translate((double) tx, (double) ty);
- }
-
- /**
- * Applies the translation {@code (tx, ty)}.
- *
- * @param tx the x-translation.
- * @param ty the y-translation.
- */
- @Override
- public void translate(double tx, double ty) {
- this.transform.translate(tx, ty);
- this.gc.translate(tx, ty);
- }
-
- /**
- * Applies a rotation (anti-clockwise) about {@code (0, 0)}.
- *
- * @param theta the rotation angle (in radians).
- */
- @Override
- public void rotate(double theta) {
- this.transform.rotate(theta);
- this.gc.rotate(theta * Math.PI / 180);
- }
-
- /**
- * Applies a rotation (anti-clockwise) about {@code (x, y)}.
- *
- * @param theta the rotation angle (in radians).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- */
- @Override
- public void rotate(double theta, double x, double y) {
- translate(x, y);
- rotate(theta);
- translate(-x, -y);
- }
-
- /**
- * Applies a scale transformation.
- *
- * @param sx the x-scaling factor.
- * @param sy the y-scaling factor.
- */
- @Override
- public void scale(double sx, double sy) {
- this.transform.scale(sx, sy);
- this.gc.scale(sx, sy);
- }
-
- /**
- * Applies a shear transformation. This is equivalent to the following
- * call to the {@code transform} method:
- * <br><br>
- * <ul><li>
- * {@code transform(AffineTransform.getShearInstance(shx, shy));}
- * </ul>
- *
- * @param shx the x-shear factor.
- * @param shy the y-shear factor.
- */
- @Override
- public void shear(double shx, double shy) {
- transform(AffineTransform.getShearInstance(shx, shy));
- }
-
- /**
- * Applies this transform to the existing transform by concatenating it.
- *
- * @param t the transform ({@code null} not permitted).
- */
- @Override
- public void transform(AffineTransform t) {
- AffineTransform tx = getTransform();
- tx.concatenate(t);
- setTransform(tx);
- }
-
- /**
- * Returns a copy of the current transform.
- *
- * @return A copy of the current transform (never {@code null}).
- *
- * @see #setTransform(java.awt.geom.AffineTransform)
- */
- @Override
- public AffineTransform getTransform() {
- return (AffineTransform) this.transform.clone();
- }
-
- /**
- * Sets the transform.
- *
- * @param t the new transform ({@code null} permitted, resets to the
- * identity transform).
- *
- * @see #getTransform()
- */
- @Override
- public void setTransform(AffineTransform t) {
- if (t == null) {
- this.transform = new AffineTransform();
- t = this.transform;
- } else {
- this.transform = new AffineTransform(t);
- }
- this.gc.setTransform(t.getScaleX(), t.getShearY(), t.getShearX(),
- t.getScaleY(), t.getTranslateX(), t.getTranslateY());
- }
-
- /**
- * Returns {@code true} if the rectangle (in device space) intersects
- * with the shape (the interior, if {@code onStroke} is false,
- * otherwise the stroked outline of the shape).
- *
- * @param rect a rectangle (in device space).
- * @param s the shape.
- * @param onStroke test the stroked outline only?
- *
- * @return A boolean.
- */
- @Override
- public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
- Shape ts;
- if (onStroke) {
- ts = this.transform.createTransformedShape(
- this.stroke.createStrokedShape(s));
- } else {
- ts = this.transform.createTransformedShape(s);
- }
- if (!rect.getBounds2D().intersects(ts.getBounds2D())) {
- return false;
- }
- Area a1 = new Area(rect);
- Area a2 = new Area(ts);
- a1.intersect(a2);
- return !a1.isEmpty();
- }
-
- /**
- * Not implemented - the method does nothing.
- */
- @Override
- public void setPaintMode() {
- // not implemented
- }
-
- /**
- * Not implemented - the method does nothing.
- */
- @Override
- public void setXORMode(Color c1) {
- // not implemented
- }
-
- /**
- * Returns the bounds of the user clipping region.
- *
- * @return The clip bounds (possibly {@code null}).
- *
- * @see #getClip()
- */
- @Override
- public Rectangle getClipBounds() {
- if (this.clip == null) {
- return null;
- }
- return getClip().getBounds();
- }
-
- /**
- * Returns the user clipping region. The initial default value is
- * {@code null}.
- *
- * @return The user clipping region (possibly {@code null}).
- *
- * @see #setClip(java.awt.Shape)
- */
- @Override
- public Shape getClip() {
- if (this.clip == null) {
- return null;
- }
- AffineTransform inv;
- try {
- inv = this.transform.createInverse();
- return inv.createTransformedShape(this.clip);
- } catch (NoninvertibleTransformException ex) {
- return null;
- }
- }
-
- /**
- * Sets the user clipping region.
- *
- * @param shape the new user clipping region ({@code null} permitted).
- *
- * @see #getClip()
- */
- @Override
- public void setClip(Shape shape) {
- boolean restored = false;
- while (this.saveCount > 0) {
- this.gc.restore();
- restored = true;
- this.saveCount--;
- }
- if (restored) {
- reapplyAttributes();
- }
- // null is handled fine here...
- this.clip = this.transform.createTransformedShape(shape);
- if (clip != null && !this.clippingDisabled) {
- this.gc.save();
- this.saveCount++;
- shapeToPath(shape);
- this.gc.clip();
- }
- }
-
- private void reapplyAttributes() {
- setPaint(this.paint);
- setBackground(this.background);
- setStroke(this.stroke);
- setFont(this.font);
- setTransform(this.transform);
- }
-
- /**
- * Clips to the intersection of the current clipping region and the
- * specified shape.
- *
- * According to the Oracle API specification, this method will accept a
- * {@code null} argument, but there is an open bug report (since 2004)
- * that suggests this is wrong:
- * <p>
- * <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206189">
- * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206189</a>
- *
- * In this implementation, a {@code null} argument is not permitted.
- *
- * @param s the clip shape ({@code null} not permitted).
- */
- @Override
- public void clip(Shape s) {
- if (this.clip == null) {
- setClip(s);
- return;
- }
- Shape ts = this.transform.createTransformedShape(s);
- Shape clipNew;
- if (!ts.intersects(this.clip.getBounds2D())) {
- clipNew = new Rectangle2D.Double();
- } else {
- Area a1 = new Area(ts);
- Area a2 = new Area(this.clip);
- a1.intersect(a2);
- clipNew = new Path2D.Double(a1);
- }
- this.clip = clipNew;
- if (!this.clippingDisabled) {
- this.gc.save();
- this.saveCount++;
- shapeToPath(this.clip);
- this.gc.clip();
- }
- }
-
- /**
- * Clips to the intersection of the current clipping region and the
- * specified rectangle.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- */
- @Override
- public void clipRect(int x, int y, int width, int height) {
- setRect(x, y, width, height);
- clip(this.rect);
- }
-
- /**
- * Sets the user clipping region to the specified rectangle.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- *
- * @see #getClip()
- */
- @Override
- public void setClip(int x, int y, int width, int height) {
- setRect(x, y, width, height);
- setClip(this.rect);
- }
-
- /**
- * Draws a line from {@code (x1, y1)} to {@code (x2, y2)} using
- * the current {@code paint} and {@code stroke}.
- *
- * @param x1 the x-coordinate of the start point.
- * @param y1 the y-coordinate of the start point.
- * @param x2 the x-coordinate of the end point.
- * @param y2 the x-coordinate of the end point.
- */
- @Override
- public void drawLine(int x1, int y1, int x2, int y2) {
- if (this.line == null) {
- this.line = new Line2D.Double(x1, y1, x2, y2);
- } else {
- this.line.setLine(x1, y1, x2, y2);
- }
- draw(this.line);
- }
-
- /**
- * Fills the specified rectangle with the current {@code paint}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the rectangle width.
- * @param height the rectangle height.
- */
- @Override
- public void fillRect(int x, int y, int width, int height) {
- setRect(x, y, width, height);
- fill(this.rect);
- }
-
- /**
- * Clears the specified rectangle by filling it with the current
- * background color. If the background color is {@code null}, this
- * method will do nothing.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- *
- * @see #getBackground()
- */
- @Override
- public void clearRect(int x, int y, int width, int height) {
- if (getBackground() == null) {
- return; // we can't do anything
- }
- Paint saved = getPaint();
- setPaint(getBackground());
- fillRect(x, y, width, height);
- setPaint(saved);
- }
-
- /**
- * Draws a rectangle with rounded corners using the current
- * {@code paint} and {@code stroke}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- * @param arcWidth the arc-width.
- * @param arcHeight the arc-height.
- *
- * @see #fillRoundRect(int, int, int, int, int, int)
- */
- @Override
- public void drawRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight) {
- setRoundRect(x, y, width, height, arcWidth, arcHeight);
- draw(this.roundRect);
- }
-
- /**
- * Fills a rectangle with rounded corners using the current {@code paint}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- * @param arcWidth the arc-width.
- * @param arcHeight the arc-height.
- *
- * @see #drawRoundRect(int, int, int, int, int, int)
- */
- @Override
- public void fillRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight) {
- setRoundRect(x, y, width, height, arcWidth, arcHeight);
- fill(this.roundRect);
- }
-
- /**
- * Draws an oval framed by the rectangle {@code (x, y, width, height)}
- * using the current {@code paint} and {@code stroke}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- *
- * @see #fillOval(int, int, int, int)
- */
- @Override
- public void drawOval(int x, int y, int width, int height) {
- setOval(x, y, width, height);
- draw(this.oval);
- }
-
- /**
- * Fills an oval framed by the rectangle {@code (x, y, width, height)}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- *
- * @see #drawOval(int, int, int, int)
- */
- @Override
- public void fillOval(int x, int y, int width, int height) {
- setOval(x, y, width, height);
- fill(this.oval);
- }
-
- /**
- * Draws an arc contained within the rectangle
- * {@code (x, y, width, height)}, starting at {@code startAngle}
- * and continuing through {@code arcAngle} degrees using
- * the current {@code paint} and {@code stroke}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- * @param startAngle the start angle in degrees, 0 = 3 o'clock.
- * @param arcAngle the angle (anticlockwise) in degrees.
- *
- * @see #fillArc(int, int, int, int, int, int)
- */
- @Override
- public void drawArc(int x, int y, int width, int height, int startAngle,
- int arcAngle) {
- setArc(x, y, width, height, startAngle, arcAngle);
- draw(this.arc);
- }
-
- /**
- * Fills an arc contained within the rectangle
- * {@code (x, y, width, height)}, starting at {@code startAngle}
- * and continuing through {@code arcAngle} degrees, using
- * the current {@code paint}.
- *
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width.
- * @param height the height.
- * @param startAngle the start angle in degrees, 0 = 3 o'clock.
- * @param arcAngle the angle (anticlockwise) in degrees.
- *
- * @see #drawArc(int, int, int, int, int, int)
- */
- @Override
- public void fillArc(int x, int y, int width, int height, int startAngle,
- int arcAngle) {
- setArc(x, y, width, height, startAngle, arcAngle);
- fill(this.arc);
- }
-
- /**
- * Draws the specified multi-segment line using the current
- * {@code paint} and {@code stroke}.
- *
- * @param xPoints the x-points.
- * @param yPoints the y-points.
- * @param nPoints the number of points to use for the polyline.
- */
- @Override
- public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
- GeneralPath p = createPolygon(xPoints, yPoints, nPoints, false);
- draw(p);
- }
-
- /**
- * Draws the specified polygon using the current {@code paint} and
- * {@code stroke}.
- *
- * @param xPoints the x-points.
- * @param yPoints the y-points.
- * @param nPoints the number of points to use for the polygon.
- *
- * @see #fillPolygon(int[], int[], int) */
- @Override
- public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
- GeneralPath p = createPolygon(xPoints, yPoints, nPoints, true);
- draw(p);
- }
-
- /**
- * Fills the specified polygon using the current {@code paint}.
- *
- * @param xPoints the x-points.
- * @param yPoints the y-points.
- * @param nPoints the number of points to use for the polygon.
- *
- * @see #drawPolygon(int[], int[], int)
- */
- @Override
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
- GeneralPath p = createPolygon(xPoints, yPoints, nPoints, true);
- fill(p);
- }
-
- /**
- * Creates a polygon from the specified {@code x} and
- * {@code y} coordinate arrays.
- *
- * @param xPoints the x-points.
- * @param yPoints the y-points.
- * @param nPoints the number of points to use for the polyline.
- * @param close closed?
- *
- * @return A polygon.
- */
- public GeneralPath createPolygon(int[] xPoints, int[] yPoints,
- int nPoints, boolean close) {
- GeneralPath p = new GeneralPath();
- p.moveTo(xPoints[0], yPoints[0]);
- for (int i = 1; i < nPoints; i++) {
- p.lineTo(xPoints[i], yPoints[i]);
- }
- if (close) {
- p.closePath();
- }
- return p;
- }
-
- /**
- * Draws an image at the location {@code (x, y)}. Note that the
- * {@code observer} is ignored.
- *
- * @param img the image.
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param observer ignored.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
- int w = img.getWidth(observer);
- if (w < 0) {
- return false;
- }
- int h = img.getHeight(observer);
- if (h < 0) {
- return false;
- }
- return drawImage(img, x, y, w, h, observer);
- }
-
- /**
- * Draws an image at the location {@code (x, y)}. Note that the
- * {@code observer} is ignored.
- *
- * @param img the image.
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param width the width of the target rectangle for the image.
- * @param height the height of the target rectangle for the image.
- * @param observer ignored.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(final Image img, int x, int y,
- int width, int height, ImageObserver observer) {
- final BufferedImage buffered;
- if (img instanceof BufferedImage) {
- buffered = (BufferedImage) img;
- } else {
- buffered = new BufferedImage(width, height,
- BufferedImage.TYPE_INT_ARGB);
- final Graphics2D g2 = buffered.createGraphics();
- g2.drawImage(img, 0, 0, width, height, null);
- g2.dispose();
- }
- javafx.scene.image.WritableImage fxImage = SwingFXUtils.toFXImage(
- buffered, null);
- this.gc.drawImage(fxImage, x, y, width, height);
- return true;
- }
-
- /**
- * Draws an image at the location {@code (x, y)}. Note that the
- * {@code observer} is ignored.
- *
- * @param img the image ({@code null} not permitted).
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param bgcolor the background color ({@code null} permitted).
- * @param observer ignored.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(Image img, int x, int y, Color bgcolor,
- ImageObserver observer) {
- int w = img.getWidth(null);
- if (w < 0) {
- return false;
- }
- int h = img.getHeight(null);
- if (h < 0) {
- return false;
- }
- return drawImage(img, x, y, w, h, bgcolor, observer);
- }
-
- /**
- * Draws an image to the rectangle {@code (x, y, w, h)} (scaling it if
- * required), first filling the background with the specified color. Note
- * that the {@code observer} is ignored.
- *
- * @param img the image.
- * @param x the x-coordinate.
- * @param y the y-coordinate.
- * @param w the width.
- * @param h the height.
- * @param bgcolor the background color ({@code null} permitted).
- * @param observer ignored.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(Image img, int x, int y, int w, int h,
- Color bgcolor, ImageObserver observer) {
- Paint saved = getPaint();
- setPaint(bgcolor);
- fillRect(x, y, w, h);
- setPaint(saved);
- return drawImage(img, x, y, w, h, observer);
- }
-
- /**
- * Draws part of an image (defined by the source rectangle
- * {@code (sx1, sy1, sx2, sy2)}) into the destination rectangle
- * {@code (dx1, dy1, dx2, dy2)}. Note that the {@code observer}
- * is ignored.
- *
- * @param img the image.
- * @param dx1 the x-coordinate for the top left of the destination.
- * @param dy1 the y-coordinate for the top left of the destination.
- * @param dx2 the x-coordinate for the bottom right of the destination.
- * @param dy2 the y-coordinate for the bottom right of the destination.
- * @param sx1 the x-coordinate for the top left of the source.
- * @param sy1 the y-coordinate for the top left of the source.
- * @param sx2 the x-coordinate for the bottom right of the source.
- * @param sy2 the y-coordinate for the bottom right of the source.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
- int w = dx2 - dx1;
- int h = dy2 - dy1;
- BufferedImage img2 = new BufferedImage(BufferedImage.TYPE_INT_ARGB,
- w, h);
- Graphics2D g2 = img2.createGraphics();
- g2.drawImage(img, 0, 0, w, h, sx1, sy1, sx2, sy2, null);
- return drawImage(img2, dx1, dx2, null);
- }
-
- /**
- * Draws part of an image (defined by the source rectangle
- * {@code (sx1, sy1, sx2, sy2)}) into the destination rectangle
- * {@code (dx1, dy1, dx2, dy2)}. The destination rectangle is first
- * cleared by filling it with the specified {@code bgcolor}. Note that
- * the {@code observer} is ignored.
- *
- * @param img the image.
- * @param dx1 the x-coordinate for the top left of the destination.
- * @param dy1 the y-coordinate for the top left of the destination.
- * @param dx2 the x-coordinate for the bottom right of the destination.
- * @param dy2 the y-coordinate for the bottom right of the destination.
- * @param sx1 the x-coordinate for the top left of the source.
- * @param sy1 the y-coordinate for the top left of the source.
- * @param sx2 the x-coordinate for the bottom right of the source.
- * @param sy2 the y-coordinate for the bottom right of the source.
- * @param bgcolor the background color ({@code null} permitted).
- * @param observer ignored.
- *
- * @return {@code true} if the image is drawn.
- */
- @Override
- public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2, Color bgcolor,
- ImageObserver observer) {
- Paint saved = getPaint();
- setPaint(bgcolor);
- fillRect(dx1, dy1, dx2 - dx1, dy2 - dy1);
- setPaint(saved);
- return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
- }
-
- @Override
- public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
- BufferedImage bi = convertRenderedImage(img);
- drawImage(bi, xform, null);
- }
-
- /**
- * Converts a rendered image to a {@code BufferedImage}. This utility
- * method has come from a forum post by Jim Moore at:
- * <p>
- * <a href="http://www.jguru.com/faq/view.jsp?EID=114602">
- * http://www.jguru.com/faq/view.jsp?EID=114602</a>
- *
- * @param img the rendered image.
- *
- * @return A buffered image.
- */
- private static BufferedImage convertRenderedI...
[truncated message content] |
|
From: <mu...@us...> - 2016-01-25 20:34:41
|
Revision: 3337
http://sourceforge.net/p/jfreechart/code/3337
Author: mungady
Date: 2016-01-25 20:34:39 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Settings for JavaFX build.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/pom.xml
Modified: branches/jfreechart-1.0.x-branch/pom.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/pom.xml 2016-01-25 20:26:37 UTC (rev 3336)
+++ branches/jfreechart-1.0.x-branch/pom.xml 2016-01-25 20:34:39 UTC (rev 3337)
@@ -8,9 +8,9 @@
<name>JFreeChart</name>
- <artifactId>jfreechart</artifactId>
+ <artifactId>jfreechart-fx</artifactId>
<groupId>org.jfree</groupId>
- <version>1.0.19</version>
+ <version>1.0.20-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- this is required to host it on Sonatype's OSSRH -->
@@ -44,15 +44,9 @@
<mailingLists>
<mailingList>
<name>JFreeChart Developer List</name>
- <subscribe>
- jfr...@li...?subject=subscribe
- </subscribe>
- <unsubscribe>
- jfr...@li...?subject=unsubscribe
- </unsubscribe>
- <archive>
- http://sourceforge.net/mailarchive/forum.php?forum=jfreechart-dev
- </archive>
+ <subscribe>jfr...@li...?subject=subscribe</subscribe>
+ <unsubscribe>jfr...@li...?subject=unsubscribe</unsubscribe>
+ <archive>http://sourceforge.net/mailarchive/forum.php?forum=jfreechart-dev</archive>
</mailingList>
</mailingLists>
@@ -78,6 +72,12 @@
</dependency>
<dependency>
+ <groupId>org.jfree</groupId>
+ <artifactId>fxgraphics2d</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -94,10 +94,10 @@
</dependencies>
<distributionManagement>
- <snapshotRepository>
- <id>ossrh</id>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- </snapshotRepository>
+ <snapshotRepository>
+ <id>ossrh</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
</distributionManagement>
<build>
@@ -115,8 +115,7 @@
</resource>
</resources>
- <plugins>
-
+ <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -126,8 +125,8 @@
<target>${project.target.level}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<excludes>
- <exclude>org/jfree/chart/demo/**</exclude>
- <exclude>org/jfree/chart/fx/**</exclude>
+ <exclude>org/jfree/chart/demo/**</exclude>
+ <exclude>org/jfree/chart/fx/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -240,51 +239,49 @@
<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>
+ <project.source.level>1.8</project.source.level>
+ <project.target.level>1.8</project.target.level>
</properties>
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
- <executions>
- <execution>
- <id>attach-javadoc</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <sourceFileExcludes>
- <exclude>org/jfree/chart/fx/**</exclude>
- </sourceFileExcludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <sourceFileExcludes>
+ <!-- <exclude>org/jfree/chart/fx/**</exclude> -->
+ </sourceFileExcludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 20:26:39
|
Revision: 3336
http://sourceforge.net/p/jfreechart/code/3336
Author: mungady
Date: 2016-01-25 20:26:37 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
POM file to build for JDK 1.8 (includes JavaFX support)
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/pom-1.8.xml
Added: branches/jfreechart-1.0.x-branch/pom-1.8.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/pom-1.8.xml (rev 0)
+++ branches/jfreechart-1.0.x-branch/pom-1.8.xml 2016-01-25 20:26:37 UTC (rev 3336)
@@ -0,0 +1,290 @@
+<?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.19</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>9</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>
+ jfr...@li...?subject=subscribe
+ </subscribe>
+ <unsubscribe>
+ jfr...@li...?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.23</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>
+
+ </dependencies>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>ossrh</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <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.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>${project.source.level}</source>
+ <target>${project.target.level}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <excludes>
+ <exclude>org/jfree/chart/demo/**</exclude>
+ <exclude>org/jfree/chart/fx/**</exclude>
+ </excludes>
+ </configuration>
+ </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.6</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.2</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>ossrh</serverId>
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>false</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+
+ <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>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</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>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <sourceFileExcludes>
+ <exclude>org/jfree/chart/fx/**</exclude>
+ </sourceFileExcludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 20:26:13
|
Revision: 3335
http://sourceforge.net/p/jfreechart/code/3335
Author: mungady
Date: 2016-01-25 20:26:11 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
POM file to build for JDK 1.6 (no JavaFX)
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/pom-1.6.xml
Added: branches/jfreechart-1.0.x-branch/pom-1.6.xml
===================================================================
--- branches/jfreechart-1.0.x-branch/pom-1.6.xml (rev 0)
+++ branches/jfreechart-1.0.x-branch/pom-1.6.xml 2016-01-25 20:26:11 UTC (rev 3335)
@@ -0,0 +1,290 @@
+<?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.19</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>9</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>
+ jfr...@li...?subject=subscribe
+ </subscribe>
+ <unsubscribe>
+ jfr...@li...?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.23</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>
+
+ </dependencies>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>ossrh</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <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.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>${project.source.level}</source>
+ <target>${project.target.level}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <excludes>
+ <exclude>org/jfree/chart/demo/**</exclude>
+ <exclude>org/jfree/chart/fx/**</exclude>
+ </excludes>
+ </configuration>
+ </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.6</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.2</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>ossrh</serverId>
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>false</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ </plugin>
+
+ <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>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</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>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <sourceFileExcludes>
+ <exclude>org/jfree/chart/fx/**</exclude>
+ </sourceFileExcludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-25 19:30:31
|
Revision: 3334
http://sourceforge.net/p/jfreechart/code/3334
Author: mungady
Date: 2016-01-25 19:30:29 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Update Javadocs.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartColor.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartColor.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartColor.java 2016-01-18 21:21:02 UTC (rev 3333)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartColor.java 2016-01-25 19:30:29 UTC (rev 3334)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ---------------
* ChartColor.java
* ---------------
- * (C) Copyright 2003-2011, by Cameron Riley and Contributors.
+ * (C) Copyright 2003-2016, by Cameron Riley and Contributors.
*
* Original Author: Cameron Riley;
* Contributor(s): David Gilbert (for Object Refinery Limited);
@@ -140,11 +140,11 @@
}
/**
- * 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.
+ * Convenience method to return an array of {@code Paint} objects that
+ * represent the pre-defined colors in the {@code Color} and
+ * {@code ChartColor} objects.
*
- * @return An array of objects with the <code>Paint</code> interface.
+ * @return An array of objects with the {@code Paint} interface.
*/
public static Paint[] createDefaultPaintArray() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-18 21:21:05
|
Revision: 3333
http://sourceforge.net/p/jfreechart/code/3333
Author: mungady
Date: 2016-01-18 21:21:02 +0000 (Mon, 18 Jan 2016)
Log Message:
-----------
Fix for auto tick selection when data values are extremely large.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/NumberAxis.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/NumberAxis.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/NumberAxis.java 2016-01-16 17:54:08 UTC (rev 3332)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/NumberAxis.java 2016-01-18 21:21:02 UTC (rev 3333)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ---------------
* NumberAxis.java
* ---------------
- * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): Laurence Vanhelsuwe;
@@ -98,6 +98,8 @@
* 02-Jul-2013 : Use ParamChecks (DG);
* 01-Aug-2013 : Added attributedLabel override to support superscripts,
* subscripts and more (DG);
+ * 18-Jan-2016 : Update auto-tick unit selection to work better for large
+ * values (DG);
*
*/
@@ -132,12 +134,11 @@
* <P>
* If the axis is set up to automatically determine its range to fit the data,
* you can ensure that the range includes zero (statisticians usually prefer
- * this) by setting the <code>autoRangeIncludesZero</code> flag to
- * <code>true</code>.
+ * this) by setting the {@code autoRangeIncludesZero} flag to
+ * {@code true}.
* <P>
- * The <code>NumberAxis</code> class has a mechanism for automatically
- * selecting a tick unit that is appropriate for the current axis range. This
- * mechanism is an adaptation of code suggested by Laurence Vanhelsuwe.
+ * The {@code NumberAxis} class has a mechanism for automatically
+ * selecting a tick unit that is appropriate for the current axis range.
*/
public class NumberAxis extends ValueAxis implements Cloneable, Serializable {
@@ -196,7 +197,7 @@
/**
* Constructs a number axis, using default values where necessary.
*
- * @param label the axis label (<code>null</code> permitted).
+ * @param label the axis label ({@code null} permitted).
*/
public NumberAxis(String label) {
super(label, NumberAxis.createStandardTickUnits());
@@ -211,7 +212,7 @@
/**
* Returns the axis range type.
*
- * @return The axis range type (never <code>null</code>).
+ * @return The axis range type (never {@code null}).
*
* @see #setRangeType(RangeType)
*/
@@ -222,7 +223,7 @@
/**
* Sets the axis range type.
*
- * @param rangeType the range type (<code>null</code> not permitted).
+ * @param rangeType the range type ({@code null} not permitted).
*
* @see #getRangeType()
*/
@@ -246,7 +247,7 @@
* Sets the flag that indicates whether or not the axis range, if
* automatically calculated, is forced to include zero.
* <p>
- * If the flag is changed to <code>true</code>, the axis range is
+ * If the flag is changed to {@code true}, the axis range is
* recalculated.
* <p>
* Any change to the flag will trigger an {@link AxisChangeEvent}.
@@ -298,8 +299,8 @@
/**
* Returns the tick unit for the axis.
* <p>
- * Note: if the <code>autoTickUnitSelection</code> flag is
- * <code>true</code> the tick unit may be changed while the axis is being
+ * Note: if the {@code autoTickUnitSelection} flag is
+ * {@code true} the tick unit may be changed while the axis is being
* drawn, so in that case the return value from this method may be
* irrelevant if the method is called before the axis has been drawn.
*
@@ -319,7 +320,7 @@
* restore it using the {@link ValueAxis#setAutoTickUnitSelection(boolean)}
* method).
*
- * @param unit the new tick unit (<code>null</code> not permitted).
+ * @param unit the new tick unit ({@code null} not permitted).
*
* @see #getTickUnit()
* @see #setTickUnit(NumberTickUnit, boolean, boolean)
@@ -336,7 +337,7 @@
* (you can restore it using the
* {@link ValueAxis#setAutoTickUnitSelection(boolean)} method).
*
- * @param unit the new tick unit (<code>null</code> not permitted).
+ * @param unit the new tick unit ({@code null} not permitted).
* @param notify notify listeners?
* @param turnOffAutoSelect turn off the auto-tick selection?
*/
@@ -358,7 +359,7 @@
* Returns the number format override. If this is non-null, then it will
* be used to format the numbers on the axis.
*
- * @return The number formatter (possibly <code>null</code>).
+ * @return The number formatter (possibly {@code null}).
*
* @see #setNumberFormatOverride(NumberFormat)
*/
@@ -370,7 +371,7 @@
* Sets the number format override. If this is non-null, then it will be
* used to format the numbers on the axis.
*
- * @param formatter the number formatter (<code>null</code> permitted).
+ * @param formatter the number formatter ({@code null} permitted).
*
* @see #getNumberFormatOverride()
*/
@@ -382,7 +383,7 @@
/**
* Returns the (optional) marker band for the axis.
*
- * @return The marker band (possibly <code>null</code>).
+ * @return The marker band (possibly {@code null}).
*
* @see #setMarkerBand(MarkerAxisBand)
*/
@@ -393,10 +394,10 @@
/**
* Sets the marker band for the axis.
* <P>
- * The marker band is optional, leave it set to <code>null</code> if you
+ * The marker band is optional, leave it set to {@code null} if you
* don't require it.
*
- * @param band the new band (<code>null</code> permitted).
+ * @param band the new band ({@code null} permitted).
*
* @see #getMarkerBand()
*/
@@ -634,17 +635,17 @@
* Draws the axis on a Java 2D graphics device (such as the screen or a
* printer).
*
- * @param g2 the graphics device (<code>null</code> not permitted).
+ * @param g2 the graphics device ({@code null} not permitted).
* @param cursor the cursor location.
* @param plotArea the area within which the axes and data should be drawn
- * (<code>null</code> not permitted).
+ * ({@code null} not permitted).
* @param dataArea the area within which the data should be drawn
- * (<code>null</code> not permitted).
- * @param edge the location of the axis (<code>null</code> not permitted).
+ * ({@code null} not permitted).
+ * @param edge the location of the axis ({@code null} not permitted).
* @param plotState collects information about the plot
- * (<code>null</code> permitted).
+ * ({@code null} permitted).
*
- * @return The axis state (never <code>null</code>).
+ * @return The axis state (never {@code null}).
*/
@Override
public AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea,
@@ -708,11 +709,11 @@
/**
* Creates a collection of standard tick units. The supplied locale is
* used to create the number formatter (a localised instance of
- * <code>NumberFormat</code>).
+ * {@code NumberFormat}).
* <P>
* If you don't like these defaults, create your own instance of
* {@link TickUnits} and then pass it to the
- * <code>setStandardTickUnits()</code> method.
+ * {@code setStandardTickUnits()} method.
*
* @param locale the locale.
*
@@ -838,31 +839,34 @@
* @param dataArea the area defined by the axes.
* @param edge the axis location.
*/
- protected void selectHorizontalAutoTickUnit(Graphics2D g2,
+ protected void selectHorizontalAutoTickUnit(Graphics2D g2,
Rectangle2D dataArea, RectangleEdge edge) {
- double tickLabelWidth = estimateMaximumTickLabelWidth(g2,
- getTickUnit());
+ TickUnit unit = getTickUnit();
+ TickUnitSource tickUnitSource = getStandardTickUnits();
+ // we should use the current tick unit if it gives a count in the range
+ // 2 to 40 otherwise just estimate one that will give a count <= 20
+ double length = getRange().getLength();
+ int count = (int) (length / unit.getSize());
+ if (count < 2 || count > 40) {
+ unit = tickUnitSource.getCeilingTickUnit(length / 20);
+ }
+ double tickLabelWidth = estimateMaximumTickLabelWidth(g2, unit);
- // start with the current tick unit...
- TickUnitSource tickUnits = getStandardTickUnits();
- TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
+ TickUnit unit1 = tickUnitSource.getCeilingTickUnit(unit);
double unit1Width = lengthToJava2D(unit1.getSize(), dataArea, edge);
// then extrapolate...
double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
-
- NumberTickUnit unit2 = (NumberTickUnit) tickUnits.getCeilingTickUnit(
- guess);
+ NumberTickUnit unit2 = (NumberTickUnit)
+ tickUnitSource.getCeilingTickUnit(guess);
double unit2Width = lengthToJava2D(unit2.getSize(), dataArea, edge);
tickLabelWidth = estimateMaximumTickLabelWidth(g2, unit2);
if (tickLabelWidth > unit2Width) {
- unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
+ unit2 = (NumberTickUnit) tickUnitSource.getLargerTickUnit(unit2);
}
-
setTickUnit(unit2, false, false);
-
}
/**
@@ -883,10 +887,11 @@
TickUnitSource tickUnits = getStandardTickUnits();
TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
double unitHeight = lengthToJava2D(unit1.getSize(), dataArea, edge);
- double guess = unit1.getSize();
- if (unitHeight > 0) {
- // then extrapolate...
+ double guess;
+ if (unitHeight > 0) { // then extrapolate...
guess = (tickLabelHeight / unitHeight) * unit1.getSize();
+ } else {
+ guess = getRange().getLength() / 20.0;
}
NumberTickUnit unit2 = (NumberTickUnit) tickUnits.getCeilingTickUnit(
guess);
@@ -1144,7 +1149,7 @@
/**
* Tests the axis for equality with an arbitrary object.
*
- * @param obj the object (<code>null</code> permitted).
+ * @param obj the object ({@code null} permitted).
*
* @return A boolean.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-16 17:54:11
|
Revision: 3332
http://sourceforge.net/p/jfreechart/code/3332
Author: mungady
Date: 2016-01-16 17:54:08 +0000 (Sat, 16 Jan 2016)
Log Message:
-----------
Fill background for marker labels.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2016-01-16 17:36:52 UTC (rev 3331)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2016-01-16 17:54:08 UTC (rev 3332)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ---------------------------
* AbstractXYItemRenderer.java
* ---------------------------
- * (C) Copyright 2002-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2002-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): Richard Atkinson;
@@ -178,6 +178,7 @@
import org.jfree.chart.urls.XYURLGenerator;
import org.jfree.chart.util.CloneUtils;
import org.jfree.chart.util.ParamChecks;
+import org.jfree.chart.util.TextUtils;
import org.jfree.data.Range;
import org.jfree.data.general.DatasetUtilities;
import org.jfree.data.xy.XYDataset;
@@ -243,7 +244,7 @@
/**
* Creates a renderer where the tooltip generator and the URL generator are
- * both <code>null</code>.
+ * both {@code null}.
*/
protected AbstractXYItemRenderer() {
super();
@@ -274,7 +275,7 @@
/**
* Returns the plot that the renderer is assigned to.
*
- * @return The plot (possibly <code>null</code>).
+ * @return The plot (possibly {@code null}).
*/
@Override
public XYPlot getPlot() {
@@ -284,7 +285,7 @@
/**
* Sets the plot that the renderer is assigned to.
*
- * @param plot the plot (<code>null</code> permitted).
+ * @param plot the plot ({@code null} permitted).
*/
@Override
public void setPlot(XYPlot plot) {
@@ -306,13 +307,12 @@
* @param info an optional info collection object to return data back to
* the caller.
*
- * @return The renderer state (never <code>null</code>).
+ * @return The renderer state (never {@code null}).
*/
@Override
public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea,
- XYPlot plot, XYDataset dataset, PlotRenderingInfo info) {
- XYItemRendererState state = new XYItemRendererState(info);
- return state;
+ XYPlot plot, XYDataset data, PlotRenderingInfo info) {
+ return new XYItemRendererState(info);
}
/**
@@ -343,7 +343,7 @@
* @param series the series index (zero based).
* @param item the item index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public XYItemLabelGenerator getItemLabelGenerator(int series, int item) {
@@ -366,7 +366,7 @@
*
* @param series the series index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public XYItemLabelGenerator getSeriesItemLabelGenerator(int series) {
@@ -378,7 +378,7 @@
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero based).
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*/
@Override
public void setSeriesItemLabelGenerator(int series,
@@ -390,7 +390,7 @@
/**
* Returns the base item label generator.
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public XYItemLabelGenerator getBaseItemLabelGenerator() {
@@ -401,7 +401,7 @@
* Sets the base item label generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*/
@Override
public void setBaseItemLabelGenerator(XYItemLabelGenerator generator) {
@@ -419,7 +419,7 @@
* @param series the series index (zero based).
* @param item the item index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public XYToolTipGenerator getToolTipGenerator(int series, int item) {
@@ -442,7 +442,7 @@
*
* @param series the series index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public XYToolTipGenerator getSeriesToolTipGenerator(int series) {
@@ -454,7 +454,7 @@
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero based).
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*/
@Override
public void setSeriesToolTipGenerator(int series,
@@ -466,7 +466,7 @@
/**
* Returns the base tool tip generator.
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*
* @see #setBaseToolTipGenerator(XYToolTipGenerator)
*/
@@ -479,7 +479,7 @@
* Sets the base tool tip generator and sends a {@link RendererChangeEvent}
* to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getBaseToolTipGenerator()
*/
@@ -494,7 +494,7 @@
/**
* Returns the URL generator for HTML image maps.
*
- * @return The URL generator (possibly <code>null</code>).
+ * @return The URL generator (possibly {@code null}).
*/
@Override
public XYURLGenerator getURLGenerator() {
@@ -505,7 +505,7 @@
* Sets the URL generator for HTML image maps and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param urlGenerator the URL generator (<code>null</code> permitted).
+ * @param urlGenerator the URL generator ({@code null} permitted).
*/
@Override
public void setURLGenerator(XYURLGenerator urlGenerator) {
@@ -518,7 +518,7 @@
* registered listeners. The annotation is added to the foreground
* layer.
*
- * @param annotation the annotation (<code>null</code> not permitted).
+ * @param annotation the annotation ({@code null} not permitted).
*/
@Override
public void addAnnotation(XYAnnotation annotation) {
@@ -530,8 +530,8 @@
* Adds an annotation to the specified layer and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param annotation the annotation (<code>null</code> not permitted).
- * @param layer the layer (<code>null</code> not permitted).
+ * @param annotation the annotation ({@code null} not permitted).
+ * @param layer the layer ({@code null} not permitted).
*/
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
@@ -555,7 +555,7 @@
* Removes the specified annotation and sends a {@link RendererChangeEvent}
* to all registered listeners.
*
- * @param annotation the annotation to remove (<code>null</code> not
+ * @param annotation the annotation to remove ({@code null} not
* permitted).
*
* @return A boolean to indicate whether or not the annotation was
@@ -610,7 +610,7 @@
* renderer.
*
* @return A collection of annotations (possibly empty but never
- * <code>null</code>).
+ * {@code null}).
*
* @since 1.0.13
*/
@@ -623,7 +623,7 @@
/**
* Returns the legend item label generator.
*
- * @return The label generator (never <code>null</code>).
+ * @return The label generator (never {@code null}).
*
* @see #setLegendItemLabelGenerator(XYSeriesLabelGenerator)
*/
@@ -636,7 +636,7 @@
* Sets the legend item label generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> not permitted).
+ * @param generator the generator ({@code null} not permitted).
*
* @see #getLegendItemLabelGenerator()
*/
@@ -650,7 +650,7 @@
/**
* Returns the legend item tool tip generator.
*
- * @return The tool tip generator (possibly <code>null</code>).
+ * @return The tool tip generator (possibly {@code null}).
*
* @see #setLegendItemToolTipGenerator(XYSeriesLabelGenerator)
*/
@@ -662,7 +662,7 @@
* Sets the legend item tool tip generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getLegendItemToolTipGenerator()
*/
@@ -675,7 +675,7 @@
/**
* Returns the legend item URL generator.
*
- * @return The URL generator (possibly <code>null</code>).
+ * @return The URL generator (possibly {@code null}).
*
* @see #setLegendItemURLGenerator(XYSeriesLabelGenerator)
*/
@@ -687,7 +687,7 @@
* Sets the legend item URL generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getLegendItemURLGenerator()
*/
@@ -700,9 +700,9 @@
* Returns the lower and upper bounds (range) of the x-values in the
* specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
*
- * @return The range (<code>null</code> if the dataset is <code>null</code>
+ * @return The range ({@code null} if the dataset is {@code null}
* or empty).
*
* @see #findRangeBounds(XYDataset)
@@ -716,10 +716,10 @@
* Returns the lower and upper bounds (range) of the x-values in the
* specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
* @param includeInterval include the interval (if any) for the dataset?
*
- * @return The range (<code>null</code> if the dataset is <code>null</code>
+ * @return The range ({@code null} if the dataset is {@code null}
* or empty).
*
* @since 1.0.13
@@ -747,9 +747,9 @@
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
*
- * @return The range (<code>null</code> if the dataset is <code>null</code>
+ * @return The range ({@code null} if the dataset is {@code null}
* or empty).
*
* @see #findDomainBounds(XYDataset)
@@ -763,10 +763,10 @@
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
* @param includeInterval include the interval (if any) for the dataset?
*
- * @return The range (<code>null</code> if the dataset is <code>null</code>
+ * @return The range ({@code null} if the dataset is {@code null}
* or empty).
*
* @since 1.0.13
@@ -812,7 +812,7 @@
* Returns a (possibly empty) collection of legend items for the series
* that this renderer is responsible for drawing.
*
- * @return The legend item collection (never <code>null</code>).
+ * @return The legend item collection (never {@code null}).
*/
@Override
public LegendItemCollection getLegendItems() {
@@ -1024,8 +1024,8 @@
* @param dataArea the area for plotting data (not yet adjusted for any 3D
* effect).
* @param value the value at which the grid line should be drawn.
- * @param paint the paint (<code>null</code> not permitted).
- * @param stroke the stroke (<code>null</code> not permitted).
+ * @param paint the paint ({@code null} not permitted).
+ * @param stroke the stroke ({@code null} not permitted).
*
* @since 1.0.5
*/
@@ -1100,7 +1100,8 @@
}
/**
- * Draws a vertical line on the chart to represent a 'range marker'.
+ * Draws a line on the chart perpendicular to the x-axis to mark
+ * a value or range of values.
*
* @param g2 the graphics device.
* @param plot the plot.
@@ -1122,18 +1123,16 @@
double v = domainAxis.valueToJava2D(value, dataArea,
plot.getDomainAxisEdge());
-
PlotOrientation orientation = plot.getOrientation();
Line2D line = null;
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(dataArea.getMinX(), v,
dataArea.getMaxX(), v);
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(v, dataArea.getMinY(), v,
dataArea.getMaxY());
} else {
- throw new IllegalStateException();
+ throw new IllegalStateException("Unrecognised orientation.");
}
final Composite originalComposite = g2.getComposite();
@@ -1148,18 +1147,22 @@
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
- g2.setPaint(marker.getLabelPaint());
- Point2D coordinates = calculateDomainMarkerTextAnchorPoint(
+ Point2D coords = calculateDomainMarkerTextAnchorPoint(
g2, orientation, dataArea, line.getBounds2D(),
marker.getLabelOffset(),
LengthAdjustmentType.EXPAND, anchor);
- TextUtilities.drawAlignedString(label, g2,
- (float) coordinates.getX(), (float) coordinates.getY(),
+ Rectangle2D r = TextUtils.calcAlignedStringBounds(label,
+ g2, (float) coords.getX(), (float) coords.getY(),
marker.getLabelTextAnchor());
+ g2.setPaint(marker.getLabelBackgroundColor());
+ g2.fill(r);
+ g2.setPaint(marker.getLabelPaint());
+ TextUtils.drawAlignedString(label, g2,
+ (float) coords.getX(), (float) coords.getY(),
+ marker.getLabelTextAnchor());
}
g2.setComposite(originalComposite);
- }
- else if (marker instanceof IntervalMarker) {
+ } else if (marker instanceof IntervalMarker) {
IntervalMarker im = (IntervalMarker) marker;
double start = im.getStartValue();
double end = im.getEndValue();
@@ -1184,8 +1187,7 @@
rect = new Rectangle2D.Double(dataArea.getMinX(),
low, dataArea.getWidth(),
high - low);
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
// clip left and right bounds to data area
low = Math.max(low, dataArea.getMinX());
high = Math.min(high, dataArea.getMaxX());
@@ -1205,8 +1207,7 @@
gp = t.transform(gp, rect);
}
g2.setPaint(gp);
- }
- else {
+ } else {
g2.setPaint(p);
}
g2.fill(rect);
@@ -1227,8 +1228,7 @@
line.setLine(end2d, y0, end2d, y1);
g2.draw(line);
}
- }
- else { // PlotOrientation.HORIZONTAL
+ } else { // PlotOrientation.HORIZONTAL
Line2D line = new Line2D.Double();
double x0 = dataArea.getMinX();
double x1 = dataArea.getMaxX();
@@ -1250,23 +1250,26 @@
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
- g2.setPaint(marker.getLabelPaint());
- Point2D coordinates = calculateDomainMarkerTextAnchorPoint(
+ Point2D coords = calculateDomainMarkerTextAnchorPoint(
g2, orientation, dataArea, rect,
marker.getLabelOffset(), marker.getLabelOffsetType(),
anchor);
+ Rectangle2D r = TextUtils.calcAlignedStringBounds(label,
+ g2, (float) coords.getX(), (float) coords.getY(),
+ marker.getLabelTextAnchor());
+ g2.setPaint(marker.getLabelBackgroundColor());
+ g2.fill(r);
+ g2.setPaint(marker.getLabelPaint());
TextUtilities.drawAlignedString(label, g2,
- (float) coordinates.getX(), (float) coordinates.getY(),
+ (float) coords.getX(), (float) coords.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(originalComposite);
-
}
-
}
/**
- * Calculates the (x, y) coordinates for drawing a marker label.
+ * Calculates the {@code (x, y)} coordinates for drawing a marker label.
*
* @param g2 the graphics device.
* @param orientation the plot orientation.
@@ -1297,7 +1300,8 @@
}
/**
- * Draws a horizontal line across the chart to represent a 'range marker'.
+ * Draws a line on the chart perpendicular to the y-axis to mark a value
+ * or range of values.
*
* @param g2 the graphics device.
* @param plot the plot.
@@ -1324,14 +1328,12 @@
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(v, dataArea.getMinY(), v,
dataArea.getMaxY());
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(dataArea.getMinX(), v,
dataArea.getMaxX(), v);
+ } else {
+ throw new IllegalStateException("Unrecognised orientation.");
}
- else {
- throw new IllegalStateException("Unknown orientation.");
- }
final Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
@@ -1345,18 +1347,22 @@
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
- g2.setPaint(marker.getLabelPaint());
- Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
+ Point2D coords = calculateRangeMarkerTextAnchorPoint(
g2, orientation, dataArea, line.getBounds2D(),
marker.getLabelOffset(),
LengthAdjustmentType.EXPAND, anchor);
+ Rectangle2D r = TextUtils.calcAlignedStringBounds(label,
+ g2, (float) coords.getX(), (float) coords.getY(),
+ marker.getLabelTextAnchor());
+ g2.setPaint(marker.getLabelBackgroundColor());
+ g2.fill(r);
+ g2.setPaint(marker.getLabelPaint());
TextUtilities.drawAlignedString(label, g2,
- (float) coordinates.getX(), (float) coordinates.getY(),
+ (float) coords.getX(), (float) coords.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(originalComposite);
- }
- else if (marker instanceof IntervalMarker) {
+ } else if (marker instanceof IntervalMarker) {
IntervalMarker im = (IntervalMarker) marker;
double start = im.getStartValue();
double end = im.getEndValue();
@@ -1381,8 +1387,7 @@
rect = new Rectangle2D.Double(low,
dataArea.getMinY(), high - low,
dataArea.getHeight());
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
// clip top and bottom bounds to data area
low = Math.max(low, dataArea.getMinY());
high = Math.min(high, dataArea.getMaxY());
@@ -1402,8 +1407,7 @@
gp = t.transform(gp, rect);
}
g2.setPaint(gp);
- }
- else {
+ } else {
g2.setPaint(p);
}
g2.fill(rect);
@@ -1424,8 +1428,7 @@
line.setLine(x0, end2d, x1, end2d);
g2.draw(line);
}
- }
- else { // PlotOrientation.HORIZONTAL
+ } else { // PlotOrientation.HORIZONTAL
Line2D line = new Line2D.Double();
double y0 = dataArea.getMinY();
double y1 = dataArea.getMaxY();
@@ -1447,13 +1450,18 @@
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
- g2.setPaint(marker.getLabelPaint());
- Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
+ Point2D coords = calculateRangeMarkerTextAnchorPoint(
g2, orientation, dataArea, rect,
marker.getLabelOffset(), marker.getLabelOffsetType(),
anchor);
+ Rectangle2D r = TextUtils.calcAlignedStringBounds(label,
+ g2, (float) coords.getX(), (float) coords.getY(),
+ marker.getLabelTextAnchor());
+ g2.setPaint(marker.getLabelBackgroundColor());
+ g2.fill(r);
+ g2.setPaint(marker.getLabelPaint());
TextUtilities.drawAlignedString(label, g2,
- (float) coordinates.getX(), (float) coordinates.getY(),
+ (float) coords.getX(), (float) coords.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(originalComposite);
@@ -1554,7 +1562,7 @@
/**
* Tests this renderer for equality with another object.
*
- * @param obj the object (<code>null</code> permitted).
+ * @param obj the object ({@code null} permitted).
*
* @return <code>true</code> or <code>false</code>.
*/
@@ -1616,7 +1624,7 @@
/**
* Returns the drawing supplier from the plot.
*
- * @return The drawing supplier (possibly <code>null</code>).
+ * @return The drawing supplier (possibly {@code null}).
*/
@Override
public DrawingSupplier getDrawingSupplier() {
@@ -1633,7 +1641,7 @@
* if it meets the criteria (usually means the (x, y) coordinate is the
* closest to the anchor point so far).
*
- * @param crosshairState the crosshair state (<code>null</code> permitted,
+ * @param crosshairState the crosshair state ({@code null} permitted,
* but the method does nothing in that case).
* @param x the x-value (in data space).
* @param y the y-value (in data space).
@@ -1641,7 +1649,7 @@
* @param rangeAxisIndex the index of the range axis for the point.
* @param transX the x-value translated to Java2D space.
* @param transY the y-value translated to Java2D space.
- * @param orientation the plot orientation (<code>null</code> not
+ * @param orientation the plot orientation ({@code null} not
* permitted).
*
* @since 1.0.4
@@ -1758,15 +1766,15 @@
* Adds an entity to the collection.
*
* @param entities the entity collection being populated.
- * @param area the entity area (if <code>null</code> a default will be
+ * @param area the entity area (if {@code null} a default will be
* used).
* @param dataset the dataset.
* @param series the series.
* @param item the item.
* @param entityX the entity's center x-coordinate in user space (only
- * used if <code>area</code> is <code>null</code>).
+ * used if {@code area} is {@code null}).
* @param entityY the entity's center y-coordinate in user space (only
- * used if <code>area</code> is <code>null</code>).
+ * used if {@code area} is {@code null}).
*/
protected void addEntity(EntityCollection entities, Shape area,
XYDataset dataset, int series, int item,
@@ -1803,7 +1811,7 @@
* Returns <code>true</code> if the specified point (x, y) falls within or
* on the boundary of the specified rectangle.
*
- * @param rect the rectangle (<code>null</code> not permitted).
+ * @param rect the rectangle ({@code null} not permitted).
* @param x the x-coordinate.
* @param y the y-coordinate.
*
@@ -1822,7 +1830,7 @@
* Utility method delegating to {@link GeneralPath#moveTo} taking double as
* parameters.
*
- * @param hotspot the region under construction (<code>null</code> not
+ * @param hotspot the region under construction ({@code null} not
* permitted);
* @param x the x coordinate;
* @param y the y coordinate;
@@ -1837,7 +1845,7 @@
* Utility method delegating to {@link GeneralPath#lineTo} taking double as
* parameters.
*
- * @param hotspot the region under construction (<code>null</code> not
+ * @param hotspot the region under construction ({@code null} not
* permitted);
* @param x the x coordinate;
* @param y the y coordinate;
@@ -1869,7 +1877,7 @@
/**
* Returns the item label generator override.
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*
* @since 1.0.5
*
@@ -1887,7 +1895,7 @@
* Sets the item label generator for ALL series and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getItemLabelGenerator()
*
@@ -1904,7 +1912,7 @@
/**
* Returns the override tool tip generator.
*
- * @return The tool tip generator (possible <code>null</code>).
+ * @return The tool tip generator (possible {@code null}).
*
* @since 1.0.5
*
@@ -1922,7 +1930,7 @@
* Sets the tool tip generator for ALL series and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getToolTipGenerator()
*
@@ -1941,13 +1949,13 @@
* if it meets the criteria (usually means the (x, y) coordinate is the
* closest to the anchor point so far).
*
- * @param crosshairState the crosshair state (<code>null</code> permitted,
+ * @param crosshairState the crosshair state ({@code null} permitted,
* but the method does nothing in that case).
* @param x the x-value (in data space).
* @param y the y-value (in data space).
* @param transX the x-value translated to Java2D space.
* @param transY the y-value translated to Java2D space.
- * @param orientation the plot orientation (<code>null</code> not
+ * @param orientation the plot orientation ({@code null} not
* permitted).
*
* @deprecated Use {@link #updateCrosshairValues(CrosshairState, double,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2016-01-16 17:36:54
|
Revision: 3331
http://sourceforge.net/p/jfreechart/code/3331
Author: mungady
Date: 2016-01-16 17:36:52 +0000 (Sat, 16 Jan 2016)
Log Message:
-----------
Fill background for marker labels.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2015-11-24 17:17:36 UTC (rev 3330)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2016-01-16 17:36:52 UTC (rev 3331)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ---------------------------------
* AbstractCategoryItemRenderer.java
* ---------------------------------
- * (C) Copyright 2002-2014, by Object Refinery Limited.
+ * (C) Copyright 2002-2016, by Object Refinery Limited.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): Richard Atkinson;
@@ -253,10 +253,10 @@
/**
* Returns the plot that the renderer has been assigned to (where
- * <code>null</code> indicates that the renderer is not currently assigned
+ * {@code null} indicates that the renderer is not currently assigned
* to a plot).
*
- * @return The plot (possibly <code>null</code>).
+ * @return The plot (possibly {@code null}).
*
* @see #setPlot(CategoryPlot)
*/
@@ -270,7 +270,7 @@
* usually called by the {@link CategoryPlot}, in normal usage you
* shouldn't need to call this method directly.
*
- * @param plot the plot (<code>null</code> not permitted).
+ * @param plot the plot ({@code null} not permitted).
*
* @see #getPlot()
*/
@@ -291,7 +291,7 @@
* @param row the row index (zero based).
* @param column the column index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public CategoryItemLabelGenerator getItemLabelGenerator(int row,
@@ -304,7 +304,7 @@
*
* @param series the series index (zero based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*
* @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
*/
@@ -330,7 +330,7 @@
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero based).
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getSeriesItemLabelGenerator(int)
*/
@@ -344,7 +344,7 @@
/**
* Returns the base item label generator.
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*
* @see #setBaseItemLabelGenerator(CategoryItemLabelGenerator)
*/
@@ -357,7 +357,7 @@
* Sets the base item label generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getBaseItemLabelGenerator()
*/
@@ -380,7 +380,7 @@
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
- * @return The generator (possibly <code>null</code>).
+ * @return The generator (possibly {@code null}).
*/
@Override
public CategoryToolTipGenerator getToolTipGenerator(int row, int column) {
@@ -404,7 +404,7 @@
*
* @param series the series index (zero-based).
*
- * @return The tool tip generator (possibly <code>null</code>).
+ * @return The tool tip generator (possibly {@code null}).
*
* @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator)
*/
@@ -418,7 +418,7 @@
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero-based).
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getSeriesToolTipGenerator(int)
*/
@@ -432,7 +432,7 @@
/**
* Returns the base tool tip generator (the "layer 2" generator).
*
- * @return The tool tip generator (possibly <code>null</code>).
+ * @return The tool tip generator (possibly {@code null}).
*
* @see #setBaseToolTipGenerator(CategoryToolTipGenerator)
*/
@@ -445,7 +445,7 @@
* Sets the base tool tip generator and sends a {@link RendererChangeEvent}
* to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getBaseToolTipGenerator()
*/
@@ -527,7 +527,7 @@
* Sets the base item URL generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the item URL generator (<code>null</code> permitted).
+ * @param generator the item URL generator ({@code null} permitted).
*
* @see #getBaseItemURLGenerator()
*/
@@ -563,9 +563,9 @@
* PlotRenderingInfo)} method. Subclasses can override this method if
* they need to use a subclass of {@link CategoryItemRendererState}.
*
- * @param info collects plot rendering info (<code>null</code> permitted).
+ * @param info collects plot rendering info ({@code null} permitted).
*
- * @return The new state instance (never <code>null</code>).
+ * @return The new state instance (never {@code null}).
*
* @since 1.0.5
*/
@@ -584,7 +584,7 @@
* @param plot the plot.
* @param rendererIndex the renderer index.
* @param info an object for returning information about the structure of
- * the plot (<code>null</code> permitted).
+ * the plot ({@code null} permitted).
*
* @return The renderer state.
*/
@@ -641,10 +641,10 @@
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
*
- * @return The range (or <code>null</code> if the dataset is
- * <code>null</code> or empty).
+ * @return The range (or {@code null} if the dataset is
+ * {@code null} or empty).
*/
@Override
public Range findRangeBounds(CategoryDataset dataset) {
@@ -655,10 +655,10 @@
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
- * @param dataset the dataset (<code>null</code> permitted).
+ * @param dataset the dataset ({@code null} permitted).
* @param includeInterval include the y-interval if the dataset has one.
*
- * @return The range (<code>null</code> if the dataset is <code>null</code>
+ * @return The range ({@code null} if the dataset is {@code null}
* or empty).
*
* @since 1.0.13
@@ -841,8 +841,8 @@
* @param dataArea the area for plotting data (not yet adjusted for any 3D
* effect).
* @param value the value at which the grid line should be drawn.
- * @param paint the paint (<code>null</code> not permitted).
- * @param stroke the stroke (<code>null</code> not permitted).
+ * @param paint the paint ({@code null} not permitted).
+ * @param stroke the stroke ({@code null} not permitted).
*
* @see #drawRangeGridline
*
@@ -881,11 +881,11 @@
/**
* Draws a marker for the domain axis.
*
- * @param g2 the graphics device (not <code>null</code>).
- * @param plot the plot (not <code>null</code>).
- * @param axis the range axis (not <code>null</code>).
- * @param marker the marker to be drawn (not <code>null</code>).
- * @param dataArea the area inside the axes (not <code>null</code>).
+ * @param g2 the graphics device (not {@code null}).
+ * @param plot the plot (not {@code null}).
+ * @param axis the range axis (not {@code null}).
+ * @param marker the marker to be drawn (not {@code null}).
+ * @param dataArea the area inside the axes (not {@code null}).
*
* @see #drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker,
* Rectangle2D)
@@ -967,11 +967,11 @@
/**
* Draws a marker for the range axis.
*
- * @param g2 the graphics device (not <code>null</code>).
- * @param plot the plot (not <code>null</code>).
- * @param axis the range axis (not <code>null</code>).
- * @param marker the marker to be drawn (not <code>null</code>).
- * @param dataArea the area inside the axes (not <code>null</code>).
+ * @param g2 the graphics device (not {@code null}).
+ * @param plot the plot (not {@code null}).
+ * @param axis the range axis (not {@code null}).
+ * @param marker the marker to be drawn (not {@code null}).
+ * @param dataArea the area inside the axes (not {@code null}).
*
* @see #drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis,
* CategoryMarker, Rectangle2D)
@@ -1101,8 +1101,7 @@
line.setLine(x0, end2d, x1, end2d);
g2.draw(line);
}
- }
- else { // PlotOrientation.HORIZONTAL
+ } else { // PlotOrientation.HORIZONTAL
Line2D line = new Line2D.Double();
double y0 = dataArea.getMinY();
double y1 = dataArea.getMaxY();
@@ -1124,13 +1123,18 @@
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
- g2.setPaint(marker.getLabelPaint());
- Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
+ Point2D coords = calculateRangeMarkerTextAnchorPoint(
g2, orientation, dataArea, rect,
marker.getLabelOffset(), marker.getLabelOffsetType(),
anchor);
+ Rectangle2D r = TextUtils.calcAlignedStringBounds(label,
+ g2, (float) coords.getX(), (float) coords.getY(),
+ marker.getLabelTextAnchor());
+ g2.setPaint(marker.getLabelBackgroundColor());
+ g2.fill(r);
+ g2.setPaint(marker.getLabelPaint());
TextUtilities.drawAlignedString(label, g2,
- (float) coordinates.getX(), (float) coordinates.getY(),
+ (float) coords.getX(), (float) coords.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(savedComposite);
@@ -1138,8 +1142,8 @@
}
/**
- * Calculates the (x, y) coordinates for drawing the label for a marker on
- * the range axis.
+ * Calculates the {@code (x, y)} coordinates for drawing the label for a
+ * marker on the range axis.
*
* @param g2 the graphics device.
* @param orientation the plot orientation.
@@ -1160,13 +1164,11 @@
if (orientation == PlotOrientation.HORIZONTAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
LengthAdjustmentType.CONTRACT, labelOffsetType);
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
labelOffsetType, LengthAdjustmentType.CONTRACT);
}
return RectangleAnchor.coordinates(anchorRect, anchor);
-
}
/**
@@ -1191,8 +1193,7 @@
if (orientation == PlotOrientation.HORIZONTAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
labelOffsetType, LengthAdjustmentType.CONTRACT);
- }
- else if (orientation == PlotOrientation.VERTICAL) {
+ } else if (orientation == PlotOrientation.VERTICAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
LengthAdjustmentType.CONTRACT, labelOffsetType);
}
@@ -1202,13 +1203,13 @@
/**
* Returns a legend item for a series. This default implementation will
- * return <code>null</code> if {@link #isSeriesVisible(int)} or
- * {@link #isSeriesVisibleInLegend(int)} returns <code>false</code>.
+ * return {@code null} if {@link #isSeriesVisible(int)} or
+ * {@link #isSeriesVisibleInLegend(int)} returns {@code false}.
*
* @param datasetIndex the dataset index (zero-based).
* @param series the series index (zero-based).
*
- * @return The legend item (possibly <code>null</code>).
+ * @return The legend item (possibly {@code null}).
*
* @see #getLegendItems()
*/
@@ -1263,7 +1264,7 @@
*
* @param obj the object.
*
- * @return <code>true</code> or <code>false</code>.
+ * @return {@code true} or {@code false}.
*/
@Override
public boolean equals(Object obj) {
@@ -1340,7 +1341,7 @@
/**
* Returns the drawing supplier from the plot.
*
- * @return The drawing supplier (possibly <code>null</code>).
+ * @return The drawing supplier (possibly {@code null}).
*/
@Override
public DrawingSupplier getDrawingSupplier() {
@@ -1357,7 +1358,7 @@
* if it meets the criteria (usually means the (x, y) coordinate is the
* closest to the anchor point so far).
*
- * @param crosshairState the crosshair state (<code>null</code> permitted,
+ * @param crosshairState the crosshair state ({@code null} permitted,
* but the method does nothing in that case).
* @param rowKey the row key.
* @param columnKey the column key.
@@ -1365,7 +1366,7 @@
* @param datasetIndex the dataset index.
* @param transX the x-value translated to Java2D space.
* @param transY the y-value translated to Java2D space.
- * @param orientation the plot orientation (<code>null</code> not
+ * @param orientation the plot orientation ({@code null} not
* permitted).
*
* @since 1.0.11
@@ -1433,7 +1434,7 @@
}
/**
- * Returns an independent copy of the renderer. The <code>plot</code>
+ * Returns an independent copy of the renderer. The {@code plot}
* reference is shallow copied.
*
* @return A clone.
@@ -1585,7 +1586,7 @@
* Returns a (possibly empty) collection of legend items for the series
* that this renderer is responsible for drawing.
*
- * @return The legend item collection (never <code>null</code>).
+ * @return The legend item collection (never {@code null}).
*
* @see #getLegendItem(int, int)
*/
@@ -1627,7 +1628,7 @@
/**
* Returns the legend item label generator.
*
- * @return The label generator (never <code>null</code>).
+ * @return The label generator (never {@code null}).
*
* @see #setLegendItemLabelGenerator(CategorySeriesLabelGenerator)
*/
@@ -1639,7 +1640,7 @@
* Sets the legend item label generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> not permitted).
+ * @param generator the generator ({@code null} not permitted).
*
* @see #getLegendItemLabelGenerator()
*/
@@ -1653,7 +1654,7 @@
/**
* Returns the legend item tool tip generator.
*
- * @return The tool tip generator (possibly <code>null</code>).
+ * @return The tool tip generator (possibly {@code null}).
*
* @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
*/
@@ -1665,7 +1666,7 @@
* Sets the legend item tool tip generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
*/
@@ -1678,7 +1679,7 @@
/**
* Returns the legend item URL generator.
*
- * @return The URL generator (possibly <code>null</code>).
+ * @return The URL generator (possibly {@code null}).
*
* @see #setLegendItemURLGenerator(CategorySeriesLabelGenerator)
*/
@@ -1690,7 +1691,7 @@
* Sets the legend item URL generator and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getLegendItemURLGenerator()
*/
@@ -1707,7 +1708,7 @@
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
- * @param hotspot the hotspot (<code>null</code> not permitted).
+ * @param hotspot the hotspot ({@code null} not permitted).
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column, Shape hotspot) {
@@ -1734,15 +1735,15 @@
* Adds an entity to the collection.
*
* @param entities the entity collection being populated.
- * @param hotspot the entity area (if <code>null</code> a default will be
+ * @param hotspot the entity area (if {@code null} a default will be
* used).
* @param dataset the dataset.
* @param row the series.
* @param column the item.
* @param entityX the entity's center x-coordinate in user space (only
- * used if <code>area</code> is <code>null</code>).
+ * used if {@code area} is {@code null}).
* @param entityY the entity's center y-coordinate in user space (only
- * used if <code>area</code> is <code>null</code>).
+ * used if {@code area} is {@code null}).
*
* @since 1.0.13
*/
@@ -1805,7 +1806,7 @@
* Sets the item label generator for ALL series and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @deprecated This method should no longer be used (as of version 1.0.6).
* It is sufficient to rely on {@link #setSeriesItemLabelGenerator(int,
@@ -1822,7 +1823,7 @@
* Returns the tool tip generator that will be used for ALL items in the
* dataset (the "layer 0" generator).
*
- * @return A tool tip generator (possibly <code>null</code>).
+ * @return A tool tip generator (possibly {@code null}).
*
* @see #setToolTipGenerator(CategoryToolTipGenerator)
*
@@ -1840,7 +1841,7 @@
* {@link org.jfree.chart.event.RendererChangeEvent} to all registered
* listeners.
*
- * @param generator the generator (<code>null</code> permitted).
+ * @param generator the generator ({@code null} permitted).
*
* @see #getToolTipGenerator()
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-11-24 17:17:39
|
Revision: 3330
http://sourceforge.net/p/jfreechart/code/3330
Author: mungady
Date: 2015-11-24 17:17:36 +0000 (Tue, 24 Nov 2015)
Log Message:
-----------
2015-11-23 David Gilbert <dav...@ob...>
* org/jfree/chart/util/ParamChecks.java
(requireInRange): New method,
* org/jfree/data/time/Second.java
(Second(int, Minute)) : Check argument is in range.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ChangeLog
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/util/ParamChecks.java
branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/Second.java
Modified: branches/jfreechart-1.0.x-branch/ChangeLog
===================================================================
--- branches/jfreechart-1.0.x-branch/ChangeLog 2015-09-22 15:27:35 UTC (rev 3329)
+++ branches/jfreechart-1.0.x-branch/ChangeLog 2015-11-24 17:17:36 UTC (rev 3330)
@@ -1,3 +1,10 @@
+2015-11-23 David Gilbert <dav...@ob...>
+
+ * org/jfree/chart/util/ParamChecks.java
+ (requireInRange): New method,
+ * org/jfree/data/time/Second.java
+ (Second(int, Minute)) : Check argument is in range.
+
2015-09-22 David Gilbert <dav...@ob...>
* org/jfree/data/general/DatasetUtilities.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/util/ParamChecks.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/util/ParamChecks.java 2015-09-22 15:27:35 UTC (rev 3329)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/util/ParamChecks.java 2015-11-24 17:17:36 UTC (rev 3330)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ----------------
* ParamChecks.java
* ----------------
- * (C) Copyright 2011, by Object Refinery Limited.
+ * (C) Copyright 2011-2015, by Object Refinery Limited.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -35,6 +35,7 @@
* Changes
* -------
* 16-Oct-2011 : Version 1 (DG);
+ * 23-Nov-2015 : Added requireInRange() method (DG);
*
*/
@@ -80,4 +81,24 @@
+ value + ") to be non-negative.");
}
}
+
+ /**
+ * Checks that the value falls within the specified range and, if it does
+ * not, throws an {@code IllegalArgumentException}.
+ *
+ * @param value the value.
+ * @param name the parameter name.
+ * @param lowerBound the lower bound of the permitted range.
+ * @param upperBound the upper bound fo the permitted range.
+ *
+ * @since 1.0.20
+ */
+ public static void requireInRange(int value, String name,
+ int lowerBound, int upperBound) {
+ if (value < lowerBound) {
+ throw new IllegalArgumentException("Require '" + name + "' ("
+ + value + ") to be in the range " + lowerBound + " to "
+ + upperBound);
+ }
+ }
}
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/Second.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/Second.java 2015-09-22 15:27:35 UTC (rev 3329)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/time/Second.java 2015-11-24 17:17:36 UTC (rev 3330)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* -----------
* Second.java
* -----------
- * (C) Copyright 2001-2013, by Object Refinery Limited.
+ * (C) Copyright 2001-2015, by Object Refinery Limited.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -112,10 +112,12 @@
/**
* Constructs a new Second.
*
- * @param second the second (0 to 24*60*60-1).
- * @param minute the minute (<code>null</code> not permitted).
+ * @param second the second (0 to 59).
+ * @param minute the minute ({@code null} not permitted).
*/
public Second(int second, Minute minute) {
+ ParamChecks.requireInRange(second, "second",
+ Second.FIRST_SECOND_IN_MINUTE, Second.LAST_SECOND_IN_MINUTE);
ParamChecks.nullNotPermitted(minute, "minute");
this.day = minute.getDay();
this.hour = (byte) minute.getHourValue();
@@ -141,9 +143,9 @@
/**
* Constructs a new instance from the specified date/time and the default
- * time zone..
+ * time zone.
*
- * @param time the time (<code>null</code> not permitted).
+ * @param time the time ({@code null} not permitted).
*
* @see #Second(Date, TimeZone)
*/
@@ -167,9 +169,9 @@
/**
* Creates a new second based on the supplied time and time zone.
*
- * @param time the time (<code>null</code> not permitted).
- * @param zone the time zone (<code>null</code> not permitted).
- * @param locale the locale (<code>null</code> not permitted).
+ * @param time the time ({@code null} not permitted).
+ * @param zone the time zone ({@code null} not permitted).
+ * @param locale the locale ({@code null} not permitted).
*
* @since 1.0.13
*/
@@ -195,7 +197,7 @@
/**
* Returns the minute.
*
- * @return The minute (never <code>null</code>).
+ * @return The minute (never {@code null}).
*/
public Minute getMinute() {
return new Minute(this.minute, new Hour(this.hour, this.day));
@@ -235,7 +237,7 @@
* Recalculates the start date/time and end date/time for this time period
* relative to the supplied calendar (which incorporates a time zone).
*
- * @param calendar the calendar (<code>null</code> not permitted).
+ * @param calendar the calendar ({@code null} not permitted).
*
* @since 1.0.3
*/
@@ -299,12 +301,11 @@
/**
* Returns the first millisecond of the minute.
*
- * @param calendar the calendar/timezone (<code>null</code> not permitted).
+ * @param calendar the calendar/timezone ({@code null} not permitted).
*
* @return The first millisecond.
*
- * @throws NullPointerException if <code>calendar</code> is
- * <code>null</code>.
+ * @throws NullPointerException if {@code calendar} is {@code null}.
*/
@Override
public long getFirstMillisecond(Calendar calendar) {
@@ -320,12 +321,11 @@
/**
* Returns the last millisecond of the second.
*
- * @param calendar the calendar/timezone (<code>null</code> not permitted).
+ * @param calendar the calendar/timezone ({@code null} not permitted).
*
* @return The last millisecond.
*
- * @throws NullPointerException if <code>calendar</code> is
- * <code>null</code>.
+ * @throws NullPointerException if {@code calendar} is {@code null}.
*/
@Override
public long getLastMillisecond(Calendar calendar) {
@@ -338,9 +338,9 @@
* This method will return true ONLY if the object is a Second object
* representing the same second as this instance.
*
- * @param obj the object to compare (<code>null</code> permitted).
+ * @param obj the object to compare ({@code null} permitted).
*
- * @return <code>true</code> if second and minute of this and the object
+ * @return {@code true} if second and minute of this and the object
* are the same.
*/
@Override
@@ -438,7 +438,7 @@
*
* @param s the string to parse.
*
- * @return The second, or <code>null</code> if the string is not parseable.
+ * @return The second, or {@code null} if the string is not parseable.
*/
public static Second parseSecond(String s) {
Second result = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-09-22 15:27:37
|
Revision: 3329
http://sourceforge.net/p/jfreechart/code/3329
Author: mungady
Date: 2015-09-22 15:27:35 +0000 (Tue, 22 Sep 2015)
Log Message:
-----------
2015-09-22 David Gilbert <dav...@ob...>
* org/jfree/data/general/DatasetUtilities.java
(iterateToFindDomainBounds): Check for x-value outside interval,
(iterateToFindRangeBounds): Check for y-value outside interval.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ChangeLog
Modified: branches/jfreechart-1.0.x-branch/ChangeLog
===================================================================
--- branches/jfreechart-1.0.x-branch/ChangeLog 2015-09-22 15:27:19 UTC (rev 3328)
+++ branches/jfreechart-1.0.x-branch/ChangeLog 2015-09-22 15:27:35 UTC (rev 3329)
@@ -1,3 +1,9 @@
+2015-09-22 David Gilbert <dav...@ob...>
+
+ * org/jfree/data/general/DatasetUtilities.java
+ (iterateToFindDomainBounds): Check for x-value outside interval,
+ (iterateToFindRangeBounds): Check for y-value outside interval.
+
2015-09-11 David Gilbert <dav...@ob...>
* org/jfree/chart/fx/FXGraphics2D.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-09-22 15:27:21
|
Revision: 3328
http://sourceforge.net/p/jfreechart/code/3328
Author: mungady
Date: 2015-09-22 15:27:19 +0000 (Tue, 22 Sep 2015)
Log Message:
-----------
2015-09-22 David Gilbert <dav...@ob...>
* org/jfree/data/general/DatasetUtilities.java
(iterateToFindDomainBounds): Check for x-value outside interval,
(iterateToFindRangeBounds): Check for y-value outside interval.
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/data/general/DatasetUtilities.java
branches/jfreechart-1.0.x-branch/tests/org/jfree/data/general/DatasetUtilitiesTest.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/data/general/DatasetUtilities.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/data/general/DatasetUtilities.java 2015-09-11 04:27:51 UTC (rev 3327)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/data/general/DatasetUtilities.java 2015-09-22 15:27:19 UTC (rev 3328)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* ---------------------
* DatasetUtilities.java
* ---------------------
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): Andrzej Porebski (bug fix);
@@ -123,7 +123,8 @@
* 10-Sep-2009 : Fix bug 2849731 for IntervalCategoryDataset (DG);
* 16-Feb-2010 : Patch 2952086 - find z-bounds (MH);
* 02-Jul-2013 : Use ParamChecks (DG);
- *
+ * 22-Sep-2015 : Fix bugs in iterateToFindDomainBounds() and
+ * iterateToFindRangeBounds() (DG);
*/
package org.jfree.data.general;
@@ -173,10 +174,10 @@
/**
* Calculates the total of all the values in a {@link PieDataset}. If
- * the dataset contains negative or <code>null</code> values, they are
+ * the dataset contains negative or {@code null} values, they are
* ignored.
*
- * @param dataset the dataset (<code>null</code> not permitted).
+ * @param dataset the dataset ({@code null} not permitted).
*
* @return The total.
*/
@@ -205,13 +206,13 @@
* Creates a pie dataset from a table dataset by taking all the values
* for a single row.
*
- * @param dataset the dataset (<code>null</code> not permitted).
+ * @param dataset the dataset ({@code null} not permitted).
* @param rowKey the row key.
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForRow(CategoryDataset dataset,
- Comparable rowKey) {
+ Comparable rowKey) {
int row = dataset.getRowIndex(rowKey);
return createPieDatasetForRow(dataset, row);
}
@@ -220,13 +221,13 @@
* Creates a pie dataset from a table dataset by taking all the values
* for a single row.
*
- * @param dataset the dataset (<code>null</code> not permitted).
+ * @param dataset the dataset ({@code null} not permitted).
* @param row the row (zero-based index).
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForRow(CategoryDataset dataset,
- int row) {
+ int row) {
DefaultPieDataset result = new DefaultPieDataset();
int columnCount = dataset.getColumnCount();
for (int current = 0; current < columnCount; current++) {
@@ -240,13 +241,13 @@
* Creates a pie dataset from a table dataset by taking all the values
* for a single column.
*
- * @param dataset the dataset (<code>null</code> not permitted).
+ * @param dataset the dataset ({@code null} not permitted).
* @param columnKey the column key.
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset,
- Comparable columnKey) {
+ Comparable columnKey) {
int column = dataset.getColumnIndex(columnKey);
return createPieDatasetForColumn(dataset, column);
}
@@ -255,13 +256,13 @@
* Creates a pie dataset from a {@link CategoryDataset} by taking all the
* values for a single column.
*
- * @param dataset the dataset (<code>null</code> not permitted).
+ * @param dataset the dataset ({@code null} not permitted).
* @param column the column (zero-based index).
*
* @return A pie dataset.
*/
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset,
- int column) {
+ int column) {
DefaultPieDataset result = new DefaultPieDataset();
int rowCount = dataset.getRowCount();
for (int i = 0; i < rowCount; i++) {
@@ -277,8 +278,8 @@
* than the <code>percentThreshold</code>) into a single item with the
* key "Other".
*
- * @param source the source dataset (<code>null</code> not permitted).
- * @param key a new key for the aggregated items (<code>null</code> not
+ * @param source the source dataset ({@code null} not permitted).
+ * @param key a new key for the aggregated items ({@code null} not
* permitted).
* @param minimumPercent the percent threshold.
*
@@ -297,7 +298,7 @@
* aggregated items are assigned the specified key. Aggregation only
* occurs if there are at least <code>minItems</code> items to aggregate.
*
- * @param source the source dataset (<code>null</code> not permitted).
+ * @param source the source dataset ({@code null} not permitted).
* @param key the key to represent the aggregated items.
* @param minimumPercent the percent threshold (ten percent is 0.10).
* @param minItems only aggregate low values if there are at least this
@@ -415,8 +416,8 @@
* <p>
* Row and column keys are taken from the supplied arrays.
*
- * @param rowKeys the row keys (<code>null</code> not permitted).
- * @param columnKeys the column keys (<code>null</code> not permitted).
+ * @param rowKeys the row keys ({@code null} not permitted).
+ * @param columnKeys the column keys ({@code null} not permitted).
* @param data the data.
*
* @return The dataset.
@@ -465,8 +466,8 @@
* Creates a {@link CategoryDataset} by copying the data from the supplied
* {@link KeyedValues} instance.
*
- * @param rowKey the row key (<code>null</code> not permitted).
- * @param rowData the row data (<code>null</code> not permitted).
+ * @param rowKey the row key ({@code null} not permitted).
+ * @param rowData the row data ({@code null} not permitted).
*
* @return A dataset.
*/
@@ -487,12 +488,12 @@
* Creates an {@link XYDataset} by sampling the specified function over a
* fixed range.
*
- * @param f the function (<code>null</code> not permitted).
+ * @param f the function ({@code null} not permitted).
* @param start the start value for the range.
* @param end the end value for the range.
* @param samples the number of sample points (must be > 1).
- * @param seriesKey the key to give the resulting series
- * (<code>null</code> not permitted).
+ * @param seriesKey the key to give the resulting series ({@code null} not
+ * permitted).
*
* @return A dataset.
*/
@@ -510,12 +511,12 @@
* Creates an {@link XYSeries} by sampling the specified function over a
* fixed range.
*
- * @param f the function (<code>null</code> not permitted).
+ * @param f the function ({@code null} not permitted).
* @param start the start value for the range.
* @param end the end value for the range.
* @param samples the number of sample points (must be > 1).
* @param seriesKey the key to give the resulting series
- * (<code>null</code> not permitted).
+ * ({@code null} not permitted).
*
* @return A series.
*
@@ -1376,14 +1377,14 @@
* Returns the range of x-values in the specified dataset for the
* data items belonging to the visible series.
*
- * @param dataset the dataset (<code>null</code> not permitted).
- * @param visibleSeriesKeys the visible series keys (<code>null</code> not
+ * @param dataset the dataset ({@code null} not permitted).
+ * @param visibleSeriesKeys the visible series keys ({@code null} not
* permitted).
* @param includeInterval a flag that determines whether or not the
* y-interval for the dataset is included (this only applies if the
* dataset is an instance of IntervalXYDataset).
*
- * @return The x-range (possibly <code>null</code>).
+ * @return The x-range (possibly {@code null}).
*
* @since 1.0.13
*/
@@ -1404,8 +1405,13 @@
int series = dataset.indexOf(seriesKey);
int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
+ double xvalue = ixyd.getXValue(series, item);
double lvalue = ixyd.getStartXValue(series, item);
double uvalue = ixyd.getEndXValue(series, item);
+ if (!Double.isNaN(xvalue)) {
+ minimum = Math.min(minimum, xvalue);
+ maximum = Math.max(maximum, xvalue);
+ }
if (!Double.isNaN(lvalue)) {
minimum = Math.min(minimum, lvalue);
}
@@ -1414,8 +1420,7 @@
}
}
}
- }
- else {
+ } else {
// standard case - plain XYDataset
Iterator iterator = visibleSeriesKeys.iterator();
while (iterator.hasNext()) {
@@ -1434,8 +1439,7 @@
if (minimum == Double.POSITIVE_INFINITY) {
return null;
- }
- else {
+ } else {
return new Range(minimum, maximum);
}
}
@@ -1445,15 +1449,15 @@
* data items belonging to the visible series and with x-values in the
* given range.
*
- * @param dataset the dataset (<code>null</code> not permitted).
- * @param visibleSeriesKeys the visible series keys (<code>null</code> not
+ * @param dataset the dataset ({@code null} not permitted).
+ * @param visibleSeriesKeys the visible series keys ({@code null} not
* permitted).
- * @param xRange the x-range (<code>null</code> not permitted).
+ * @param xRange the x-range ({@code null} not permitted).
* @param includeInterval a flag that determines whether or not the
* y-interval for the dataset is included (this only applies if the
* dataset is an instance of IntervalXYDataset).
*
- * @return The y-range (possibly <code>null</code>).
+ * @return The y-range (possibly {@code null}).
*
* @since 1.0.13
*/
@@ -1525,8 +1529,13 @@
for (int item = 0; item < itemCount; item++) {
double x = ixyd.getXValue(series, item);
if (xRange.contains(x)) {
+ double yvalue = ixyd.getYValue(series, item);
double lvalue = ixyd.getStartYValue(series, item);
double uvalue = ixyd.getEndYValue(series, item);
+ if (!Double.isNaN(yvalue)) {
+ minimum = Math.min(minimum, yvalue);
+ maximum = Math.max(maximum, yvalue);
+ }
if (!Double.isNaN(lvalue)) {
minimum = Math.min(minimum, lvalue);
}
@@ -1536,8 +1545,7 @@
}
}
}
- }
- else {
+ } else {
// standard case - plain XYDataset
Iterator iterator = visibleSeriesKeys.iterator();
while (iterator.hasNext()) {
@@ -1558,8 +1566,7 @@
}
if (minimum == Double.POSITIVE_INFINITY) {
return null;
- }
- else {
+ } else {
return new Range(minimum, maximum);
}
}
@@ -1569,15 +1576,15 @@
* data items belonging to the visible series and with x-values in the
* given range.
*
- * @param dataset the dataset (<code>null</code> not permitted).
- * @param visibleSeriesKeys the visible series keys (<code>null</code> not
+ * @param dataset the dataset ({@code null} not permitted).
+ * @param visibleSeriesKeys the visible series keys ({@code null} not
* permitted).
- * @param xRange the x-range (<code>null</code> not permitted).
+ * @param xRange the x-range ({@code null} not permitted).
* @param includeInterval a flag that determines whether or not the
* z-interval for the dataset is included (this only applies if the
* dataset has an interval, which is currently not supported).
*
- * @return The y-range (possibly <code>null</code>).
+ * @return The y-range (possibly {@code null}).
*/
public static Range iterateToFindZBounds(XYZDataset dataset,
List visibleSeriesKeys, Range xRange, boolean includeInterval) {
@@ -1607,8 +1614,7 @@
if (minimum == Double.POSITIVE_INFINITY) {
return null;
- }
- else {
+ } else {
return new Range(minimum, maximum);
}
}
Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/data/general/DatasetUtilitiesTest.java
===================================================================
--- branches/jfreechart-1.0.x-branch/tests/org/jfree/data/general/DatasetUtilitiesTest.java 2015-09-11 04:27:51 UTC (rev 3327)
+++ branches/jfreechart-1.0.x-branch/tests/org/jfree/data/general/DatasetUtilitiesTest.java 2015-09-22 15:27:19 UTC (rev 3328)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* -------------------------
* DatasetUtilitiesTest.java
* -------------------------
- * (C) Copyright 2003-2013, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2003-2015, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -173,6 +173,27 @@
}
/**
+ * This test checks that the correct values are returned if the x and
+ * y values fall outside the intervals.
+ */
+ @Test
+ public void testFindDomainBounds4() {
+ DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset();
+ double[] x1 = new double[] {0.8, 3.2, 3.0};
+ double[] x1Start = new double[] {0.9, 1.9, 2.9};
+ double[] x1End = new double[] {1.1, 2.1, 3.1};
+ double[] y1 = new double[] {4.0, 5.0, 6.0};
+ double[] y1Start = new double[] {1.09, 2.09, 3.09};
+ double[] y1End = new double[] {1.11, 2.11, 3.11};
+ double[][] data1 = new double[][] {x1, x1Start, x1End, y1, y1Start,
+ y1End};
+ dataset.addSeries("S1", data1);
+ Range r = DatasetUtilities.findDomainBounds(dataset);
+ assertEquals(0.8, r.getLowerBound(), EPSILON);
+ assertEquals(3.2, r.getUpperBound(), EPSILON);
+ }
+
+ /**
* This test checks that NaN values are ignored.
*/
@Test
@@ -1040,6 +1061,50 @@
}
/**
+ * This test checks that the correct values are returned if the x-values
+ * fall outside the intervals (it is not required that they do).
+ */
+ @Test
+ public void testIterateToFindDomainBounds_IntervalXYDataset() {
+ DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset();
+ double[] x1 = new double[] {0.8, 3.2, 3.0};
+ double[] x1Start = new double[] {0.9, 1.9, 2.9};
+ double[] x1End = new double[] {1.1, 2.1, 3.1};
+ double[] y1 = new double[] {4.0, 5.0, 6.0};
+ double[] y1Start = new double[] {1.09, 2.09, 3.09};
+ double[] y1End = new double[] {1.11, 2.11, 3.11};
+ double[][] data1 = new double[][] {x1, x1Start, x1End, y1, y1Start,
+ y1End};
+ dataset.addSeries("S1", data1);
+ Range r = DatasetUtilities.iterateToFindDomainBounds(dataset,
+ Arrays.asList("S1"), true);
+ assertEquals(0.8, r.getLowerBound(), EPSILON);
+ assertEquals(3.2, r.getUpperBound(), EPSILON);
+ }
+
+ /**
+ * This test checks that the correct values are returned if the y-values
+ * fall outside the intervals (it is not required that they do).
+ */
+ @Test
+ public void testIterateToFindRangeBounds_IntervalXYDataset() {
+ DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset();
+ double[] x1 = new double[] {0.8, 3.2, 3.0};
+ double[] x1Start = new double[] {0.9, 1.9, 2.9};
+ double[] x1End = new double[] {1.1, 2.1, 3.1};
+ double[] y1 = new double[] {4.0, -5.0, 6.0};
+ double[] y1Start = new double[] {1.09, 2.09, 3.09};
+ double[] y1End = new double[] {1.11, 2.11, 3.11};
+ double[][] data1 = new double[][] {x1, x1Start, x1End, y1, y1Start,
+ y1End};
+ dataset.addSeries("S1", data1);
+ Range r = DatasetUtilities.iterateToFindRangeBounds(dataset,
+ Arrays.asList("S1"), new Range(0.0, 4.0), true);
+ assertEquals(-5.0, r.getLowerBound(), EPSILON);
+ assertEquals(6.0, r.getUpperBound(), EPSILON);
+ }
+
+ /**
* Some checks for the iteratorToFindRangeBounds(XYDataset...) method.
*/
@Test
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-09-11 04:27:53
|
Revision: 3327
http://sourceforge.net/p/jfreechart/code/3327
Author: mungady
Date: 2015-09-11 04:27:51 +0000 (Fri, 11 Sep 2015)
Log Message:
-----------
Update FXGraphics2D to match latest code on GitHub
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/ChangeLog
Modified: branches/jfreechart-1.0.x-branch/ChangeLog
===================================================================
--- branches/jfreechart-1.0.x-branch/ChangeLog 2015-09-11 04:25:11 UTC (rev 3326)
+++ branches/jfreechart-1.0.x-branch/ChangeLog 2015-09-11 04:27:51 UTC (rev 3327)
@@ -1,7 +1,21 @@
+2015-09-11 David Gilbert <dav...@ob...>
+
+ * org/jfree/chart/fx/FXGraphics2D.java
+ Updated to match latest code on GitHub,
+ * org/jfree/chart/fx/FXGraphicsConfiguration.java
+ New file,
+ * org/jfree/chart/fx/FXGraphicsDevice.java
+ New file.
+
2015-09-10 David Gilbert <dav...@ob...>
+ * org/jfree/chart/labels/IntervalXYToolTipGenerator.java
+ New file.
+
+2015-09-10 David Gilbert <dav...@ob...>
+
* org/jfree/chart/renderer/xy/YIntervalRenderer.java
- (drawItem): Check item visibility.
+ (drawItem): Check item visibility and enlarge entity bounds.
2015-09-09 David Gilbert <dav...@ob...>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-09-11 04:25:14
|
Revision: 3326
http://sourceforge.net/p/jfreechart/code/3326
Author: mungady
Date: 2015-09-11 04:25:11 +0000 (Fri, 11 Sep 2015)
Log Message:
-----------
Update FXGraphics2D to match latest code on GitHub
Modified Paths:
--------------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsConfiguration.java
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsDevice.java
Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2015-09-10 04:49:25 UTC (rev 3325)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphics2D.java 2015-09-11 04:25:11 UTC (rev 3326)
@@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
- * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2000-2015, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
@@ -27,7 +27,7 @@
* -----------------
* FXGraphics2D.java
* -----------------
- * (C) Copyright 2014, by Object Refinery Limited and Contributors.
+ * (C) Copyright 2014, 2015 by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
@@ -35,9 +35,9 @@
* Changes:
* --------
* 20-Jun-2014 : Version 1 (DG);
+ *
*/
-
package org.jfree.chart.fx;
import java.awt.AlphaComposite;
@@ -81,6 +81,8 @@
import java.awt.image.RenderedImage;
import java.awt.image.WritableRaster;
import java.awt.image.renderable.RenderableImage;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.text.AttributedCharacterIterator;
import java.util.Hashtable;
import java.util.Map;
@@ -113,7 +115,7 @@
/** The number of times the graphics state has been saved. */
private int saveCount = 0;
- /** A flag to permit clipping to be disabled (since it is buggy). */
+ /** A flag to permit clipping to be disabled (because...JavaFX bugs). */
private boolean clippingDisabled = false;
/** Rendering hints. */
@@ -121,8 +123,10 @@
private Shape clip;
+ /** Stores the AWT Paint object for get/setPaint(). */
private Paint paint = Color.BLACK;
+ /** Stores the AWT Color object for get/setColor(). */
private Color awtColor = Color.BLACK;
private Composite composite = AlphaComposite.getInstance(
@@ -183,11 +187,24 @@
BufferedImage.TYPE_INT_RGB);
/**
+ * A Graphics2D instance for the hidden image that is used for font
+ * metrics. Used in the getFontMetrics(Font f) method.
+ */
+ private final Graphics2D fmImageG2 = fmImage.createGraphics();
+
+ /**
+ * The device configuration (this is lazily instantiated in the
+ * getDeviceConfiguration() method).
+ */
+ private GraphicsConfiguration deviceConfiguration;
+
+ /**
* Throws an {@code IllegalArgumentException} if {@code arg} is
* {@code null}.
*
* @param arg the argument to check.
- * @param name the name of the
+ * @param name the name of the argument (to display in the exception
+ * message).
*/
private static void nullNotPermitted(Object arg, String name) {
if (arg == null) {
@@ -267,13 +284,19 @@
}
/**
- * This method is not implemented yet.
- * @return {@code null}.
+ * Returns the device configuration.
+ *
+ * @return The device configuration (never {@code null}).
*/
@Override
public GraphicsConfiguration getDeviceConfiguration() {
- // FIXME
- return null;
+ if (this.deviceConfiguration == null) {
+ int width = (int) this.gc.getCanvas().getWidth();
+ int height = (int) this.gc.getCanvas().getHeight();
+ this.deviceConfiguration = new FXGraphicsConfiguration(width,
+ height);
+ }
+ return this.deviceConfiguration;
}
/**
@@ -388,6 +411,9 @@
/**
* Returns the foreground color. This method exists for backwards
* compatibility in AWT, you should use the {@link #getPaint()} method.
+ * This attribute is updated by the {@link #setColor(java.awt.Color)}
+ * method, and also by the {@link #setPaint(java.awt.Paint)} method if
+ * a {@code Color} instance is passed to the method.
*
* @return The foreground color (never {@code null}).
*
@@ -562,7 +588,67 @@
}
}
+ private double[] floatToDoubleArray(float[] f) {
+ if (f == null) {
+ return null;
+ }
+ double[] d = new double[f.length];
+ for (int i = 0; i < f.length; i++) {
+ d[i] = (double) f[i];
+ }
+ return d;
+ }
+
/**
+ * A utility method that calls {@code GraphicsContext.setLineDashes()}
+ * using reflection (since this method is only available in 8u40). On
+ * runtimes where the method is not available, this method will do nothing.
+ *
+ * @param gc the graphics context ({@code null} permitted).
+ * @param dashes the dashes.
+ */
+ private void setLineDashes(GraphicsContext gc, double... dashes) {
+ if (dashes == null) {
+ dashes = new double[] { 0.0 };
+ }
+ try {
+ Method m = GraphicsContext.class.getMethod("setLineDashes",
+ double[].class);
+ try {
+ m.invoke(gc, dashes);
+ } catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ // ignore
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ // ignore
+ }
+ }
+
+ /**
+ * A utility method that calls {@code GraphicsContext.setLineDashOffset()}
+ * using reflection (since this method is only available in 8u40). On
+ * runtimes where the method is not available, this method will do nothing.
+ *
+ * @param gc the graphics context ({@code null} not permitted).
+ * @param dashes the dashes.
+ */
+ private void setLineDashOffset(GraphicsContext gc, double dashOffset) {
+ try {
+ Method m = GraphicsContext.class.getMethod("setLineDashOffset",
+ double.class);
+ try {
+ m.invoke(gc, dashOffset);
+ } catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ // ignore
+ }
+ } catch (NoSuchMethodException | SecurityException e) {
+ // ignore
+ }
+ }
+
+ /**
* Returns the current value for the specified hint. Note that all hints
* are currently ignored in this implementation.
*
@@ -695,13 +781,14 @@
}
}
+ private double[] coords = new double[6];
+
/**
* Maps a shape to a path in the graphics context.
*
* @param s the shape ({@code null} not permitted).
*/
private void shapeToPath(Shape s) {
- double[] coords = new double[6];
this.gc.beginPath();
PathIterator iterator = s.getPathIterator(null);
while (!iterator.isDone()) {
@@ -1143,7 +1230,7 @@
}
// null is handled fine here...
this.clip = this.transform.createTransformedShape(shape);
- if (clip != null) {
+ if (clip != null && !this.clippingDisabled) {
this.gc.save();
this.saveCount++;
shapeToPath(shape);
@@ -1508,8 +1595,8 @@
* @return {@code true} if the image is drawn.
*/
@Override
- public boolean drawImage(final Image img, int x, int y, int width,
- int height, ImageObserver observer) {
+ public boolean drawImage(final Image img, int x, int y,
+ int width, int height, ImageObserver observer) {
final BufferedImage buffered;
if (img instanceof BufferedImage) {
buffered = (BufferedImage) img;
Added: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsConfiguration.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsConfiguration.java (rev 0)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsConfiguration.java 2015-09-11 04:25:11 UTC (rev 3326)
@@ -0,0 +1,148 @@
+/* ===========================================================
+ * JFreeChart : a free chart library for the Java(tm) platform
+ * ===========================================================
+ *
+ * (C) Copyright 2000-2015, 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.]
+ *
+ * ----------------------------
+ * FXGraphicsConfiguration.java
+ * ----------------------------
+ * (C) Copyright 2014, 2015 by Object Refinery Limited and Contributors.
+ *
+ * Original Author: David Gilbert (for Object Refinery Limited);
+ * Contributor(s): -;
+
+ * Changes:
+ * --------
+ * 11-Sep-2015 : Added to JFreeChart (DG);
+ *
+ */
+
+package org.jfree.chart.fx;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Rectangle;
+import java.awt.Transparency;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ColorModel;
+import java.awt.image.DirectColorModel;
+
+/**
+ * A graphics configuration for the {@link FXGraphics2D} class.
+ * This class is copied directly from the FXGraphics2D project, we keep a local
+ * copy to avoid having a dependency to manage.
+ *
+ * @since 1.0.20
+ */
+public class FXGraphicsConfiguration extends GraphicsConfiguration {
+
+ private GraphicsDevice device;
+
+ private final int width, height;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param width the width of the bounds.
+ * @param height the height of the bounds.
+ */
+ public FXGraphicsConfiguration(int width, int height) {
+ super();
+ this.width = width;
+ this.height = height;
+ }
+
+ /**
+ * Returns the graphics device that this configuration is associated with.
+ *
+ * @return The graphics device (never {@code null}).
+ */
+ @Override
+ public GraphicsDevice getDevice() {
+ if (this.device == null) {
+ this.device = new FXGraphicsDevice("FXGraphicsDevice", this);
+ }
+ return this.device;
+ }
+
+ /**
+ * Returns the color model for this configuration.
+ *
+ * @return The color model.
+ */
+ @Override
+ public ColorModel getColorModel() {
+ return getColorModel(Transparency.TRANSLUCENT);
+ }
+
+ /**
+ * Returns the color model for the specified transparency type, or
+ * <code>null</code>.
+ *
+ * @param transparency the transparency type.
+ *
+ * @return A color model (possibly {@code null}).
+ */
+ @Override
+ public ColorModel getColorModel(int transparency) {
+ if (transparency == Transparency.TRANSLUCENT) {
+ return ColorModel.getRGBdefault();
+ } else if (transparency == Transparency.OPAQUE) {
+ return new DirectColorModel(32, 0x00ff0000, 0x0000ff00, 0x000000ff);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the default transform.
+ *
+ * @return The default transform.
+ */
+ @Override
+ public AffineTransform getDefaultTransform() {
+ return new AffineTransform();
+ }
+
+ /**
+ * Returns the normalizing transform.
+ *
+ * @return The normalizing transform.
+ */
+ @Override
+ public AffineTransform getNormalizingTransform() {
+ return new AffineTransform();
+ }
+
+ /**
+ * Returns the bounds for this configuration.
+ *
+ * @return The bounds.
+ */
+ @Override
+ public Rectangle getBounds() {
+ return new Rectangle(this.width, this.height);
+ }
+
+}
Added: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsDevice.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsDevice.java (rev 0)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/fx/FXGraphicsDevice.java 2015-09-11 04:25:11 UTC (rev 3326)
@@ -0,0 +1,106 @@
+/* ===========================================================
+ * JFreeChart : a free chart library for the Java(tm) platform
+ * ===========================================================
+ *
+ * (C) Copyright 2000-2015, 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.]
+ *
+ * ---------------------
+ * FXGraphicsDevice.java
+ * ---------------------
+ * (C) Copyright 2014, 2015 by Object Refinery Limited and Contributors.
+ *
+ * Original Author: David Gilbert (for Object Refinery Limited);
+ * Contributor(s): -;
+
+ * Changes:
+ * --------
+ * 11-Sep-2015 : Added to JFreeChart (DG);
+ *
+ */
+
+package org.jfree.chart.fx;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+
+/**
+ * A graphics device for FXGraphics2D.
+ */
+public class FXGraphicsDevice extends GraphicsDevice {
+
+ private final String id;
+
+ GraphicsConfiguration defaultConfig;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param id the id.
+ * @param defaultConfig the default configuration.
+ */
+ public FXGraphicsDevice(String id, GraphicsConfiguration defaultConfig) {
+ this.id = id;
+ this.defaultConfig = defaultConfig;
+ }
+
+ /**
+ * Returns the device type.
+ *
+ * @return The device type.
+ */
+ @Override
+ public int getType() {
+ return GraphicsDevice.TYPE_RASTER_SCREEN;
+ }
+
+ /**
+ * Returns the id string.
+ *
+ * @return The id string.
+ */
+ @Override
+ public String getIDstring() {
+ return this.id;
+ }
+
+ /**
+ * Returns all configurations for this device.
+ *
+ * @return All configurations for this device.
+ */
+ @Override
+ public GraphicsConfiguration[] getConfigurations() {
+ return new GraphicsConfiguration[] { getDefaultConfiguration() };
+ }
+
+ /**
+ * Returns the default configuration for this device.
+ *
+ * @return The default configuration for this device.
+ */
+ @Override
+ public GraphicsConfiguration getDefaultConfiguration() {
+ return this.defaultConfig;
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mu...@us...> - 2015-09-10 04:49:26
|
Revision: 3325
http://sourceforge.net/p/jfreechart/code/3325
Author: mungady
Date: 2015-09-10 04:49:25 +0000 (Thu, 10 Sep 2015)
Log Message:
-----------
2015-09-10 David Gilbert <dav...@ob...>
* org/jfree/chart/labels/IntervalXYToolTipGenerator.java
New file.
Added Paths:
-----------
branches/jfreechart-1.0.x-branch/source/org/jfree/chart/labels/IntervalXYToolTipGenerator.java
Added: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/labels/IntervalXYToolTipGenerator.java
===================================================================
--- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/labels/IntervalXYToolTipGenerator.java (rev 0)
+++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/labels/IntervalXYToolTipGenerator.java 2015-09-10 04:49:25 UTC (rev 3325)
@@ -0,0 +1,264 @@
+/* ===========================================================
+ * JFreeChart : a free chart library for the Java(tm) platform
+ * ===========================================================
+ *
+ * (C) Copyright 2000-2015, 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.]
+ *
+ * -------------------------------
+ * IntervalXYToolTipGenerator.java
+ * -------------------------------
+ * (C) Copyright 2015, by Object Refinery Limited.
+ *
+ * Original Author: David Gilbert (for Object Refinery Limited);
+ * Contributor(s): -;
+ *
+ * Changes
+ * -------
+ * 10-Sep-2015 : Version 1 (DG);
+ *
+ */
+
+package org.jfree.chart.labels;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.text.MessageFormat;
+import java.text.NumberFormat;
+import java.util.Date;
+
+import org.jfree.data.xy.IntervalXYDataset;
+import org.jfree.data.xy.XYDataset;
+import org.jfree.util.PublicCloneable;
+
+/**
+ * A tooltip generator for datasets that implement the
+ * {@link IntervalXYDataset} interface.
+ *
+ * @since 1.0.20
+ */
+public class IntervalXYToolTipGenerator extends AbstractXYItemLabelGenerator
+ implements XYToolTipGenerator, Cloneable, PublicCloneable,
+ Serializable {
+
+ /** The default item label format. */
+ public static final String DEFAULT_TOOL_TIP_FORMAT
+ = "{0}: ({1} - {2}), ({5} - {6})";
+
+ /**
+ * Creates a new tooltip generator using default number formatters.
+ */
+ public IntervalXYToolTipGenerator() {
+ this(DEFAULT_TOOL_TIP_FORMAT, NumberFormat.getNumberInstance(),
+ NumberFormat.getNumberInstance());
+ }
+
+ /**
+ * Creates a new tooltip generator using the specified number formatters.
+ *
+ * @param formatString the item label format string ({@code null} not
+ * permitted).
+ * @param xFormat the format object for the x values ({@code null}
+ * not permitted).
+ * @param yFormat the format object for the y values ({@code null}
+ * not permitted).
+ */
+ public IntervalXYToolTipGenerator(String formatString,
+ NumberFormat xFormat, NumberFormat yFormat) {
+ super(formatString, xFormat, yFormat);
+ }
+
+ /**
+ * Creates a new tool tip generator using the specified formatters.
+ *
+ * @param formatString the item label format string ({@code null}
+ * not permitted).
+ * @param xFormat the format object for the x values ({@code null}
+ * not permitted).
+ * @param yFormat the format object for the y values ({@code null}
+ * not permitted).
+ */
+ public IntervalXYToolTipGenerator(String formatString,
+ DateFormat xFormat, NumberFormat yFormat) {
+ super(formatString, xFormat, yFormat);
+ }
+
+ /**
+ * Creates a new tool tip generator using the specified formatters (a
+ * number formatter for the x-values and a date formatter for the
+ * y-values).
+ *
+ * @param formatString the item label format string ({@code null}
+ * not permitted).
+ * @param xFormat the format object for the x values ({@code null}
+ * permitted).
+ * @param yFormat the format object for the y values ({@code null}
+ * not permitted).
+ */
+ public IntervalXYToolTipGenerator(String formatString,
+ NumberFormat xFormat, DateFormat yFormat) {
+ super(formatString, xFormat, yFormat);
+ }
+
+ /**
+ * Creates a new tool tip generator using the specified date formatters.
+ *
+ * @param formatString the label format string ({@code null} not
+ * permitted).
+ * @param xFormat the format object for the x values ({@code null} not
+ * permitted).
+ * @param yFormat the format object for the y values ({@code null}
+ * not permitted).
+ */
+ public IntervalXYToolTipGenerator(String formatString,
+ DateFormat xFormat, DateFormat yFormat) {
+ super(formatString, xFormat, yFormat);
+ }
+
+ /**
+ * Creates the array of items that can be passed to the
+ * {@link MessageFormat} class for creating labels.
+ *
+ * @param dataset the dataset ({@code null} not permitted).
+ * @param series the series (zero-based index).
+ * @param item the item (zero-based index).
+ *
+ * @return An array of seven items from the dataset formatted as
+ * {@code String} objects (never {@code null}).
+ */
+ @Override
+ protected Object[] createItemArray(XYDataset dataset, int series,
+ int item) {
+ IntervalXYDataset intervalDataset = null;
+ if (dataset instanceof IntervalXYDataset) {
+ intervalDataset = (IntervalXYDataset) dataset;
+ }
+ Object[] result = new Object[7];
+ result[0] = dataset.getSeriesKey(series).toString();
+
+ double x = dataset.getXValue(series, item);
+ double xs = x;
+ double xe = x;
+ double y = dataset.getYValue(series, item);
+ double ys = y;
+ double ye = y;
+ if (intervalDataset != null) {
+ xs = intervalDataset.getStartXValue(series, item);
+ xe = intervalDataset.getEndXValue(series, item);
+ ys = intervalDataset.getStartYValue(series, item);
+ ye = intervalDataset.getEndYValue(series, item);
+ }
+
+ DateFormat xdf = getXDateFormat();
+ if (xdf != null) {
+ result[1] = xdf.format(new Date((long) x));
+ result[2] = xdf.format(new Date((long) xs));
+ result[3] = xdf.format(new Date((long) xe));
+ } else {
+ NumberFormat xnf = getXFormat();
+ result[1] = xnf.format(x);
+ result[2] = xnf.format(xs);
+ result[3] = xnf.format(xe);
+ }
+
+ NumberFormat ynf = getYFormat();
+ DateFormat ydf = getYDateFormat();
+ if (Double.isNaN(y) && dataset.getY(series, item) == null) {
+ result[4] = getNullYString();
+ } else {
+ if (ydf != null) {
+ result[4] = ydf.format(new Date((long) y));
+ }
+ else {
+ result[4] = ynf.format(y);
+ }
+ }
+ if (Double.isNaN(ys) && intervalDataset != null
+ && intervalDataset.getStartY(series, item) == null) {
+ result[5] = getNullYString();
+ } else {
+ if (ydf != null) {
+ result[5] = ydf.format(new Date((long) ys));
+ }
+ else {
+ result[5] = ynf.format(ys);
+ }
+ }
+ if (Double.isNaN(ye) && intervalDataset != null
+ && intervalDataset.getEndY(series, item) == null) {
+ result[6] = getNullYString();
+ } else {
+ if (ydf != null) {
+ result[6] = ydf.format(new Date((long) ye));
+ }
+ else {
+ result[6] = ynf.format(ye);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Generates the tool tip text for an item in a dataset.
+ *
+ * @param dataset the dataset ({@code null} not permitted).
+ * @param series the series index (zero-based).
+ * @param item the item index (zero-based).
+ *
+ * @return The tool tip text (possibly {@code null}).
+ */
+ @Override
+ public String generateToolTip(XYDataset dataset, int series, int item) {
+ return generateLabelString(dataset, series, item);
+ }
+
+ /**
+ * Returns an independent copy of the generator.
+ *
+ * @return A clone.
+ *
+ * @throws CloneNotSupportedException if cloning is not supported.
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ /**
+ * Tests this object for equality with an arbitrary object.
+ *
+ * @param obj the other object ({@code null} permitted).
+ *
+ * @return A boolean.
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof IntervalXYToolTipGenerator)) {
+ return false;
+ }
+ return super.equals(obj);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|