comparison artifacts/src/main/java/org/dive4elements/river/themes/TextStyle.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-artifacts/src/main/java/org/dive4elements/river/themes/TextStyle.java@bd047b71ab37
children 4897a58c8746
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.themes;
2
3 import org.dive4elements.river.jfree.StableXYDifferenceRenderer;
4
5 import java.awt.Color;
6 import java.awt.Font;
7
8 import org.apache.log4j.Logger;
9 import org.jfree.chart.annotations.XYTextAnnotation;
10
11 public class TextStyle {
12 @SuppressWarnings("unused")
13 private static Logger log = Logger.getLogger(TextStyle.class);
14
15 protected Color textColor;
16 protected Font font;
17 protected Color bgColor;
18 protected boolean showBg;
19 protected boolean isVertical;
20
21 public TextStyle(Color fgColor, Font font, Color bgColor,
22 boolean showBg, boolean isVertical
23 ) {
24 this.textColor = fgColor;
25 this.font = font;
26 this.bgColor = bgColor;
27 this.showBg = showBg;
28 this.isVertical = isVertical;
29 }
30
31 public void apply(XYTextAnnotation ta) {
32 ta.setPaint(textColor);
33 ta.setFont(font);
34 if (this.showBg) {
35 ta.setBackgroundPaint(bgColor);
36 }
37 if (this.isVertical) {
38 ta.setRotationAngle(270f*Math.PI/180f);
39 }
40 else {
41 ta.setRotationAngle(0);
42 }
43 }
44
45 public void apply(StableXYDifferenceRenderer renderer) {
46 renderer.setLabelColor(textColor);
47 renderer.setLabelFont(font);
48 if (this.showBg) {
49 renderer.setLabelBGColor(bgColor);
50 }
51 }
52 }

http://dive4elements.wald.intevation.org