Skip to content

Commit

Permalink
Fix cross hair painting (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Jan 14, 2023
1 parent f036702 commit b9a36f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 43 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
JFreeChart
==========

Version 1.5.4, 8 January 2023.
Version 1.5.5, not yet released.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.jfree/jfreechart/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.jfree/jfreechart)

Expand Down Expand Up @@ -56,6 +56,8 @@ at GitHub:

History
-------
##### Version 1.5.5 (not yet released)
- fix cross hair painting ([#340](https://github.com/jfree/jfreechart/issues/340))

##### Version 1.5.4 (8 January 2023)
- add new methods to access maps for datasets, renderers and axes in plots ([#201](https://github.com/jfree/jfreechart/issues/201));
Expand Down
55 changes: 13 additions & 42 deletions src/main/java/org/jfree/chart/ChartPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ public boolean isDomainZoomable() {
}

/**
* Sets the flag that controls whether or not zooming is enabled for the
* Sets the flag that controls whether zooming is enabled for the
* domain axis. A check is made to ensure that the current plot supports
* zooming for the domain values.
*
Expand All @@ -860,10 +860,9 @@ public void setDomainZoomable(boolean flag) {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
this.domainZoomable = flag && (z.isDomainZoomable());
this.domainZoomable = z.isDomainZoomable();
}
}
else {
} else {
this.domainZoomable = false;
}
}
Expand All @@ -888,10 +887,9 @@ public void setRangeZoomable(boolean flag) {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
this.rangeZoomable = flag && (z.isRangeZoomable());
this.rangeZoomable = z.isRangeZoomable();
}
}
else {
} else {
this.rangeZoomable = false;
}
}
Expand Down Expand Up @@ -1928,6 +1926,8 @@ public void mouseClicked(MouseEvent event) {
if (this.chart == null) {
return;
}
this.chart.setNotify(true);

// new entity code...
Object[] listeners = this.chartMouseListeners.getListeners(
ChartMouseListener.class);
Expand Down Expand Up @@ -2631,15 +2631,8 @@ private String generateSVG(int width, int height) {
try {
Method m = g2.getClass().getMethod("getSVGElement");
svg = (String) m.invoke(g2);
} catch (NoSuchMethodException e) {
// null will be returned
} catch (SecurityException e) {
// null will be returned
} catch (IllegalAccessException e) {
// null will be returned
} catch (IllegalArgumentException e) {
// null will be returned
} catch (InvocationTargetException e) {
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
// null will be returned
}
return svg;
Expand All @@ -2650,19 +2643,8 @@ private Graphics2D createSVGGraphics2D(int w, int h) {
Class svgGraphics2d = Class.forName("org.jfree.graphics2d.svg.SVGGraphics2D");
Constructor ctor = svgGraphics2d.getConstructor(int.class, int.class);
return (Graphics2D) ctor.newInstance(w, h);
} catch (ClassNotFoundException ex) {
return null;
} catch (NoSuchMethodException ex) {
return null;
} catch (SecurityException ex) {
return null;
} catch (InstantiationException ex) {
return null;
} catch (IllegalAccessException ex) {
return null;
} catch (IllegalArgumentException ex) {
return null;
} catch (InvocationTargetException ex) {
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException |
IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
return null;
}
}
Expand Down Expand Up @@ -2759,19 +2741,8 @@ private void writeAsPDF(File file, int w, int h) {
this.chart.draw(g2, drawArea);
Method m3 = pdfDocClass.getMethod("writeToFile", File.class);
m3.invoke(pdfDoc, file);
} catch (ClassNotFoundException ex) {
throw new RuntimeException(ex);
} catch (InstantiationException ex) {
throw new RuntimeException(ex);
} catch (IllegalAccessException ex) {
throw new RuntimeException(ex);
} catch (NoSuchMethodException ex) {
throw new RuntimeException(ex);
} catch (SecurityException ex) {
throw new RuntimeException(ex);
} catch (IllegalArgumentException ex) {
throw new RuntimeException(ex);
} catch (InvocationTargetException ex) {
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException |
SecurityException | IllegalArgumentException | InvocationTargetException ex) {
throw new RuntimeException(ex);
}
}
Expand Down

0 comments on commit b9a36f2

Please sign in to comment.