Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/jfree/StickyAxisAnnotation.java @ 7119:988dde49ae65
Fix area label rendering.
Previously the showarealabel setting was neither parsed nor
used to decide if the arealabel should be drawn.
It is mostly off but enabled for Cross Sections. It is now
also shown in the style editors in case someone got used to it ;)
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 24 Sep 2013 18:13:51 +0200 |
parents | 55c8519e49f1 |
children | 130160b8d245 |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4239
diff
changeset
|
9 package org.dive4elements.river.jfree; |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 /** |
4239
293a0d098606
Clarifications in doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4048
diff
changeset
|
12 * Text, position on axis, and maybe a hit-point in a class. |
293a0d098606
Clarifications in doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4048
diff
changeset
|
13 * |
293a0d098606
Clarifications in doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4048
diff
changeset
|
14 * Idea is to draw a given text and a line to it from either axis. |
293a0d098606
Clarifications in doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4048
diff
changeset
|
15 * This class just keeps the info. |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
17 public class StickyAxisAnnotation { |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 /** Simplified view on axes. */ |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 public static enum SimpleAxis { |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 X_AXIS, /** Usually "horizontal". */ |
2999
703be13ffa74
Cosmetics and ommitted fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2775
diff
changeset
|
22 Y_AXIS, /** Usually "vertical". */ |
703be13ffa74
Cosmetics and ommitted fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2775
diff
changeset
|
23 Y_AXIS2 |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 } |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
26 /** The "symbolic" integer representing which axis to stick to. */ |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
27 protected int axisSymbol; |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
28 |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 /** Which axis to stick to. */ |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 protected SimpleAxis stickyAxis = SimpleAxis.X_AXIS; |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
32 /** The 1-dimensional position of this annotation. */ |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
33 protected float pos; |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
34 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
35 /** |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
36 * Optional field used when from axis a line should be drawn that |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
37 * hits a curve or something similar (current scenario: duration curves). |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
38 * This value is in the "other" dimension than the pos - field. |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
39 */ |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
40 protected float hitPoint; |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
41 |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
42 /** The text to display at axis. */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
43 String text; |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
44 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
45 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
46 /** |
1089
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
47 * Constructor with implicit sticky x-axis. |
3269
b2ea89a665bc
Fix issues in 'documentation'.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
48 * @param text the text to display. |
b2ea89a665bc
Fix issues in 'documentation'.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
49 * @param pos the position at which to draw the text and mark. |
1089
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
50 */ |
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
51 public StickyAxisAnnotation(String text, float pos) { |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
52 this(text, pos, SimpleAxis.X_AXIS); |
1089
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
53 } |
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
54 |
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
55 |
e298c4d28927
Improved mainvalues rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1085
diff
changeset
|
56 /** |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
57 * Constructor with given explicit axis. |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
58 * @param text the text to display. |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
59 * @param pos the position at which to draw the text and mark. |
3269
b2ea89a665bc
Fix issues in 'documentation'.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
60 * @param stickAxis the axis at which to stick (and to which 'pos' is |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
61 * relative). |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
62 */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
63 public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
64 ) { |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
65 this(text, pos, stickAxis, 0); |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
66 } |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
67 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
68 |
3284
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
69 /** |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
70 * Constructor with given explicit axis and axisSymbol |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
71 * @param text the text to display. |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
72 * @param pos the position at which to draw the text and mark. |
7025
55c8519e49f1
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6452
diff
changeset
|
73 * @param stickAxis the axis at which to stick (and to which 'pos' is |
3284
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
74 * relative). |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3269
diff
changeset
|
75 */ |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
76 public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis, |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
77 int axisSymbol |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
78 ) { |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1082
diff
changeset
|
79 setStickyAxis(stickAxis); |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
80 this.text = text; |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
81 this.pos = pos; |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
82 this.axisSymbol = axisSymbol; |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
83 this.hitPoint = Float.NaN; |
1082
f16b66839e59
Prepare StickyAxisAnnotation implementation to handle annotations at 'y' (vertical) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1042
diff
changeset
|
84 } |
f16b66839e59
Prepare StickyAxisAnnotation implementation to handle annotations at 'y' (vertical) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1042
diff
changeset
|
85 |
f16b66839e59
Prepare StickyAxisAnnotation implementation to handle annotations at 'y' (vertical) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1042
diff
changeset
|
86 |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 /** |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 * Sets the "sticky axis" (whether to draw annotations at the |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 * X- or the Y-Axis. |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 * |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 * @param stickyAxis axis to stick to. |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 */ |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 public void setStickyAxis(SimpleAxis stickyAxis) { |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 this.stickyAxis = stickyAxis; |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 } |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 |
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 |
6452
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
98 /** The position (relative to axis). */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
99 public float getPos() { |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
100 return this.pos; |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 } |
1738
6cdc7a77d3d4
Apply theme attributes to axis annotation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1711
diff
changeset
|
102 |
6452
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
103 /** The position (relative to axis). */ |
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
104 public void setPos(double pos) { |
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
105 this.pos = (float) pos; |
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
106 } |
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
107 |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
108 public SimpleAxis getStickyAxis() { |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
109 return this.stickyAxis; |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
110 } |
1738
6cdc7a77d3d4
Apply theme attributes to axis annotation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1711
diff
changeset
|
111 |
6452
9cbe58704604
StickyAxisAnnotation: Add setter for pos and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
112 /** True if at x axis. */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
113 public boolean atX() { |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
114 return this.getStickyAxis() == SimpleAxis.X_AXIS; |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
115 } |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
116 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
117 /** Get text to be displayed at axis. */ |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
118 public String getText() { |
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1962
diff
changeset
|
119 return this.text; |
1738
6cdc7a77d3d4
Apply theme attributes to axis annotation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1711
diff
changeset
|
120 } |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
121 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
122 |
2163
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
123 public int getAxisSymbol() { |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
124 return this.axisSymbol; |
105097966111
Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
125 } |
2766
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
126 |
2775
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
127 |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
128 /** Set where to hit a curve (if any). */ |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
129 public void setHitPoint(float pos) { |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
130 this.hitPoint = pos; |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
131 } |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
132 |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
133 /** Get where to hit a curve (if any). */ |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
134 public float getHitPoint() { |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
135 return this.hitPoint; |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
136 } |
5016609663e2
Draw line from w-annotation to duration curve, rough version.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2766
diff
changeset
|
137 |
2766
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
138 /** Set sticky axis to the X axis if it is currently Y, and vice versa. */ |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
139 public void flipStickyAxis() { |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
140 if (this.getStickyAxis() == SimpleAxis.X_AXIS) { |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
141 this.setStickyAxis(SimpleAxis.Y_AXIS); |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
142 } |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
143 else { |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
144 this.setStickyAxis(SimpleAxis.X_AXIS); |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
145 } |
7dc4681a2bed
Allow easy change of sticky axis for annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
146 } |
1039
cf39205df113
Part of refactoring (see next commit).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 } |
1711
f708120cb7bc
Fix flys/issue363 (W-INFO/ Abflusskurve, Extremwert-Rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1167
diff
changeset
|
148 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |