1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.imaging.operations.text; |
35 |
|
|
36 |
|
import java.awt.Color; |
37 |
|
import java.awt.Font; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
42 |
|
public class TextStyle { |
43 |
|
public static final double SHEARING_DIV_FACTOR = 20D; |
44 |
|
public static final double CHARSPACING_DIV_FACTOR = 10D; |
45 |
|
|
46 |
|
private String fontName; |
47 |
|
private int fontStyle = Font.PLAIN; |
48 |
|
private int fontSize; |
49 |
|
private Color color; |
50 |
|
private Color backgroundColor; |
51 |
|
private double charSpacing; |
52 |
|
private int shearingValue; |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public double calculateShearingValue() {... |
55 |
0 |
return (-1.0D * (new Double(shearingValue)).doubleValue()) / SHEARING_DIV_FACTOR; |
56 |
|
} |
57 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
0 |
public float calculateCharSpacing() {... |
59 |
0 |
return (float) (getCharSpacing() / TextStyle.CHARSPACING_DIV_FACTOR); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
65 |
|
public Font getFont() {... |
66 |
|
return new Font(fontName, fontStyle, fontSize); |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
71 |
|
public String getFontName() {... |
72 |
|
return fontName; |
73 |
|
} |
74 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
75 |
|
public void setFontName(String fontName) {... |
76 |
|
this.fontName = fontName; |
77 |
|
} |
78 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
79 |
|
public int getFontStyle() {... |
80 |
|
return fontStyle; |
81 |
|
} |
82 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
83 |
|
public void setFontStyle(int fontStyle) {... |
84 |
|
this.fontStyle = fontStyle; |
85 |
|
} |
86 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
87 |
|
public int getFontSize() {... |
88 |
|
return fontSize; |
89 |
|
} |
90 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
91 |
|
public void setFontSize(int fontSize) {... |
92 |
|
this.fontSize = fontSize; |
93 |
|
} |
94 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
95 |
|
public Color getColor() {... |
96 |
|
return color; |
97 |
|
} |
98 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
99 |
|
public void setColor(Color color) {... |
100 |
|
this.color = color; |
101 |
|
} |
102 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
103 |
|
public Color getBackgroundColor() {... |
104 |
|
return backgroundColor; |
105 |
|
} |
106 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
107 |
|
public void setBackgroundColor(Color backgroundColor) {... |
108 |
|
this.backgroundColor = backgroundColor; |
109 |
|
} |
110 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
111 |
|
public double getCharSpacing() {... |
112 |
|
return charSpacing; |
113 |
|
} |
114 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
115 |
|
public void setCharSpacing(double charSpacing) {... |
116 |
|
this.charSpacing = charSpacing; |
117 |
|
} |
118 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
119 |
|
public int getShearingValue() {... |
120 |
|
return shearingValue; |
121 |
|
} |
122 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
123 |
|
public void setShearingValue(int shearingValue) {... |
124 |
|
this.shearingValue = shearingValue; |
125 |
|
} |
126 |
|
} |