Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java @ 6906:7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 23 Aug 2013 01:16:13 +0200 |
parents | 1b35b2ddfc28 |
children | 819481cc9195 |
rev | line source |
---|---|
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 package org.dive4elements.river.themes; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.awt.Color; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 import java.awt.Font; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
14 import org.apache.log4j.Logger; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.dive4elements.artifacts.CallMeta; |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
16 import org.dive4elements.artifacts.common.utils.XMLUtils; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
17 import org.dive4elements.river.artifacts.model.MapserverStyle; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
18 import org.dive4elements.river.artifacts.model.MapserverStyle.Clazz; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
19 import org.dive4elements.river.artifacts.model.MapserverStyle.Expression; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
20 import org.dive4elements.river.artifacts.model.MapserverStyle.Label; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
21 import org.dive4elements.river.artifacts.model.MapserverStyle.Style; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
22 import org.dive4elements.river.artifacts.resources.Resources; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 import org.w3c.dom.Document; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
25 public class ThemeDocument |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
27 private static Logger logger = Logger.getLogger(ThemeDocument.class); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
28 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
29 private static final String MSG_ISOBATH_CLASS = "floodmap.isobath.class"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
30 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
31 private static final String MSG_ISOBATH_LASTCLASS = "floodmap.isobath.lastclass"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
32 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
33 public final static String XPATH_FILL_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
34 "/theme/field[@name='fillcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
35 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
36 public final static String XPATH_LINE_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
37 "/theme/field[@name='linecolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
38 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
39 public final static String XPATH_AREA_LINE_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
40 "/theme/field[@name='areabordercolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
41 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
42 public static final String XPATH_LINE_SIZE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
43 "/theme/field[@name='linesize']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
44 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
45 public static final String XPATH_LINE_STYLE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
46 "/theme/field[@name='linetype']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
47 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
48 public static final String XPATH_POINT_SIZE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
49 "/theme/field[@name='pointsize']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
50 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
51 public static final String XPATH_POINT_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
52 "/theme/field[@name='pointcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
53 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
54 public final static String XPATH_SHOW_BORDER = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
55 "/theme/field[@name='showborder']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
56 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
57 public final static String XPATH_AREA_SHOW_BORDER = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
58 "/theme/field[@name='showborder']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
59 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
60 public final static String XPATH_SHOW_POINTS = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
61 "/theme/field[@name='showpoints']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
62 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
63 public final static String XPATH_SHOW_LINE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
64 "/theme/field[@name='showlines']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
65 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
66 public final static String XPATH_SHOW_VERTICAL_LINE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
67 "/theme/field[@name='showverticalline']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
68 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
69 public final static String XPATH_SHOW_HORIZONTAL_LINE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
70 "/theme/field[@name='showhorizontalline']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
71 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
72 public final static String XPATH_SHOW_LINE_LABEL = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
73 "/theme/field[@name='showlinelabel']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
74 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
75 public final static String XPATH_SHOW_POINT_LABEL = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
76 "/theme/field[@name='showpointlabel']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
77 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
78 public final static String XPATH_SHOW_WIDTH = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
79 "/theme/field[@name='showwidth']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
80 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
81 public final static String XPATH_SHOW_LEVEL = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
82 "/theme/field[@name='showlevel']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
83 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
84 public final static String XPATH_TRANSPARENCY = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
85 "/theme/field[@name='transparency']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
86 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
87 public final static String XPATH_AREA_TRANSPARENCY = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
88 "/theme/field[@name='areatransparency']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
89 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
90 public final static String XPATH_SHOW_AREA = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
91 "/theme/field[@name='showarea']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
92 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
93 public final static String XPATH_SHOW_MIDDLE_HEIGHT = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
94 "/theme/field[@name='showmiddleheight']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
95 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
96 public final static String XPATH_LABEL_FONT_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
97 "/theme/field[@name='labelfontcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
98 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
99 public final static String XPATH_LABEL_FONT_SIZE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
100 "/theme/field[@name='labelfontsize']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
101 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
102 public final static String XPATH_LABEL_FONT_FACE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
103 "/theme/field[@name='labelfontface']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
104 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
105 public final static String XPATH_LABEL_FONT_STYLE = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
106 "/theme/field[@name='labelfontstyle']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
107 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
108 public final static String XPATH_TEXT_ORIENTATION = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
109 "/theme/field[@name='textorientation']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
110 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
111 public final static String XPATH_LABEL_BGCOLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
112 "/theme/field[@name='labelbgcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
113 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
114 public final static String XPATH_LABEL_SHOW_BACKGROUND = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
115 "/theme/field[@name='labelshowbg']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
116 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
117 public final static String XPATH_BACKGROUND_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
118 "/theme/field[@name='backgroundcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
119 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
120 public final static String XPATH_AREA_BACKGROUND_COLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
121 "/theme/field[@name='areabgcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
122 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
123 public final static String XPATH_SYMBOL = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
124 "/theme/field[@name='symbol']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
125 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
126 public final static String XPATH_SHOW_MINIMUM = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
127 "/theme/field[@name='showminimum']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
128 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
129 public final static String XPATH_SHOW_MAXIMUM = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
130 "/theme/field[@name='showmaximum']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
131 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
132 public final static String XPATH_WSPLGEN_FIELDS = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
133 "/theme[@name='WSPLGEN']/field"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
134 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
135 public final static String XPATH_WSPLGEN_STARTCOLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
136 "/theme/field[@name='startcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
137 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
138 public final static String XPATH_WSPLGEN_ENDCOLOR = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
139 "/theme/field[@name='endcolor']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
140 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
141 public final static String XPATH_WSPLGEN_NUMCLASSES = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
142 "/theme/field[@name='numclasses']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
143 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
144 /** XPATH to bandwidth field. */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
145 public final static String XPATH_BANDWIDTH = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
146 "/theme/field[@name='bandwidth']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
147 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
148 /** XPATH to find showextramark field. */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
149 public final static String XPATH_SHOWEXTRAMARK = |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
150 "/theme/field[@name='showextramark']/@default"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
151 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
152 private Document document; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
153 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
154 public ThemeDocument() { |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
155 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
156 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
157 public ThemeDocument(Document document) { |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
158 this.document = document; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
159 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
160 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
161 public Document getDocument() { |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
162 return document; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
163 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
164 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
165 /** Parse string to be boolean with default if empty or unrecognized. */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
166 public static boolean parseBoolean(String value, boolean defaultsTo) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
167 if (value == null || value.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
168 return defaultsTo; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
169 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
170 if (value.equals("false")) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
171 return false; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
172 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
173 else if (value.equals("true")) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
174 return true; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
175 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
176 else { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
177 return defaultsTo; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
178 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
179 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
180 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
181 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
182 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
183 * Attempt converting \param value to an integer, in failing cases, |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
184 * return \param defaultsTo. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
185 * @param value String to be converted to integer. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
186 * @param defaultsTo Default to return if conversion failed. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
187 * @return \param value as integer or defaultsto if conversion failed. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
188 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
189 public static int parseInteger(String value, int defaultsTo) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
190 if (value == null || value.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
191 return defaultsTo; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
192 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
193 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
194 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
195 return Integer.parseInt(value); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
196 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
197 catch (NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
198 // do nothing |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
199 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
200 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
201 return defaultsTo; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
202 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
203 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
204 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
205 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
206 * Attempt converting \param value to a double, in failing cases, |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
207 * return \param defaultsTo. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
208 * @param value String to be converted to double. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
209 * @param defaultsTo Default to return if conversion failed. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
210 * @return \param value as integer or defaultsto if conversion failed. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
211 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
212 public static double parseDouble(String value, double defaultsTo) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
213 if (value == null || value.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
214 return defaultsTo; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
215 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
216 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
217 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
218 return Double.parseDouble(value); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
219 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
220 catch (NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
221 // do nothing |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
222 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
223 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
224 return defaultsTo; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
225 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
226 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
227 public boolean parseShowLineLabel() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
228 String show = XMLUtils.xpathString(document, XPATH_SHOW_LINE_LABEL, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
229 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
230 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
231 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
232 public boolean parseShowWidth() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
233 String show = XMLUtils.xpathString(document, XPATH_SHOW_WIDTH, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
234 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
235 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
236 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
237 public boolean parseShowLevel() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
238 String show = XMLUtils.xpathString(document, XPATH_SHOW_LEVEL, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
239 return parseBoolean(show, false); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
240 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
241 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
242 public String parseTextOrientation() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
243 String o = XMLUtils.xpathString(document, XPATH_TEXT_ORIENTATION, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
244 if ("true".equals(o)) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
245 return "horizontal"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
246 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
247 else { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
248 return "vertical"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
249 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
250 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
251 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
252 public boolean parseShowMiddleHeight() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
253 String show = XMLUtils.xpathString(document, XPATH_SHOW_MIDDLE_HEIGHT, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
254 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
255 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
256 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
257 public boolean parseLabelShowBackground() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
258 String show = XMLUtils.xpathString(document, XPATH_LABEL_SHOW_BACKGROUND, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
259 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
260 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
261 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
262 public Font parseTextFont() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
263 String font = XMLUtils.xpathString(document, XPATH_LABEL_FONT_FACE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
264 if (font == null || font.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
265 return null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
266 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
267 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
268 int size = parseTextSize(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
269 int style = parseTextStyle(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
270 Font f = new Font(font, style, size); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
271 return f; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
272 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
273 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
274 public Color parseTextColor() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
275 return parseRGB(getTextColorString()); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
276 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
277 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
278 public String getTextColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
279 String textColor = XMLUtils.xpathString(document, XPATH_LABEL_FONT_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
280 return textColor; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
281 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
282 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
283 public Color parseTextBackground() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
284 String color = getLabelBackgroundColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
285 if (color == null || color.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
286 return Color.WHITE; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
287 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
288 return parseRGB(color); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
289 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
290 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
291 public String getLabelBackgroundColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
292 return XMLUtils.xpathString(document, XPATH_LABEL_BGCOLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
293 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
294 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
295 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
296 public int parseLineWidth() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
297 String size = XMLUtils.xpathString(document, XPATH_LINE_SIZE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
298 if (size == null || size.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
299 return 0; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
300 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
301 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
302 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
303 return Integer.parseInt(size); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
304 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
305 catch (NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
306 logger.warn("Unable to set line size from string: '" + size + "'"); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
307 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
308 return 0; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
309 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
310 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
311 public float [] parseLineStyle() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
312 String dash = XMLUtils.xpathString(document, XPATH_LINE_STYLE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
313 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
314 float[] def = {10}; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
315 if (dash == null || dash.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
316 return def; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
317 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
318 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
319 String[] pattern = dash.split(","); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
320 if(pattern.length == 1) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
321 return def; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
322 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
323 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
324 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
325 float[] dashes = new float[pattern.length]; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
326 for (int i = 0; i < pattern.length; i++) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
327 dashes[i] = Float.parseFloat(pattern[i]); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
328 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
329 return dashes; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
330 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
331 catch(NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
332 logger.warn("Unable to set dash from string: '" + dash + "'"); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
333 return def; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
334 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
335 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
336 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
337 public int parsePointWidth() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
338 String width = XMLUtils.xpathString(document, XPATH_POINT_SIZE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
339 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
340 return parseInteger(width, 3); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
341 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
342 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
343 public Color parsePointColor() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
344 String color = XMLUtils.xpathString(document, XPATH_POINT_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
345 logger.debug("parsePointColor(): color = " + color); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
346 return parseColor(color); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
347 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
348 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
349 public boolean parseShowPoints() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
350 String show = XMLUtils.xpathString(document, XPATH_SHOW_POINTS, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
351 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
352 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
353 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
354 public boolean parseShowLine() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
355 String show = XMLUtils.xpathString(document, XPATH_SHOW_LINE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
356 return parseBoolean(show, true); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
357 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
358 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
359 public int parseTextStyle() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
360 return parseTextStyle(XPATH_LABEL_FONT_STYLE); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
361 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
362 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
363 public int parseTextStyle(String path) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
364 String style = XMLUtils.xpathString(document, path, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
365 if (style == null || style.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
366 return Font.PLAIN; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
367 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
368 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
369 if (style.equals("italic")) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
370 return Font.ITALIC; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
371 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
372 else if (style.equals("bold")) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
373 return Font.BOLD; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
374 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
375 else { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
376 return Font.PLAIN; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
377 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
378 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
379 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
380 public TextStyle parseComplexTextStyle() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
381 return new TextStyle( |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
382 parseTextColor(), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
383 parseTextFont(), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
384 parseTextBackground(), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
385 parseLabelShowBackground(), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
386 !parseTextOrientation().equals("horizontal")); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
387 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
388 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
389 public LineStyle parseComplexLineStyle() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
390 return new LineStyle( |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
391 parseLineColorField(), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
392 Integer.valueOf(parseLineWidth())); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
393 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
394 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
395 public Color parseComplexLineColorField() { |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
396 return null; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
397 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
398 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
399 public boolean parseShowVerticalLine() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
400 String show = XMLUtils.xpathString(document, XPATH_SHOW_VERTICAL_LINE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
401 return parseBoolean(show, true); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
402 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
403 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
404 public boolean parseShowHorizontalLine() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
405 String show = XMLUtils.xpathString(document, XPATH_SHOW_HORIZONTAL_LINE, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
406 return parseBoolean(show, true); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
407 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
408 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
409 public double parseBandWidth() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
410 String bandWidth = XMLUtils.xpathString(document, XPATH_BANDWIDTH, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
411 return parseDouble(bandWidth, 0); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
412 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
413 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
414 public static Color parseColor(String colorString) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
415 if (colorString == null || colorString.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
416 return null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
417 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
418 else if (colorString.indexOf("#") == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
419 return parseHexColor(colorString); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
420 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
421 else if (colorString.indexOf(",") >= 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
422 return parseRGB(colorString); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
423 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
424 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
425 return null; |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
426 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
427 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
428 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
429 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
430 * Parse a string like "#00CC22" and return the corresponding color. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
431 * |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
432 * @param hex The hex color value. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
433 * |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
434 * @return a Color or null, if <i>hex</i> is empty. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
435 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
436 public static Color parseHexColor(String hex) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
437 if (hex == null) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
438 return null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
439 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
440 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
441 return Color.decode(hex); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
442 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
443 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
444 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
445 public boolean parseShowArea() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
446 String show = XMLUtils.xpathString(document, XPATH_SHOW_AREA, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
447 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
448 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
449 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
450 public boolean parseShowPointLabel() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
451 String show = XMLUtils.xpathString(document, XPATH_SHOW_POINT_LABEL, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
452 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
453 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
454 |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
455 public boolean parseShowExtraMark() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
456 String show = XMLUtils.xpathString(document, XPATH_SHOWEXTRAMARK, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
457 return parseBoolean(show, false); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
458 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
459 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
460 public int parseTextSize() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
461 return parseTextSize(XPATH_LABEL_FONT_SIZE); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
462 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
463 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
464 public int parseTextSize(String path) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
465 String size = XMLUtils.xpathString(document, path, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
466 if (size == null || size.length() == 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
467 return 10; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
468 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
469 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
470 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
471 return Integer.parseInt(size); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
472 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
473 catch (NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
474 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
475 return 10; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
476 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
477 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
478 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
479 * Parse a string like "103, 100, 0" and return a corresping color. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
480 * @param rgbtext Color as string representation, e.g. "255,0,20". |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
481 * @return Color, null in case of issues. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
482 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
483 public static Color parseRGB(String rgbtext) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
484 if (rgbtext == null) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
485 return null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
486 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
487 String rgb[] = rgbtext.split(","); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
488 Color c = null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
489 try { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
490 c = new Color( |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
491 Integer.parseInt(rgb[0].trim()), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
492 Integer.parseInt(rgb[1].trim()), |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
493 Integer.parseInt(rgb[2].trim())); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
494 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
495 catch (NumberFormatException nfe) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
496 c = null; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
497 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
498 return c; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
499 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
500 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
501 public String getLineColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
502 return XMLUtils.xpathString(document, XPATH_LINE_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
503 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
504 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
505 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
506 /** Get show border as string. */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
507 public String getShowBorderString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
508 return XMLUtils.xpathString(document, XPATH_SHOW_BORDER, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
509 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
510 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
511 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
512 /** Get fill color as string. */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
513 public String getFillColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
514 return XMLUtils.xpathString(document, XPATH_FILL_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
515 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
516 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
517 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
518 public String getBackgroundColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
519 return XMLUtils.xpathString(document, XPATH_BACKGROUND_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
520 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
521 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
522 public String getSymbol() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
523 return XMLUtils.xpathString(document, XPATH_SYMBOL, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
524 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
525 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
526 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
527 public String getTransparencyString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
528 return XMLUtils.xpathString(document, XPATH_TRANSPARENCY, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
529 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
530 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
531 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
532 public String getAreaTransparencyString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
533 return XMLUtils.xpathString(document, XPATH_AREA_TRANSPARENCY, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
534 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
535 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
536 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
537 public String getShowMinimum() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
538 return XMLUtils.xpathString(document, XPATH_SHOW_MINIMUM, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
539 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
540 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
541 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
542 public String getShowMaximum() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
543 return XMLUtils.xpathString(document, XPATH_SHOW_MAXIMUM, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
544 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
545 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
546 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
547 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
548 * Gets color from color field. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
549 * @param theme the theme document. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
550 * @return color. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
551 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
552 public Color parseFillColorField() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
553 return parseRGB(getFillColorString()); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
554 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
555 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
556 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
557 public boolean parseShowBorder() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
558 return parseBoolean(getShowBorderString(), false); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
559 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
560 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
561 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
562 public int parseTransparency() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
563 return parseInteger(getTransparencyString(), 50); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
564 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
565 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
566 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
567 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
568 * Gets color from color field. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
569 * @param theme the theme document. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
570 * @return color. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
571 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
572 public Color parseLineColorField() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
573 String lineColorStr = getLineColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
574 logger.debug("parseLineColorField: lineColorStr = " + |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
575 (lineColorStr == null ? "null" : lineColorStr)); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
576 return parseColor(lineColorStr); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
577 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
578 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
579 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
580 public Color parseAreaLineColorField() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
581 String lineColorStr = getAreaLineColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
582 logger.debug("parseLineColorField: lineColorStr = " + |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
583 (lineColorStr == null ? "null" : lineColorStr)); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
584 return parseColor(lineColorStr); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
585 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
586 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
587 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
588 private String getAreaLineColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
589 return XMLUtils.xpathString(document, XPATH_AREA_LINE_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
590 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
591 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
592 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
593 public boolean parseShowMinimum() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
594 return parseBoolean(getShowMinimum(), false); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
595 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
596 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
597 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
598 public boolean parseShowMaximum() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
599 return parseBoolean(getShowMaximum(), false); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
600 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
601 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
602 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
603 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
604 * Creates a MapserverStyle from the given XML theme. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
605 * This method uses a start- and endcolor to interpolate a |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
606 * given number of color classes for the MapserverStyle. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
607 * @param theme |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
608 * @return String representation of the MapserverStyle |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
609 */ |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
610 public String createDynamicMapserverStyle( |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
611 float from, float to, float step, CallMeta meta) |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
612 { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
613 MapserverStyle ms = new MapserverStyle(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
614 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
615 String strStartColor = XMLUtils.xpathString(document, XPATH_WSPLGEN_STARTCOLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
616 Color startColor = strStartColor != null ? parseColor(strStartColor) : new Color(178, 201, 215); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
617 String strEndColor = XMLUtils.xpathString(document, XPATH_WSPLGEN_ENDCOLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
618 Color endColor = strEndColor != null? parseColor(strEndColor) : new Color(2, 27, 42); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
619 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
620 to = to != 0 ? to : 9999; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
621 step = step != 0 ? step : to; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
622 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
623 int numClasses = (int)((to - from) / step); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
624 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
625 float rd = (endColor.getRed() - startColor.getRed()) / (float)numClasses; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
626 float gd = (endColor.getGreen() - startColor.getGreen()) / (float)numClasses; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
627 float bd = (endColor.getBlue() - startColor.getBlue()) / (float)numClasses; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
628 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
629 if (numClasses > 1) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
630 // Desktop Flys always added a last "and larger class" |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
631 numClasses += 1; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
632 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
633 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
634 for (int n = 0; n < numClasses; n++) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
635 StringBuilder newColor = new StringBuilder(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
636 newColor.append(startColor.getRed() + Math.round(n * rd)); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
637 newColor.append(' '); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
638 newColor.append(startColor.getGreen() + Math.round(n * gd)); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
639 newColor.append(' '); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
640 newColor.append(startColor.getBlue() + Math.round(n * bd)); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
641 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
642 String expr = createWSPLGENClassExpression(from + n * step, step, n + 1, numClasses); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
643 String name = createWSPLGENClassName(from + n * step, step, n + 1, numClasses, meta); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
644 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
645 Clazz c = new Clazz(name); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
646 Style s = new Style(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
647 s.setColor(newColor.toString()); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
648 s.setSize(5); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
649 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
650 c.addItem(new Expression("(" + expr + ")")); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
651 c.addItem(s); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
652 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
653 ms.addClazz(c); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
654 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
655 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
656 return ms.toString(); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
657 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
658 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
659 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
660 protected static String createWSPLGENClassExpression(float val, float step, int idx, int maxIdx) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
661 if (idx < maxIdx) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
662 return "[DIFF] >= " + val + " AND [DIFF] < " + (val + step); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
663 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
664 else { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
665 return "[DIFF] >= " + val; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
666 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
667 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
668 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
669 /** |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
670 * Creates a class name for the mapfile style that visualizes a floodmap. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
671 * The class names are used in the map's legend. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
672 * |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
673 * @param val Current isobath value. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
674 * @param step Difference between to class values. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
675 * @param idx Current class index that is being processed. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
676 * @param maxIdx Highest class index. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
677 * @param meta Caller meta object used to determine locale. |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
678 * @return |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
679 */ |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
680 protected static String createWSPLGENClassName(float val, float step, int idx, int maxIdx, CallMeta meta) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
681 assert meta != null : "CallMeta instance is null"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
682 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
683 if (idx < maxIdx) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
684 return Resources.getMsg(meta, MSG_ISOBATH_CLASS, |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
685 new Object[] {val, val + step}); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
686 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
687 else { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
688 return Resources.getMsg(meta, MSG_ISOBATH_LASTCLASS, |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
689 new Object[] {val}); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
690 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
691 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
692 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
693 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
694 public String createMapserverStyle() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
695 String symbol = getSymbol(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
696 String backcolor = getLabelBackgroundColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
697 String linecolor = getLineColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
698 if (linecolor == null || "".equals(linecolor)) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
699 logger.warn("createMapserverStyle: linecolor String is empty"); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
700 linecolor = "0,128,255"; |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
701 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
702 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
703 int linewidth = parseLineWidth(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
704 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
705 MapserverStyle ms = new MapserverStyle(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
706 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
707 Clazz c = new Clazz(" "); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
708 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
709 Style s = new Style(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
710 s.setOutlineColor(linecolor.replace(",", " ")); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
711 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
712 if (backcolor != null && backcolor.length() > 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
713 s.setColor(backcolor.replace(",", " ")); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
714 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
715 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
716 s.setSize(linewidth); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
717 s.setSymbol(symbol); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
718 c.addItem(s); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
719 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
720 String textcolor = getTextColorString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
721 int textsize = parseTextSize(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
722 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
723 if (textcolor != null && textcolor.length() > 0 && textsize > 0) { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
724 Label l = new Label(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
725 l.setColor(textcolor.replace(",", " ")); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
726 l.setSize(textsize); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
727 c.addItem(l); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
728 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
729 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
730 ms.addClazz(c); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
731 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
732 return ms.toString(); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
733 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
734 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
735 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
736 public String getAreaBackgroundColorString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
737 return XMLUtils.xpathString(document, XPATH_AREA_BACKGROUND_COLOR, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
738 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
739 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
740 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
741 public Color parseAreaBackgroundColor() { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
742 return parseColor(getAreaBackgroundColorString()); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
743 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
744 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
745 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
746 public int parseAreaTransparency() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
747 return parseInteger(getAreaTransparencyString(), 50); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
748 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
749 |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
750 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
751 public boolean parseAreaShowBorder() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
752 return parseBoolean(getAreaShowBorderString(), false); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
753 } |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
754 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
755 |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
756 private String getAreaShowBorderString() { |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
757 return XMLUtils.xpathString(document, XPATH_AREA_SHOW_BORDER, null); |
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
758 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
759 } |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
760 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |