Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java @ 3464:0b9b2a0c4e64
Point labels can have a background color now.
flys-artifacts/trunk@5132 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 26 Jul 2012 10:02:07 +0000 |
parents | b0ba96bbf01d |
children |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java Thu Jul 26 09:56:50 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java Thu Jul 26 10:02:07 2012 +0000 @@ -1,17 +1,15 @@ package de.intevation.flys.jfree; +import de.intevation.flys.utils.ThemeUtil; + import java.awt.BasicStroke; import java.awt.Color; import java.awt.geom.Ellipse2D; import org.apache.log4j.Logger; - +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.w3c.dom.Document; -import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; - -import de.intevation.flys.utils.ThemeUtil; - /** * Utility to apply theme-settings to a renderer. @@ -36,6 +34,7 @@ * Applies line color, size and type attributes to renderer, also * whether to draw lines and/or points. */ + @Override public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx){ this.renderer = r; applyLineColor(r, idx); @@ -47,12 +46,22 @@ applyPointColor(r, idx); applyShowMinimum(r, idx); applyShowMaximum(r, idx); + + // Line label styles applyShowLineLabel(r, idx); + applyShowLineLabelBG(r, idx); applyLineLabelFont(r, idx); applyLineLabelColor(r, idx); - applyShowLineLabelBG(r, idx); applyLineLabelBGColor(r, idx); + // Point label styles + // TODO: Currently point label are annotations and are not drawn this way + /* + applyShowPointLabelBG(r, idx); + applyLinePointFont(r, idx); + applyLinePointColor(r, idx); + applyLinePointBGColor(r, idx);*/ + return r; } @@ -88,7 +97,7 @@ if (!(r instanceof EnhancedLineAndShapeRenderer)) { return; } - boolean showLabelLine = ThemeUtil.parseShowLineLabelBG(theme); + boolean showLabelLine = ThemeUtil.parseLabelShowBackground(theme); ((EnhancedLineAndShapeRenderer)r).setShowLineLabelBG(idx, showLabelLine); } @@ -98,7 +107,8 @@ if (!(r instanceof EnhancedLineAndShapeRenderer)) { return; } - ((EnhancedLineAndShapeRenderer)r).setLineLabelFont(ThemeUtil.parseLineLabelFont(theme), idx); + ((EnhancedLineAndShapeRenderer)r).setLineLabelFont( + ThemeUtil.parseTextFont(theme), idx); } /** Tell the renderer which color to use for @@ -107,7 +117,8 @@ if (!(r instanceof EnhancedLineAndShapeRenderer)) { return; } - ((EnhancedLineAndShapeRenderer)r).setLineLabelTextColor(idx, ThemeUtil.parseLineLabelTextColor(theme)); + ((EnhancedLineAndShapeRenderer)r).setLineLabelTextColor( + idx, ThemeUtil.parseTextColor(theme)); } /** Tell the renderer which color to use for bg of @@ -117,7 +128,7 @@ return; } ((EnhancedLineAndShapeRenderer)r).setLineLabelBGColor(idx, - ThemeUtil.parseLineLabelBGColor(theme)); + ThemeUtil.parseTextBackground(theme)); } /** Set stroke of series. */ @@ -210,6 +221,7 @@ } + @Override public XYLineAndShapeRenderer getRenderer() { return this.renderer; }