# HG changeset patch # User Felix Wolfsteller # Date 1319546638 0 # Node ID c51089a84d13c40bcbb766d75dbb7dc5c8157829 # Parent 1d78039a36e6163ff0cd74a74c7d0a81bbc17916 Restored correct drawing behavior for Annotations. flys-artifacts/trunk@3072 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1d78039a36e6 -r c51089a84d13 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Oct 25 12:37:05 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Oct 25 12:43:58 2011 +0000 @@ -1,3 +1,9 @@ +2011-10-25 Felix Wolfsteller + + * ./src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java: + Revert correct behaviour of Annotations (the small axis tick shall + always be drawn). Minor refactoring. + 2011-10-25 Felix Wolfsteller * doc/conf/meta-data.xml: Added configuration to include differences diff -r 1d78039a36e6 -r c51089a84d13 flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java --- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java Tue Oct 25 12:37:05 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java Tue Oct 25 12:43:58 2011 +0000 @@ -32,7 +32,8 @@ /** * Custom Annotations class that is drawn only if no collisions with other - * already drawn CustomAnnotations in current plot are found. + * already drawn CustomAnnotations in current plot are found. A mark on + * the axis is shown in all cases, though. * Draws a given text and a line to it from either axis. */ public class StickyAxisAnnotation extends XYTextAnnotation { @@ -216,6 +217,9 @@ // see JFreeChart bug 2221495 boolean visible = LineUtilities.clipLine(line, dataArea); if (visible) { + setOutlineStroke(new BasicStroke((float) lineWidth)); + g2.setStroke(getOutlineStroke()); + g2.setPaint(lineColor); g2.draw(line); } } @@ -296,6 +300,10 @@ //Call to apply orientation. setStickyAxis(stickyAxis); + // Always draw the small line at axis. + drawAxisMark(g2, dataArea, domainAxis, rangeAxis, domainEdge, + rangeEdge, orientation); + Shape hotspot = TextUtilities.calculateRotatedStringBounds( getText(), g2, anchorX, anchorY, getTextAnchor(), getRotationAngle(), getRotationAnchor()); @@ -326,13 +334,6 @@ g2.draw(hotspot); } - // Always draw the small line at axis. - setOutlineStroke(new BasicStroke((float) lineWidth)); - g2.setStroke(getOutlineStroke()); - g2.setPaint(lineColor); - drawAxisMark(g2, dataArea, domainAxis, rangeAxis, domainEdge, - rangeEdge, orientation); - // Draw the text. g2.setPaint(textColor); g2.setFont(font);