Mercurial > dive4elements > river
changeset 3781:8e713e9bb4d7
Defined colors for bed quality themes.
flys-artifacts/trunk@5488 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 17 Sep 2012 09:40:00 +0000 |
parents | 7fa38f8bcd8d |
children | 5d0419882382 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/default-themes.xml flys-artifacts/doc/conf/second-themes.xml flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java |
diffstat | 6 files changed, 102 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Sep 17 09:40:00 2012 +0000 @@ -1,3 +1,13 @@ +2012-09-17 Ingo Weinzierl <ingo@intevation.de> + + * doc/conf/second-themes.xml, + doc/conf/default-themes.xml: Defined initial colors. + + * src/main/java/de/intevation/flys/exports/OutputHelper.java, + src/main/java/de/intevation/flys/themes/ThemeFactory.java, + src/main/java/de/intevation/flys/themes/ThemeMapping.java: Added more + debug output to understand why theme mappings don't match to facets. + 2012-09-17 Raimund Renkert <raimund.renkert@intevation.de> * src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java:
--- a/flys-artifacts/doc/conf/default-themes.xml Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/doc/conf/default-themes.xml Mon Sep 17 09:40:00 2012 +0000 @@ -1068,6 +1068,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="0, 0, 0" /> + </fields> </theme> <theme name="PorositySubLayer"> @@ -1075,6 +1079,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="0, 0, 0" /> + </fields> </theme> <theme name="DensityTopLayer"> @@ -1082,6 +1090,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#996366" /> + </fields> </theme> <theme name="DensitySubLayer"> @@ -1089,6 +1101,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#996366" /> + </fields> </theme> <theme name="BedDiameterTopLayer"> @@ -1096,6 +1112,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#FF0000" /> + </fields> </theme> <theme name="BedDiameterSubLayer"> @@ -1103,6 +1123,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#FF0000" /> + </fields> </theme> <theme name="BedLoadDiameter"> @@ -1110,6 +1134,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#00FF00" /> + </fields> </theme>
--- a/flys-artifacts/doc/conf/second-themes.xml Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/doc/conf/second-themes.xml Mon Sep 17 09:40:00 2012 +0000 @@ -1069,6 +1069,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="100, 100, 100" /> + </fields> </theme> <theme name="PorositySubLayer"> @@ -1076,6 +1080,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="100, 100, 100" /> + </fields> </theme> <theme name="DensityTopLayer"> @@ -1083,6 +1091,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#990000" /> + </fields> </theme> <theme name="DensitySubLayer"> @@ -1090,6 +1102,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#990000" /> + </fields> </theme> <theme name="BedDiameterTopLayer"> @@ -1097,6 +1113,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#FF4444" /> + </fields> </theme> <theme name="BedDiameterSubLayer"> @@ -1104,6 +1124,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#FF4444" /> + </fields> </theme> <theme name="BedLoadDiameter"> @@ -1111,6 +1135,10 @@ <inherit from="HiddenColorLines" /> <inherit from="MinMaxPoints" /> </inherits> + <fields> + <field name="linecolor" type="Color" display="Linienfarbe" + default="#33FF11" /> + </fields> </theme>
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Mon Sep 17 09:40:00 2012 +0000 @@ -457,11 +457,16 @@ pattern, outName, "default"); + if (t != null) { + log.debug("found theme for facet '" + facet + "'"); t.setFacet(facet); t.setIndex(index); } + else { + log.warn("unable to find theme for facet '" + facet + "'"); + } return t; }
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java Mon Sep 17 09:40:00 2012 +0000 @@ -102,6 +102,7 @@ } if (group == null) { + logger.warn("No theme group found: '" + groupName + "'"); return null; } @@ -128,7 +129,10 @@ && tm.masterAttrMatches(artifact) && tm.outputMatches(output)) { - return t.get(tm.getTo()); + String target = tm.getTo(); + + logger.debug("Found theme '" + target + "'"); + return t.get(target); } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java Mon Sep 17 09:40:00 2012 +0000 @@ -88,7 +88,16 @@ return true; } Matcher m = pattern.matcher(text); - return m.matches(); + + if (m.matches()) { + logger.debug("Pattern matches: " + text); + return true; + } + else { + logger.debug( + "Pattern '"+ text + "' does not match: " + this.patternStr); + return false; + } } @@ -116,7 +125,14 @@ } // Test. - return artifact.getDataAsString(parts[0]).equals(parts[1]); + if (artifact.getDataAsString(parts[0]).equals(parts[1])) { + logger.debug("Matches master Attribute."); + return true; + } + else { + logger.debug("Does not match master Attribute."); + return false; + } } @@ -129,7 +145,14 @@ return true; } - return this.output.equals(output); + if (this.output.equals(output)) { + logger.debug("Output matches this mapping: " + output); + return true; + } + else { + logger.debug("Output '"+ output +"' does not match: "+ this.output); + return false; + } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :