Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java @ 3814:8083f6384023
merged flys-artifacts/pre2.6-2012-01-04
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:56 +0200 |
parents | 8e6615ad60b8 |
children | 2336927cb096 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java Fri Sep 28 12:14:56 2012 +0200 @@ -0,0 +1,96 @@ +package de.intevation.flys.utils; + +import java.awt.Color; +import java.awt.Font; + +import org.w3c.dom.Document; + + +public class ThemeAccess +{ + protected Document theme; + + protected Integer lineWidth; + + protected Color lineColor; + protected Color textColor; + protected Font font; + protected String textOrientation; + protected Color textBackground; + protected Boolean showTextBackground; + + public ThemeAccess(Document theme) { + this.theme = theme; + } + + public int parseLineWidth() { + if (lineWidth == null) { + lineWidth = ThemeUtil.parseLineWidth(theme); + } + return lineWidth; + } + + public Color parseLineColorField() { + if (lineColor == null) { + lineColor = ThemeUtil.parseLineColorField(theme); + if (lineColor == null) { + lineColor = Color.BLACK; + } + } + return lineColor; + } + + public Color parseTextColor() { + if (textColor == null) { + textColor = ThemeUtil.parseTextColor(theme); + if (textColor == null) { + textColor = Color.BLACK; + } + } + return textColor; + } + + public Font parseTextFont() { + if (font == null) { + font = ThemeUtil.parseTextFont(theme); + if (font == null) { + font = new Font("Arial", Font.BOLD, 10); + } + } + return font; + } + + public String parseTextOrientation() { + if (textOrientation == null) { + textOrientation = ThemeUtil.parseTextOrientation(theme); + if (textOrientation == null) { + textOrientation = "horizontal"; + } + } + return textOrientation; + } + + + public Color parseTextBackground() { + if (textBackground == null) { + textBackground = ThemeUtil.parseTextBackground(theme); + if (textBackground == null) { + textBackground = Color.WHITE; + } + } + return textBackground; + } + + public boolean parseShowTextBackground() { + if (showTextBackground == null) { + showTextBackground = ThemeUtil.parseShowTextBackground(theme); + } + return showTextBackground; + } + + /** + more of this + */ + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :