Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java @ 2662:bdc86e61428c
Respect show line label bg setting.
flys-artifacts/trunk@4337 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 03 May 2012 07:48:12 +0000 |
parents | 1a044c51abe4 |
children | 9cea02b51241 |
comparison
equal
deleted
inserted
replaced
2661:17927c60ac1c | 2662:bdc86e61428c |
---|---|
245 g2.setPaint(getItemOutlinePaint(series, item)); | 245 g2.setPaint(getItemOutlinePaint(series, item)); |
246 g2.setStroke(getItemOutlineStroke(series, item)); | 246 g2.setStroke(getItemOutlineStroke(series, item)); |
247 g2.draw(shape); | 247 g2.draw(shape); |
248 } | 248 } |
249 } | 249 } |
250 // TODO labeling of waterlevels could happen here, too. | |
251 } // if (getItemShapeVisible(dataset, series, item)) | 250 } // if (getItemShapeVisible(dataset, series, item)) |
252 | 251 |
253 double xx = transX1; | 252 double xx = transX1; |
254 double yy = transY1; | 253 double yy = transY1; |
255 if (orientation == PlotOrientation.HORIZONTAL) { | 254 if (orientation == PlotOrientation.HORIZONTAL) { |
269 String waterlevelLabel = (xYSeries instanceof HasLabel) | 268 String waterlevelLabel = (xYSeries instanceof HasLabel) |
270 ? ((HasLabel)xYSeries).getLabel() | 269 ? ((HasLabel)xYSeries).getLabel() |
271 : xYSeries.getKey().toString(); | 270 : xYSeries.getKey().toString(); |
272 // TODO Force water of some German rivers to flow direction mountains. | 271 // TODO Force water of some German rivers to flow direction mountains. |
273 Font oldFont = g2.getFont(); | 272 Font oldFont = g2.getFont(); |
274 // or do we have to do it via getPaint? | |
275 | 273 |
276 Color oldColor = g2.getColor(); | 274 Color oldColor = g2.getColor(); |
277 g2.setFont(this.getLineLabelFont(series)); | 275 g2.setFont(this.getLineLabelFont(series)); |
278 g2.setColor(this.getLineLabelTextColor(series)); | 276 g2.setColor(this.getLineLabelTextColor(series)); |
279 g2.setBackground(Color.black); | 277 g2.setBackground(Color.black); |
280 | 278 |
281 // TODO if bg-bool ... | 279 // Fill background. |
282 drawTextBox(g2, waterlevelLabel, (float)xx, (float)yy-3f, | 280 if (isShowLineLabelBG(series)) { |
283 getLineLabelBGColor(series)); | 281 drawTextBox(g2, waterlevelLabel, (float)xx, (float)yy-3f, |
282 getLineLabelBGColor(series)); | |
283 } | |
284 | 284 |
285 g2.drawString(waterlevelLabel, (float)xx, (float)yy-3f); | 285 g2.drawString(waterlevelLabel, (float)xx, (float)yy-3f); |
286 | 286 |
287 g2.setFont(oldFont); | 287 g2.setFont(oldFont); |
288 g2.setColor(oldColor); | 288 g2.setColor(oldColor); |