Class LegendLabels


  • public class LegendLabels
    extends Object
    This is the labels configuration of the legend.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getFont

        public Font getFont()
        Returns the font element.
        Returns:
        the font
      • setColor

        public void setColor​(IsColor color)
        Sets the font color.
        Parameters:
        color - font color.
      • setColor

        public void setColor​(String color)
        Sets the font color.
        Parameters:
        color - font color.
      • getColorAsString

        public String getColorAsString()
        Returns the font color as string.
        Returns:
        font color as string
      • getColor

        public IsColor getColor()
        Returns the font color.
        Returns:
        font color
      • setUsePointStyle

        public void setUsePointStyle​(boolean usePointStyle)
        Sets if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
        Parameters:
        usePointStyle - if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
      • isUsePointStyle

        public boolean isUsePointStyle()
        Returns if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
        Returns:
        if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
      • setPointStyleWidth

        public void setPointStyleWidth​(double pointStyleWidth)
        Sets if usePointStyle is true, the width of the point style used for the legend.
        Parameters:
        pointStyleWidth - if usePointStyle is true, the width of the point style used for the legend.
      • getPointStyleWidth

        public double getPointStyleWidth()
        Returns if usePointStyle is true, the width of the point style used for the legend.
        Returns:
        if usePointStyle is true, the width of the point style used for the legend.
      • setPointStyle

        public void setPointStyle​(boolean pointStyle)
        Sets the style of the legend, overriding point style from dataset.
        Only applies if setUsePointStyle(boolean) is set to true.
        Parameters:
        pointStyle - the style of the legend, overriding point style from dataset.
      • setPointStyle

        public void setPointStyle​(PointStyle pointStyle)
        Sets the style of the legend, overriding point style from dataset.
        Only applies if setUsePointStyle(boolean) is set to true.
        Parameters:
        pointStyle - the style of the legend, overriding point style from dataset.
      • setPointStyle

        public void setPointStyle​(Img pointStyle)
        Sets the style of the legend, overriding point style from dataset, as image.
        Only applies if setUsePointStyle(boolean) is set to true.
        Parameters:
        pointStyle - the style of the legend, overriding point style from dataset.
      • setPointStyle

        public void setPointStyle​(Canvas pointStyle)
        Sets the style of the legend, overriding point style from dataset, as canvas.
        Only applies if setUsePointStyle(boolean) is set to true.
        Parameters:
        pointStyle - the style of the legend, overriding point style from dataset.
      • getPointStyleType

        public PointStyleType getPointStyleType()
        Returns the type of point style.
        Returns:
        the type of point style
      • getPointStyle

        public PointStyle getPointStyle()
        Returns the style of the legend.
        Returns:
        the style of the legend.
      • getPointStyleAsCanvas

        public Canvas getPointStyleAsCanvas()
        Returns the style of the point as canvas.
        Returns:
        the style of the point as canvas.
      • getPointStyleAsImage

        public Img getPointStyleAsImage()
        Returns the style of the legend as image.
        Returns:
        the style of the legend as image.
      • setBoxWidth

        public void setBoxWidth​(int boxWidth)
        Sets the width of colored box.
        Parameters:
        boxWidth - width of colored box.
      • getBoxWidth

        public int getBoxWidth()
        Returns the width of colored box.
        Returns:
        width of colored box.
      • setBoxHeight

        public void setBoxHeight​(int boxHeight)
        Sets the height of colored box.
        Parameters:
        boxHeight - height of colored box.
      • getBoxHeight

        public int getBoxHeight()
        Returns the height of colored box.
        Returns:
        height of colored box.
      • setPadding

        public void setPadding​(int padding)
        Sets the padding to apply around labels. Only top and bottom are implemented.
        Parameters:
        padding - Padding to apply around labels. Only top and bottom are implemented.
      • getPadding

        public int getPadding()
        Returns the padding to apply around labels. Only top and bottom are implemented.
        Returns:
        Padding to apply around labels. Only top and bottom are implemented.
      • setTextAlign

        public void setTextAlign​(TextAlign align)
        Sets the horizontal alignment of the label text.
        Parameters:
        align - the horizontal alignment of the label text.
      • getTextAlign

        public TextAlign getTextAlign()
        Returns the horizontal alignment of the label text.
        Returns:
        the horizontal alignment of the label text.
      • isUseBorderRadius

        public boolean isUseBorderRadius()
        Returns if label border radius will match corresponding borderRadius.
        Returns:
        if label border radius will match corresponding borderRadius.
      • setUseBorderRadius

        public void setUseBorderRadius​(boolean useRadius)
        Sets if label border radius will match corresponding borderRadius.
        Parameters:
        useRadius - if label border radius will match corresponding borderRadius.
      • setBorderRadius

        public void setBorderRadius​(int radius)
        Sets the border radius.
        Parameters:
        radius - the border radius.
      • getBorderRadius

        public int getBorderRadius()
        Returns the border radius (in pixels).
        Returns:
        the border radius (in pixels).
      • getFilterCallback

        public LegendFilterCallback getFilterCallback()
        Returns the user filter callback instance.
        Returns:
        the user filter callback instance
      • setFilterCallback

        public void setFilterCallback​(LegendFilterCallback filterCallback)
        Sets the user filter callback instance.
        Parameters:
        filterCallback - the user filter callback instance
      • getLabelsCallback

        public LegendLabelsCallback getLabelsCallback()
        Returns the user callback instance to generate labels.
        Returns:
        the user callback instance to generate labels
      • setLabelsCallback

        public void setLabelsCallback​(LegendLabelsCallback labelsCallback)
        Sets the user callback instance to generate labels.
        Parameters:
        labelsCallback - the user callback instance to generate labels
      • getItemSortCallback

        public LegendItemSortCallback getItemSortCallback()
        Returns the user item sort callback instance.
        Returns:
        the user item sort callback instance
      • setItemSortCallback

        public void setItemSortCallback​(LegendItemSortCallback itemSortCallback)
        Sets the user item sort callback instance.
        Parameters:
        itemSortCallback - the user item sort callback instance
      • getOptions

        protected final ConfigurationOptions getOptions()
        Returns the configuration options.
        Returns:
        the configuration options.
      • getConfiguration

        protected final ExtendedOptions getConfiguration()
        Returns the configuration element.
        Returns:
        the configuration element.
      • getChart

        public final IsChart getChart()
        Returns the chart instance
        Returns:
        the chart