Mercurial > dive4elements > river
changeset 1082:f16b66839e59
Prepare StickyAxisAnnotation implementation to handle annotations at 'y' (vertical) axis.
flys-artifacts/trunk@2579 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 25 Aug 2011 10:50:30 +0000 |
parents | d10efbe2e5c0 |
children | d0db31d1f64c |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java |
diffstat | 2 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Aug 25 10:47:55 2011 +0000 +++ b/flys-artifacts/ChangeLog Thu Aug 25 10:50:30 2011 +0000 @@ -1,3 +1,10 @@ +2011-08-25 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java: + Prepare further differentiation between Annotations that stick to X or Y- + Axis, copied some positioning logic into StickyAxisAnnotation + implementation. + 2011-08-25 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java Thu Aug 25 10:47:55 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java Thu Aug 25 10:50:30 2011 +0000 @@ -20,6 +20,7 @@ import org.jfree.chart.plot.Plot; import org.jfree.ui.RectangleEdge; +import org.jfree.ui.TextAnchor; /** @@ -52,8 +53,16 @@ */ public StickyAxisAnnotation(String text, float x, float y) { super(text, x, y); + setStickyAxis(SimpleAxis.X_AXIS); } + public StickyAxisAnnotation(String text, float x, float y, + SimpleAxis stickAxis) { + super(text, x, y); + setStickyAxis(stickAxis); + } + + /** * Sets the "sticky axis" (whether to draw annotations at the @@ -63,6 +72,11 @@ */ public void setStickyAxis(SimpleAxis stickyAxis) { this.stickyAxis = stickyAxis; + if (stickyAxis == SimpleAxis.X_AXIS) { + this.setRotationAngle(270f * (Math.PI / 180f)); + this.setRotationAnchor(TextAnchor.CENTER_LEFT); + this.setTextAnchor(TextAnchor.CENTER_LEFT); + } }