Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java @ 1754:8e6615ad60b8
Added some simple caching for themes. Only used in sticky annotations by now.
flys-artifacts/trunk@3057 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 21 Oct 2011 15:19:49 +0000 |
parents | 741ba9e34c7d |
children | c51089a84d13 |
comparison
equal
deleted
inserted
replaced
1753:741ba9e34c7d | 1754:8e6615ad60b8 |
---|---|
1 package de.intevation.flys.jfree; | 1 package de.intevation.flys.jfree; |
2 | 2 |
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | 4 |
5 import java.util.Iterator; | 5 import java.util.Iterator; |
6 | |
7 import org.w3c.dom.Document; | |
8 | 6 |
9 import java.awt.Shape; | 7 import java.awt.Shape; |
10 import java.awt.geom.Rectangle2D; | 8 import java.awt.geom.Rectangle2D; |
11 import java.awt.geom.Line2D; | 9 import java.awt.geom.Line2D; |
12 import java.awt.Color; | 10 import java.awt.Color; |
28 import org.jfree.text.TextUtilities; | 26 import org.jfree.text.TextUtilities; |
29 | 27 |
30 import org.jfree.ui.RectangleEdge; | 28 import org.jfree.ui.RectangleEdge; |
31 import org.jfree.ui.TextAnchor; | 29 import org.jfree.ui.TextAnchor; |
32 | 30 |
33 import de.intevation.flys.utils.ThemeUtil; | 31 import de.intevation.flys.utils.ThemeAccess; |
34 | 32 |
35 /** | 33 /** |
36 * Custom Annotations class that is drawn only if no collisions with other | 34 * Custom Annotations class that is drawn only if no collisions with other |
37 * already drawn CustomAnnotations in current plot are found. | 35 * already drawn CustomAnnotations in current plot are found. |
38 * Draws a given text and a line to it from either axis. | 36 * Draws a given text and a line to it from either axis. |
344 // Add info that we have drawn this Annotation. | 342 // Add info that we have drawn this Annotation. |
345 addEntity(info, hotspot, rendererIndex, getToolTipText(), getURL()); | 343 addEntity(info, hotspot, rendererIndex, getToolTipText(), getURL()); |
346 } | 344 } |
347 | 345 |
348 | 346 |
349 public void applyTheme(Document theme) { | 347 public void applyTheme(ThemeAccess ta) { |
350 lineWidth = ThemeUtil.parseLineWidth(theme); | 348 lineWidth = ta.parseLineWidth(); |
351 lineColor = ThemeUtil.parseLineColorField(theme); | 349 lineColor = ta.parseLineColorField(); |
352 textColor = ThemeUtil.parseTextColor(theme); | 350 textColor = ta.parseTextColor(); |
353 font = ThemeUtil.parseTextFont(theme); | 351 font = ta.parseTextFont(); |
354 textOrientation = ThemeUtil.parseTextOrientation(theme); | 352 textOrientation = ta.parseTextOrientation(); |
355 textBackground = ThemeUtil.parseTextBackground(theme); | 353 textBackground = ta.parseTextBackground(); |
356 showBackground = ThemeUtil.parseShowTextBackground(theme); | 354 showBackground = ta.parseShowTextBackground(); |
357 } | 355 } |
358 } | 356 } |
359 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 357 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |