Package com.iizix.prop.font
Class FontConsumed
java.lang.Object
com.iizix.prop.font.FontConsumed
Class representing a consumed font. This class is used e.g. to collect information about components (including its children) in order to gather the required fonts.
- Author:
- Christopher Mindus
Field Summary
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionstatic void
collectConsumedFonts
(PropCnr comp, Set<FontConsumed> fonts) Collects all fonts in a component and its children recursively.boolean
Checks if the consumed fonts are equal.static Set<FontConsumed>
getConsumedFonts
(PropCnr comp) Collects all fonts in a component and its children recursively.getStyle()
Gets the style.Gets the weight.int
hashCode()
The hash code.
Field Details
family
The font family. The font family may consist of a list of fonts that is comma separated.
Constructor Details
FontConsumed
Constructor.- Parameters:
family
- The font family, cannot be null.style
- The style, null for undefined.weight
- The weight, null for undefined.- Throws:
NullPointerException
- If font family is null.
Method Details
getConsumedFonts
Collects all fonts in a component and its children recursively.- Parameters:
comp
- The component to collect fonts from.- Returns:
- The set of consumed fonts by the component and its children (recursively).
collectConsumedFonts
Collects all fonts in a component and its children recursively.- Parameters:
comp
- The component to collect fonts from.fonts
- The set of fonts to collect the information to.
getStyle
Gets the style. The style is not always the same as the value of the constructor.- Returns:
- The style string, null if undefined, empty string for "unknown" values (e.g. "inherit").
getWeight
Gets the weight. The weight is not always the same as the value of the constructor.- Returns:
- The weight string, null if undefined, empty string for "unknown" values (e.g. "inherit", "bolder" or "lighter").
equals
Checks if the consumed fonts are equal.hashCode
public int hashCode()The hash code.