comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java @ 2163:105097966111

Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves. flys-artifacts/trunk@3750 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 23 Jan 2012 14:18:53 +0000
parents c68f4f227c09
children 7dc4681a2bed
comparison
equal deleted inserted replaced
2162:df70f14af981 2163:105097966111
18 /** Simplified view on axes. */ 18 /** Simplified view on axes. */
19 public static enum SimpleAxis { 19 public static enum SimpleAxis {
20 X_AXIS, /** Usually "horizontal". */ 20 X_AXIS, /** Usually "horizontal". */
21 Y_AXIS /** Usually "vertical". */ 21 Y_AXIS /** Usually "vertical". */
22 } 22 }
23
24 /** The "symbolic" integer representing which axis to stick to. */
25 protected int axisSymbol;
23 26
24 /** Which axis to stick to. */ 27 /** Which axis to stick to. */
25 protected SimpleAxis stickyAxis = SimpleAxis.X_AXIS; 28 protected SimpleAxis stickyAxis = SimpleAxis.X_AXIS;
26 29
27 /** The 1-dimensional position of this annotation. */ 30 /** The 1-dimensional position of this annotation. */
47 * relative). 50 * relative).
48 * @param lineTo upto where to draw a line (NaN for none). 51 * @param lineTo upto where to draw a line (NaN for none).
49 */ 52 */
50 public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis 53 public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis
51 ) { 54 ) {
55 this(text, pos, stickAxis, 0);
56 }
57
58 public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis,
59 int axisSymbol
60 ) {
52 setStickyAxis(stickAxis); 61 setStickyAxis(stickAxis);
53 this.text = text; 62 this.text = text;
54 this.pos = pos; 63 this.pos = pos;
64 this.axisSymbol = axisSymbol;
55 } 65 }
56 66
57 67
58 /** 68 /**
59 * Sets the "sticky axis" (whether to draw annotations at the 69 * Sets the "sticky axis" (whether to draw annotations at the
79 } 89 }
80 90
81 public String getText() { 91 public String getText() {
82 return this.text; 92 return this.text;
83 } 93 }
94
95 public int getAxisSymbol() {
96 return this.axisSymbol;
97 }
84 } 98 }
85 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 99 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org