#116 Draw Border Outline of IntervalMarker

closed-fixed
None
7
2006-10-24
2006-03-30
pelski
No

Below is a patch for the AbstractXYItemRenderer that
actually draws the border of the rectangle of an
IntervalMarker. If this is not done, then the marker
becomes near invisible when the rectangle becomes very
thin.

Please contact me if there are any problems.
Regards,
Nick

Index: AbstractXYItemRenderer.java

RCS file:
/cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java,v
retrieving revision 1.29
diff -u -w -r1.29 AbstractXYItemRenderer.java
--- AbstractXYItemRenderer.java 12 Dec 2005 14:11:32
-0000 1.29
+++ AbstractXYItemRenderer.java 30 Mar 2006 22:53:38 -0000
@@ -985,6 +985,12 @@
g2.setPaint(p);
}
g2.fill(rect);
+ if (rect != null) { // draw the outline of
the marker
+ Rectangle2D bounds = rect.getFrame();
+ g2.setPaint(marker.getOutlinePaint());
+ g2.setStroke(marker.getOutlineStroke());
+ g2.draw(bounds);
+ }

String label = marker.getLabel();
RectangleAnchor anchor =
marker.getLabelAnchor();

Discussion

  • Sergei Ivanov

    Sergei Ivanov - 2006-09-29

    Logged In: YES
    user_id=1606022

    I would like to add my vote for the integration of this
    patch, because I was going to submit a similar one.
    However, I thought it might be better to draw only left and
    right (for vertical orientation) or top and bottom (for
    horizontal) edges.

     
  • David Gilbert

    David Gilbert - 2006-10-24
    • priority: 5 --> 7
    • assigned_to: nobody --> mungady
     
  • David Gilbert

    David Gilbert - 2006-10-24

    Logged In: YES
    user_id=112975

    I'll take a look at this. I agree with Sergei that only the
    edges should be drawn, not the whole rectangle (indeed,
    that's exactly what I did for the corresponding method in
    AbstractCategoryItemRenderer just yesterday).

     
  • David Gilbert

    David Gilbert - 2006-10-24

    Logged In: YES
    user_id=112975

    I've committed a fix to CVS, ready for the 1.0.3 release.

     
  • David Gilbert

    David Gilbert - 2006-10-24
    • status: open --> closed-fixed
     

Log in to post a comment.