Class AbstractScriptableFont<T extends ChartContext>

    • Constructor Detail

      • AbstractScriptableFont

        protected AbstractScriptableFont​(IsScriptableFontProvider<T> scriptableFontProvider,
                                         IsDefaultFont defaultValues)
        Creates an empty font to use for chart configuration.
        Parameters:
        scriptableFontProvider - the provider of font callback
        defaultValues - default provider
      • AbstractScriptableFont

        protected AbstractScriptableFont​(IsScriptableFontProvider<T> scriptableFontProvider,
                                         IsDefaultFont defaultValues,
                                         NativeObject nativeObject)
        Creates a font to use for chart configuration, wrapping a native object instance.
        Parameters:
        scriptableFontProvider - the provider of font callback
        defaultValues - default provider
        nativeObject - native object to map java script properties
    • Method Detail

      • setSize

        public void setSize​(int size)
        Description copied from interface: IsFont
        Sets the font size.
        Specified by:
        setSize in interface IsFont
        Overrides:
        setSize in class AbstractFont
        Parameters:
        size - the font size.
      • setStyle

        public void setStyle​(FontStyle style)
        Description copied from interface: IsFont
        Sets the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
        Specified by:
        setStyle in interface IsFont
        Overrides:
        setStyle in class AbstractFont
        Parameters:
        style - Font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
      • setFamily

        public void setFamily​(String family)
        Description copied from interface: IsFont
        Sets the font family, follows CSS font-family options.
        Specified by:
        setFamily in interface IsFont
        Overrides:
        setFamily in class AbstractFont
        Parameters:
        family - Font family, follows CSS font-family options.
      • setWeight

        public void setWeight​(Weight weight)
        Description copied from interface: IsFont
        Sets the font weight, follows CSS font-style-weight options.
        Specified by:
        setWeight in interface IsFont
        Overrides:
        setWeight in class AbstractFont
        Parameters:
        weight - font weight, follows CSS font-style-weight options.
      • setLineHeight

        public void setLineHeight​(double lineHeight)
        Description copied from interface: IsFont
        Sets the line height.
        Specified by:
        setLineHeight in interface IsFont
        Overrides:
        setLineHeight in class AbstractFont
        Parameters:
        lineHeight - the line height.
      • resetCallback

        protected void resetCallback()
        Invokes when any property of the font is being set, in order to reset the FontCallback if exists
      • getSize

        public int getSize()
        Description copied from interface: IsDefaultFont
        Returns the font size.
        Specified by:
        getSize in interface IsDefaultFont
        Returns:
        the font size.
      • getStyle

        public FontStyle getStyle()
        Description copied from interface: IsDefaultFont
        Returns the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
        Specified by:
        getStyle in interface IsDefaultFont
        Returns:
        the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
      • getFamily

        public String getFamily()
        Description copied from interface: IsDefaultFont
        Returns the font family, follows CSS font-family options.
        Specified by:
        getFamily in interface IsDefaultFont
        Returns:
        Font family, follows CSS font-family options.
      • getWeight

        public Weight getWeight()
        Description copied from interface: IsDefaultFont
        Returns the font weight, follows CSS font-style-weight options.
        Specified by:
        getWeight in interface IsDefaultFont
        Returns:
        the font weight, follows CSS font-style-weight options.
      • getLineHeight

        public double getLineHeight()
        Description copied from interface: IsDefaultFont
        Returns the height of an individual line of text.
        Specified by:
        getLineHeight in interface IsDefaultFont
        Returns:
        the height of an individual line of text.
      • getLineHeightAsString

        public String getLineHeightAsString()
        Description copied from interface: IsDefaultFont
        Returns the height of an individual line of text as string.
        Specified by:
        getLineHeightAsString in interface IsDefaultFont
        Returns:
        the height of an individual line of text as string.
      • create

        public FontItem create()
        Description copied from interface: IsDefaultFont
        Creates a font options instance using default or cloning current instance.
        Specified by:
        create in interface IsDefaultFont
        Returns:
        a font options instance using default or cloning current instance
      • getObject

        protected final NativeObject getObject()
        Returns the native object instance.
        Returns:
        the native object instance.