Mercurial > dive4elements > river
changeset 6911:1f1acbe5f243
Artifacts: Make TextStyle Make more robust.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 23 Aug 2013 14:17:35 +0200 |
parents | a58a1a520948 |
children | 058b8dc4e8b6 |
files | artifacts/src/main/java/org/dive4elements/river/themes/TextStyle.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/themes/TextStyle.java Fri Aug 23 12:57:21 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/themes/TextStyle.java Fri Aug 23 14:17:35 2013 +0200 @@ -37,12 +37,16 @@ } public void apply(XYTextAnnotation ta) { - ta.setPaint(textColor); - ta.setFont(font); - if (this.showBg) { + if (textColor != null) { + ta.setPaint(textColor); + } + if (font != null) { + ta.setFont(font); + } + if (showBg) { ta.setBackgroundPaint(bgColor); } - if (this.isVertical) { + if (isVertical) { ta.setRotationAngle(270f*Math.PI/180f); } else { @@ -57,4 +61,4 @@ renderer.setLabelBGColor(bgColor); } } -} \ No newline at end of file +}