Mercurial > dive4elements > river
changeset 3205:bbb488b145ce
Set text orientation to horizontal for points in Fixation W/Q curve
flys-artifacts/trunk@4822 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 28 Jun 2012 13:52:12 +0000 |
parents | 19ce06eb56c3 |
children | e11dbf8baf69 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java |
diffstat | 7 files changed, 49 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jun 28 13:52:12 2012 +0000 @@ -1,3 +1,15 @@ +2012-06-28 Christian Lins <christian.lins@intevation.de> + + * doc/conf/themes.xml, + src/main/java/de/intevation/flys/utils/ThemeUtil.java, + src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java, + src/main/java/de/intevation/flys/exports/XYChartGenerator.java, + src/main/java/de/intevation/flys/themes/ThemeAccess.java: + Set text orientation to horizontal for points in Fixation W/Q curve. + + * src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java: + Fix overlapping indices of facets. + 2012-06-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java:
--- a/flys-artifacts/doc/conf/themes.xml Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/doc/conf/themes.xml Thu Jun 28 13:52:12 2012 +0000 @@ -930,7 +930,7 @@ <field name="linecolor" type="Color" default="#000000"/> </fields> </theme> - + <theme name="FixingSectorAverageWQ0"> <inherits> <inherit from="ColorPoints"/> @@ -940,6 +940,7 @@ <field name="showlinelabel" type="boolean" display="Beschriftung anzeigen" default="false" hints="h"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 128, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ1"> @@ -951,6 +952,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ2"> @@ -962,6 +964,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ3"> @@ -973,6 +976,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -985,6 +989,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 255, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -997,6 +1002,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 80, 160"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -1006,6 +1012,7 @@ </inherits> <fields> <field name="showlines" type="boolean" default="false"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2145,6 +2152,7 @@ <field name="showlinelabel" type="boolean" display="Beschriftung anzeigen" default="false" hints="h"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 128, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ1"> @@ -2156,6 +2164,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ2"> @@ -2167,6 +2176,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ3"> @@ -2178,6 +2188,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2190,6 +2201,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 255, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2202,6 +2214,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 80, 160"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2217,6 +2230,7 @@ </inherits> <fields> <field name="showlines" value="false"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2542,6 +2556,7 @@ <field name="showlinelabel" type="boolean" display="Beschriftung anzeigen" default="false" hints="h"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 128, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ1"> @@ -2553,6 +2568,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ2"> @@ -2564,6 +2580,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 255"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> <theme name="FixingSectorAverageWQ3"> @@ -2575,6 +2592,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="255, 0, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2587,6 +2605,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 255, 0"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2599,6 +2618,7 @@ <field name="showlines" type="boolean" default="false"/> <field name="pointsize" type="int" display="Punktdicke" default="3"/> <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 80, 160"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme> @@ -2608,6 +2628,7 @@ </inherits> <fields> <field name="showlines" value="false"/> + <field name="textorientation" type="boolean" display="Textausrichtung" default="true"/> </fields> </theme>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java Thu Jun 28 13:52:12 2012 +0000 @@ -165,7 +165,8 @@ int facetNdx = i << 2; facetNdx = facetNdx | j; - if (facetNdx > maxId) maxId = facetNdx; + if (facetNdx > maxId) + maxId = facetNdx; facets.add( new FixAvSectorFacet(facetNdx, @@ -204,7 +205,7 @@ eventDesc)); } - IdGenerator idg = new IdGenerator(maxId); + IdGenerator idg = new IdGenerator(maxId + 1); String i18n_ref = Resources.getMsg(context.getMeta(), I18N_REFERENCEPERIOD,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Thu Jun 28 13:52:12 2012 +0000 @@ -904,7 +904,7 @@ textAnnotation = new CollisionFreeXYTextAnnotation( annotation.getText(), annotation.getPos(), area.ofGround(TEXT_OFF)); // OPTIMIZE externalize the calculation involving PI. - textAnnotation.setRotationAngle(270f*Math.PI/180f); + //textAnnotation.setRotationAngle(270f*Math.PI/180f); lineAnnotation = createGroundStickAnnotation( area, annotation.getPos(), lineStyle); textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Thu Jun 28 13:52:12 2012 +0000 @@ -179,13 +179,16 @@ dateFormat.format(qw.getDate()), qw.getQ(), qw.getW()); + //anno.setRotationAngle(0); textAnnos.add(anno); } FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, doc); flysAnno.setTextAnnotations(textAnnos); addAxisSeries(series, 0, visible); - addVisibleAnnotations(flysAnno); + if(visible) { + addVisibleAnnotations(flysAnno); + } } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java Thu Jun 28 13:52:12 2012 +0000 @@ -75,9 +75,6 @@ public String parseTextOrientation() { if (textOrientation == null) { textOrientation = ThemeUtil.parseTextOrientation(theme); - if (textOrientation == null) { - textOrientation = "horizontal"; - } } return textOrientation; } @@ -138,8 +135,11 @@ public TextStyle parseTextStyle() { - return new TextStyle(parseTextColor(), parseTextFont(), - parseTextBackground(), parseShowTextBackground(), + return new TextStyle( + parseTextColor(), + parseTextFont(), + parseTextBackground(), + parseShowTextBackground(), !parseTextOrientation().equals("horizontal")); } @@ -171,7 +171,7 @@ ta.setRotationAngle(270f*Math.PI/180f); } else { - ta.setRotationAngle(0f*Math.PI/180f); + ta.setRotationAngle(0); } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java Thu Jun 28 13:07:27 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java Thu Jun 28 13:52:12 2012 +0000 @@ -422,10 +422,7 @@ */ public static String parseTextOrientation(Document theme) { String o = XMLUtils.xpathString(theme, XPATH_TEXT_ORIENTATION, null); - if (o == null || o.length() == 0) { - return "vertical"; - } - if(o.equals("true")) { + if ("true".equals(o)) { return "horizontal"; } else {