Class Font
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.Font
-
- All Implemented Interfaces:
IsDefaultFont,IsFont
public final class Font extends AbstractNode implements IsFont
Base object to map font options for configuration.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontItemcreate()Creates a font options instance using default or cloning current instance.FontItemcreate(IsDefaultFont defaultValues)Creates a font options instance using default or cloning current instance.StringgetFamily()Returns the font family, follows CSS font-family options.doublegetLineHeight()Returns the height of an individual line of text.StringgetLineHeightAsString()Returns the height of an individual line of text.intgetSize()Returns the font size.FontStylegetStyle()Returns the font style, follows CSS font-style options (i.e.WeightgetWeight()Returns the font weight, follows CSS font-style-weight options.voidsetFamily(String family)Sets the font family, follows CSS font-family options.voidsetLineHeight(double lineHeight)Sets the line height.voidsetLineHeight(String lineHeight)Sets the line height.voidsetSize(int size)Sets the font size.voidsetStyle(FontStyle style)Sets the font style, follows CSS font-style options (i.e.voidsetWeight(Weight weight)Sets the font weight, follows CSS font-style-weight options.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
setSize
public void setSize(int size)
Sets the font size.
-
getSize
public int getSize()
Returns the font size.- Specified by:
getSizein interfaceIsDefaultFont- Returns:
- the font size.
-
setStyle
public void setStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-
getStyle
public FontStyle getStyle()
Returns the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).- Specified by:
getStylein interfaceIsDefaultFont- Returns:
- the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-
setFamily
public void setFamily(String family)
Sets the font family, follows CSS font-family options.
-
getFamily
public String getFamily()
Returns the font family, follows CSS font-family options.- Specified by:
getFamilyin interfaceIsDefaultFont- Returns:
- Font family, follows CSS font-family options.
-
setWeight
public void setWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options.
-
getWeight
public Weight getWeight()
Returns the font weight, follows CSS font-style-weight options.- Specified by:
getWeightin interfaceIsDefaultFont- Returns:
- the font weight, follows CSS font-style-weight options.
-
setLineHeight
public void setLineHeight(double lineHeight)
Sets the line height.- Specified by:
setLineHeightin interfaceIsFont- Parameters:
lineHeight- the line height.
-
setLineHeight
public void setLineHeight(String lineHeight)
Sets the line height.- Specified by:
setLineHeightin interfaceIsFont- Parameters:
lineHeight- the line height.
-
getLineHeight
public double getLineHeight()
Returns the height of an individual line of text.- Specified by:
getLineHeightin interfaceIsDefaultFont- Returns:
- the height of an individual line of text.
-
getLineHeightAsString
public String getLineHeightAsString()
Returns the height of an individual line of text.- Specified by:
getLineHeightAsStringin interfaceIsDefaultFont- Returns:
- the height of an individual line of text.
-
create
public FontItem create()
Description copied from interface:IsDefaultFontCreates a font options instance using default or cloning current instance.- Specified by:
createin interfaceIsDefaultFont- Returns:
- a font options instance using default or cloning current instance
-
create
public FontItem create(IsDefaultFont defaultValues)
Description copied from interface:IsDefaultFontCreates a font options instance using default or cloning current instance.- Specified by:
createin interfaceIsDefaultFont- Parameters:
defaultValues- default provider- Returns:
- a font options instance using default or cloning current instance
-
-