Package generic.theme
Class FontModifier
java.lang.Object
generic.theme.FontModifier
Class that can transform one font into another. For example if want a font that is the same
 basic font as some other font, but is just a different size,style, or family, you use a
 FontModifier
- 
Constructor SummaryConstructorsConstructorDescriptionFontModifier(String family, Integer style, Integer size) Creates a new FontModifier that can change a given font by one or more font properties.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddFamilyModifier(String newFamily) Sets the family for modifying a fontvoidaddSizeModfier(int newSize) Sets the font size modifiervoidaddStyleModifier(int newStyle) Sets the font style modifier.Returns a string that can be parsed by theparse(String)method of this classReturns a modified font for the given font.static FontModifierParses the given string as one or more font modifierstoString()
- 
Constructor Details- 
FontModifierCreates a new FontModifier that can change a given font by one or more font properties.- Parameters:
- family- if non-null, modifies a font to use this family
- style- if non-null, modifies a font to use this style
- size- if non-null, modifies a font to be this size
 
 
- 
- 
Method Details- 
addFamilyModifierSets the family for modifying a font- Parameters:
- newFamily- the font family to use when modifying fonts
 
- 
addSizeModfierpublic void addSizeModfier(int newSize) Sets the font size modifier- Parameters:
- newSize- the size to use when modifying fonts
 
- 
addStyleModifierpublic void addStyleModifier(int newStyle) Sets the font style modifier. This can be called multiple times to bold and italicize.- Parameters:
- newStyle- the style to use for the font.
 
- 
modifyReturns a modified font for the given font.- Parameters:
- font- the font to be modified
- Returns:
- a new modified font
 
- 
getSerializationStringReturns a string that can be parsed by theparse(String)method of this class- Returns:
- a string that can be parsed by the parse(String)method of this class
 
- 
toString
- 
parseParses the given string as one or more font modifiers- Parameters:
- value- the string to parse as modifiers
- Returns:
- a FontModifier as specified by the given string
- Throws:
- ParseException- if The value can't be parsed
 
 
-