Class Legend


  • public final class Legend
    extends AbstractNode
    Legend configuration for GEO chart scale.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_LENGTH

        public static final int DEFAULT_LENGTH
        Default length options, 100.
        See Also:
        Constant Field Values
      • DEFAULT_WIDTH

        public static final int DEFAULT_WIDTH
        Default width options, 50.
        See Also:
        Constant Field Values
      • DEFAULT_INDICATOR_WIDTH

        public static final int DEFAULT_INDICATOR_WIDTH
        Default indicator width options, 10.
        See Also:
        Constant Field Values
      • DEFAULT_MARGIN

        public static final int DEFAULT_MARGIN
        Default margin options, 8.
        See Also:
        Constant Field Values
    • Method Detail

      • setPosition

        public void setPosition​(Position position)
        Sets the location of the legend on the chart area.
        Parameters:
        position - the location of the legend on the chart area
      • setPosition

        public void setPosition​(PositionPoint position)
        Sets the location of the legend on the chart area.
        Parameters:
        position - the location of the legend on the chart area
      • getPosition

        public Position getPosition()
        Returns the location of the legend on the chart area.
        Returns:
        the location of the legend on the chart area
      • getPositionAsPoint

        public PositionPoint getPositionAsPoint()
        Returns the location of the legend on the chart area.
        Returns:
        the location of the legend on the chart area
      • setAlign

        public void setAlign​(Align align)
        Sets the alignment of the legend on the chart area.
        Parameters:
        align - the alignment of the legend on the chart area
      • getAlign

        public Align getAlign()
        Returns the alignment of the legend on the chart area.
        Returns:
        the alignment of the legend on the chart area
      • setLength

        public void setLength​(int length)
        Sets the length of the legend.
        Parameters:
        length - the length of the legend
      • getLength

        public int getLength()
        Returns the length of the legend.
        Returns:
        the length of the legend
      • setWidth

        public void setWidth​(int width)
        Sets how wide the scale is.
        For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.
        Parameters:
        width - how wide the scale is
      • getWidth

        public int getWidth()
        Returns how wide the scale is.
        For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.
        Returns:
        how wide the scale is
      • setIndicatorWidth

        public void setIndicatorWidth​(int width)
        Sets how many pixels should be used for the color bar.
        Parameters:
        width - how many pixels should be used for the color bar
      • getIndicatorWidth

        public int getIndicatorWidth()
        Returns how many pixels should be used for the color bar.
        Returns:
        how many pixels should be used for the color bar
      • setMargin

        public void setMargin​(int margin)
        Sets the margin pixels such that it doesn't stick to the edge of the chart.
        Parameters:
        margin - the margin pixels such that it doesn't stick to the edge of the chart
      • setMargin

        public void setMargin​(Margin margin)
        Sets the margin pixels such that it doesn't stick to the edge of the chart.
        Parameters:
        margin - the margin pixels such that it doesn't stick to the edge of the chart
      • getMargin

        public int getMargin()
        Returns the margin pixels such that it doesn't stick to the edge of the chart.
        Returns:
        the margin pixels such that it doesn't stick to the edge of the chart
      • getMarginAsObject

        public Margin getMarginAsObject()
        Returns the margin pixels such that it doesn't stick to the edge of the chart.
        Returns:
        the margin pixels such that it doesn't stick to the edge of the chart
      • setPosition

        public void setPosition​(PositionCallback positionCallback)
        Sets the location of the legend on the chart area.
        Parameters:
        positionCallback - the callback to set the location of the legend on the chart area
      • getPositionCallback

        public PositionCallback getPositionCallback()
        Returns the callback to set the location of the legend on the chart area.
        Returns:
        the callback to set the location of the legend on the chart area
      • setAlign

        public void setAlign​(AlignCallback alignCallback)
        Sets the alignment of the legend on the chart area.
        Parameters:
        alignCallback - the alignment of the legend on the chart area.
      • getAlignCallback

        public AlignCallback getAlignCallback()
        Returns the callback to set the alignment of the legend on the chart area.
        Returns:
        the callback to set the alignment of the legend on the chart area
      • setLength

        public void setLength​(LengthCallback lengthCallback)
        Sets the length of the legend.
        Parameters:
        lengthCallback - the callback to set length of the legend.
      • getLengthCallback

        public LengthCallback getLengthCallback()
        Returns the callback to set length of the legend.
        Returns:
        the callback to set length of the legend
      • setWidth

        public void setWidth​(WidthCallback<ScaleContext> widthCallback)
        Sets how wide the scale is.
        Parameters:
        widthCallback - the callback to set how wide the scale is
      • getWidthCallback

        public WidthCallback<ScaleContext> getWidthCallback()
        Returns the callback to set how wide the scale is.
        Returns:
        the callback to set how wide the scale is
      • setIndicatorWidth

        public void setIndicatorWidth​(WidthCallback<ScaleContext> indicatorWidthCallback)
        Sets how many pixels should be used for the color bar.
        Parameters:
        indicatorWidthCallback - the callback to set how many pixels should be used for the color bar
      • getIndicatorWidthCallback

        public WidthCallback<ScaleContext> getIndicatorWidthCallback()
        Returns the callback to set how many pixels should be used for the color bar.
        Returns:
        the callback to set how many pixels should be used for the color bar
      • setMargin

        public void setMargin​(MarginCallback marginCallback)
        Sets the margin pixels such that it doesn't stick to the edge of the chart.
        Parameters:
        marginCallback - the callback to set the margin pixels such that it doesn't stick to the edge of the chart
      • getMarginCallback

        public MarginCallback getMarginCallback()
        Returns the callback to set the margin pixels such that it doesn't stick to the edge of the chart.
        Returns:
        the callback to set the margin pixels such that it doesn't stick to the edge of the chart