|
@@ -84,8 +84,7 @@ |
84 |
84 |
|
private String mWeight = null; |
85 |
85 |
|
private String mDecoration = null; |
86 |
86 |
|
|
87 |
|
- |
private UiFont( String pFamily, String pColor, String pSize, String pStyle, String pWeight, |
88 |
|
- |
String pDecoration ) |
|
87 |
+ |
private UiFont( String pFamily, String pColor, String pSize, String pStyle, String pWeight, String pDecoration ) |
89 |
88 |
|
{ |
90 |
89 |
|
mFamily = pFamily; |
91 |
90 |
|
mColor = pColor; |
|
@@ -113,8 +112,7 @@ |
113 |
112 |
|
public UiFont family( String pFamily ) |
114 |
113 |
|
{ |
115 |
114 |
|
pFamily = parseFamily( pFamily ); |
116 |
|
- |
return UtilsCommon.areNonArraysEqual( mFamily, pFamily ) ? this : |
117 |
|
- |
new UiFont( pFamily, mColor, mSize, mStyle, mWeight, mDecoration ); |
|
115 |
+ |
return UtilsCommon.areNonArraysEqual( mFamily, pFamily ) ? this : new UiFont( pFamily, mColor, mSize, mStyle, mWeight, mDecoration ); |
118 |
116 |
|
} |
119 |
117 |
|
|
120 |
118 |
|
private String parseFamily( String pStr ) |
|
@@ -133,8 +131,7 @@ |
133 |
131 |
|
{ |
134 |
132 |
|
if ( pStr.indexOf( c ) != -1 ) |
135 |
133 |
|
{ |
136 |
|
- |
throw new IllegalArgumentException( |
137 |
|
- |
"Font Family may not have a '" + c + "' character in it: " + pStr ); |
|
134 |
+ |
throw new IllegalArgumentException( "Font Family may not have a '" + c + "' character in it: " + pStr ); |
138 |
135 |
|
} |
139 |
136 |
|
} |
140 |
137 |
|
|
|
@@ -147,8 +144,7 @@ |
147 |
144 |
|
} |
148 |
145 |
|
if ( (zQuotes & 1) != 0 ) // Odd |
149 |
146 |
|
{ |
150 |
|
- |
throw new IllegalArgumentException( |
151 |
|
- |
"Font Family has single quotes (') that are NOT paired: " + pStr ); |
|
147 |
+ |
throw new IllegalArgumentException( "Font Family has single quotes (') that are NOT paired: " + pStr ); |
152 |
148 |
|
} |
153 |
149 |
|
} |
154 |
150 |
|
|
|
@@ -160,8 +156,7 @@ |
160 |
156 |
|
public UiFont color( String pColor ) |
161 |
157 |
|
{ |
162 |
158 |
|
pColor = parseColor( pColor ); |
163 |
|
- |
return UtilsCommon.areNonArraysEqual( mColor, pColor ) ? this : |
164 |
|
- |
new UiFont( mFamily, pColor, mSize, mStyle, mWeight, mDecoration ); |
|
159 |
+ |
return UtilsCommon.areNonArraysEqual( mColor, pColor ) ? this : new UiFont( mFamily, pColor, mSize, mStyle, mWeight, mDecoration ); |
165 |
160 |
|
} |
166 |
161 |
|
|
167 |
162 |
|
private String parseColor( String pStr ) |
|
@@ -174,9 +169,7 @@ |
174 |
169 |
|
} |
175 |
170 |
|
if ( !isAllAlpha( pStr ) ) |
176 |
171 |
|
{ |
177 |
|
- |
throw new IllegalArgumentException( |
178 |
|
- |
"A Color must either be a 'code' (eg #FF0000) or a color name, but provided: " + |
179 |
|
- |
pStr ); |
|
172 |
+ |
throw new IllegalArgumentException( "A Color must either be a 'code' (eg #FF0000) or a color name, but provided: " + pStr ); |
180 |
173 |
|
} |
181 |
174 |
|
} |
182 |
175 |
|
return pStr; |
|
@@ -207,8 +200,7 @@ |
207 |
200 |
|
{ |
208 |
201 |
|
return pStr; |
209 |
202 |
|
} |
210 |
|
- |
throw new IllegalArgumentException( |
211 |
|
- |
"A Color 'code' must have 6 hex digits eg #FF0000, but provided: #" + pStr ); |
|
203 |
+ |
throw new IllegalArgumentException( "A Color 'code' must have 6 hex digits eg #FF0000, but provided: #" + pStr ); |
212 |
204 |
|
} |
213 |
205 |
|
|
214 |
206 |
|
private boolean isHex( char pChar ) |
|
@@ -224,8 +216,7 @@ |
224 |
216 |
|
public UiFont size( String pSize ) |
225 |
217 |
|
{ |
226 |
218 |
|
pSize = parseSize( pSize ); |
227 |
|
- |
return UtilsCommon.areNonArraysEqual( mSize, pSize ) ? this : |
228 |
|
- |
new UiFont( mFamily, mColor, pSize, mStyle, mWeight, mDecoration ); |
|
219 |
+ |
return UtilsCommon.areNonArraysEqual( mSize, pSize ) ? this : new UiFont( mFamily, mColor, pSize, mStyle, mWeight, mDecoration ); |
229 |
220 |
|
} |
230 |
221 |
|
|
231 |
222 |
|
private String parseSize( String pStr ) |
|
@@ -253,8 +244,7 @@ |
253 |
244 |
|
public UiFont style( String pStyle ) |
254 |
245 |
|
{ |
255 |
246 |
|
pStyle = parseStyle( pStyle ); |
256 |
|
- |
return UtilsCommon.areNonArraysEqual( mStyle, pStyle ) ? this : |
257 |
|
- |
new UiFont( mFamily, mColor, mSize, pStyle, mWeight, mDecoration ); |
|
247 |
+ |
return UtilsCommon.areNonArraysEqual( mStyle, pStyle ) ? this : new UiFont( mFamily, mColor, mSize, pStyle, mWeight, mDecoration ); |
258 |
248 |
|
} |
259 |
249 |
|
|
260 |
250 |
|
private String parseStyle( String pStr ) |
|
@@ -325,8 +315,7 @@ |
325 |
315 |
|
public UiFont weight( String pWeight ) |
326 |
316 |
|
{ |
327 |
317 |
|
pWeight = parseWeight( pWeight ); |
328 |
|
- |
return UtilsCommon.areNonArraysEqual( mWeight, pWeight ) ? this : |
329 |
|
- |
new UiFont( mFamily, mColor, mSize, mStyle, pWeight, mDecoration ); |
|
318 |
+ |
return UtilsCommon.areNonArraysEqual( mWeight, pWeight ) ? this : new UiFont( mFamily, mColor, mSize, mStyle, pWeight, mDecoration ); |
330 |
319 |
|
} |
331 |
320 |
|
|
332 |
321 |
|
private String parseWeight( String pStr ) |
|
@@ -352,8 +341,7 @@ |
352 |
341 |
|
public UiFont decoration( String pDecoration ) |
353 |
342 |
|
{ |
354 |
343 |
|
pDecoration = parseDecoration( pDecoration ); |
355 |
|
- |
return UtilsCommon.areNonArraysEqual( mDecoration, pDecoration ) ? this : |
356 |
|
- |
new UiFont( mFamily, mColor, mSize, mStyle, mWeight, pDecoration ); |
|
344 |
+ |
return UtilsCommon.areNonArraysEqual( mDecoration, pDecoration ) ? this : new UiFont( mFamily, mColor, mSize, mStyle, mWeight, pDecoration ); |
357 |
345 |
|
} |
358 |
346 |
|
|
359 |
347 |
|
private String parseDecoration( String pStr ) |
|
@@ -464,7 +452,6 @@ |
464 |
452 |
|
return option; |
465 |
453 |
|
} |
466 |
454 |
|
} |
467 |
|
- |
throw new IllegalArgumentException( "Invalid " + pWhat + " '', only accepting: " + pXtraOption + |
468 |
|
- |
UtilsCommon.optionsToString( pOptions ) ); |
|
455 |
+ |
throw new IllegalArgumentException( "Invalid " + pWhat + " '', only accepting: " + pXtraOption + UtilsCommon.optionsToString( pOptions ) ); |
469 |
456 |
|
} |
470 |
457 |
|
} |