Class AbstractImmutableFont
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.options.AbstractImmutableFont
 
 
- 
- All Implemented Interfaces:
- IsDefaultFont,- IsImmutableFont
 
 public abstract class AbstractImmutableFont extends NativeObjectContainer implements IsImmutableFont Base class to map a font element in read-only mode, normalized by CHART.JS byHelpers.toFont(org.pepstock.charba.client.items.FontItem), providing also the CSS string of font itself.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractImmutableFont(NativeObject nativeObject)Creates a immutable font to use, wrapping a native object instance, and providing a CSS string.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FontItemcreate()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 as string.protected NativeObjectgetObject()Returns the native object instance.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.StringtoCSSString()Builds the font string (shorthand property of CSS font) to use in the canvas object.
 See here CSS specification.- 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckDefaultValuesArgument, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultFontcreate, create, getFamily, getLineHeight, getSize, getStyle, getWeight
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractImmutableFontprotected AbstractImmutableFont(NativeObject nativeObject) Creates a immutable font to use, wrapping a native object instance, and providing a CSS string.- Parameters:
- nativeObject- native object to map java script properties
 
 
- 
 - 
Method Detail- 
getLineHeightAsStringpublic final String getLineHeightAsString() Description copied from interface:IsDefaultFontReturns the height of an individual line of text as string.- Specified by:
- getLineHeightAsStringin interface- IsDefaultFont
- Returns:
- the height of an individual line of text as string.
 
 - 
toCSSStringpublic final String toCSSString() Description copied from interface:IsImmutableFontBuilds the font string (shorthand property of CSS font) to use in the canvas object.
 See here CSS specification.- Specified by:
- toCSSStringin interface- IsImmutableFont
- Returns:
- the font string to use in the canvas object.
 
 - 
getSizepublic int getSize() Description copied from interface:IsDefaultFontReturns the font size.- Specified by:
- getSizein interface- IsDefaultFont
- Returns:
- the font size.
 
 - 
getStylepublic FontStyle getStyle() Description copied from interface:IsDefaultFontReturns the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).- Specified by:
- getStylein interface- IsDefaultFont
- Returns:
- the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
 
 - 
getFamilypublic String getFamily() Description copied from interface:IsDefaultFontReturns the font family, follows CSS font-family options.- Specified by:
- getFamilyin interface- IsDefaultFont
- Returns:
- Font family, follows CSS font-family options.
 
 - 
getWeightpublic Weight getWeight() Description copied from interface:IsDefaultFontReturns the font weight, follows CSS font-style-weight options.- Specified by:
- getWeightin interface- IsDefaultFont
- Returns:
- the font weight, follows CSS font-style-weight options.
 
 - 
getLineHeightpublic double getLineHeight() Description copied from interface:IsDefaultFontReturns the height of an individual line of text.- Specified by:
- getLineHeightin interface- IsDefaultFont
- Returns:
- the height of an individual line of text.
 
 - 
createpublic FontItem create() Description copied from interface:IsDefaultFontCreates a font options instance using default or cloning current instance.- Specified by:
- createin interface- IsDefaultFont
- Returns:
- a font options instance using default or cloning current instance
 
 - 
getObjectprotected final NativeObject getObject() Returns the native object instance.- Returns:
- the native object instance.
 
 
- 
 
-