Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 6424:11d3d04f3925
issue1370: Let a hypothetical second y axis be an SyncNumberAxis depending on first.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 26 Jun 2013 12:30:07 +0200 |
parents | 654ed1732035 |
children | e32b166c881b |
comparison
equal
deleted
inserted
replaced
6423:654ed1732035 | 6424:11d3d04f3925 |
---|---|
63 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurve"; | 63 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurve"; |
64 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; | 64 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
65 public static final String I18N_MAINVALUES_Q_LABEL = "Q (Haupt- und Extremwerte)"; | 65 public static final String I18N_MAINVALUES_Q_LABEL = "Q (Haupt- und Extremwerte)"; |
66 public static final String I18N_MAINVALUES_W_LABEL = "W (Haupt- und Extremwerte)"; | 66 public static final String I18N_MAINVALUES_W_LABEL = "W (Haupt- und Extremwerte)"; |
67 | 67 |
68 protected NumberAxis firstYAxis; | |
68 | 69 |
69 /** Trivial Constructor. */ | 70 /** Trivial Constructor. */ |
70 public ComputedDischargeCurveGenerator () { | 71 public ComputedDischargeCurveGenerator () { |
71 super(); | 72 super(); |
72 } | 73 } |
110 D4EArtifact flys = (D4EArtifact) master; | 111 D4EArtifact flys = (D4EArtifact) master; |
111 | 112 |
112 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); | 113 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
113 | 114 |
114 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); | 115 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); |
116 } | |
117 | |
118 | |
119 /** | |
120 * Create Y (range) axis for given index. | |
121 * Shall be overriden by subclasses. | |
122 */ | |
123 protected NumberAxis createYAxis(int index) { | |
124 if (index == 0) { | |
125 firstYAxis = super.createYAxis(0); | |
126 return firstYAxis; | |
127 } | |
128 YAxisWalker walker = getYAxisWalker(); | |
129 | |
130 Font labelFont = new Font( | |
131 DEFAULT_FONT_NAME, | |
132 Font.BOLD, | |
133 getYAxisFontSize(index)); | |
134 | |
135 SyncNumberAxis axis = new SyncNumberAxis( | |
136 walker.getId(index), | |
137 getYAxisLabel(index), | |
138 firstYAxis); | |
139 | |
140 axis.setAutoRangeIncludesZero(false); | |
141 axis.setLabelFont(labelFont); | |
142 axis.setTickLabelFont(labelFont); | |
143 axis.setShift((double)-atGaugeSubtractPNP()); | |
144 | |
145 return axis; | |
115 } | 146 } |
116 | 147 |
117 | 148 |
118 /** | 149 /** |
119 * Process data, build up plot. | 150 * Process data, build up plot. |