Class ChartLegend

  • Direct Known Subclasses:
    ChartColorBar


    public class ChartLegend
    extends java.lang.Object
    • Field Detail

      • shrink

        protected float shrink
      • aspect

        protected int aspect
      • x

        protected float x
      • y

        protected float y
      • background

        protected java.awt.Color background
      • drawBackground

        protected boolean drawBackground
      • width

        protected int width
      • height

        protected int height
      • legendWidth

        protected int legendWidth
      • legendHeight

        protected int legendHeight
      • labelLocation

        protected java.lang.String labelLocation
      • tickLabelFont

        protected java.awt.Font tickLabelFont
      • tickLabelColor

        protected java.awt.Color tickLabelColor
      • tickLabelAngle

        protected float tickLabelAngle
      • drawNeatLine

        protected boolean drawNeatLine
      • neatLineColor

        protected java.awt.Color neatLineColor
      • neatLineSize

        protected float neatLineSize
      • _vBarWidth

        protected float _vBarWidth
      • _hBarHeight

        protected float _hBarHeight
      • extendRect

        protected boolean extendRect
      • autoExtendFrac

        protected boolean autoExtendFrac
      • drawMinLabel

        protected boolean drawMinLabel
      • drawMaxLabel

        protected boolean drawMaxLabel
      • xshift

        protected float xshift
      • yshift

        protected float yshift
    • Constructor Detail

      • ChartLegend

        public ChartLegend​(LegendScheme ls)
        Constructor
        Parameters:
        ls - LegendScheme
    • Method Detail

      • getLegendScheme

        public LegendScheme getLegendScheme​()
        Get legend scheme
        Returns:
        Legend scheme
      • setLegendScheme

        public void setLegendScheme​(LegendScheme value)
        Set legend scheme
        Parameters:
        value - Legend scheme
      • isColorbar

        public boolean isColorbar​()
        Get if is color bar
        Returns:
        Boolean
      • setColorbar

        public void setColorbar​(boolean value)
        Set if is color bar
        Parameters:
        value - Boolean
      • getPosition

        public LegendPosition getPosition​()
        Get legend position
        Returns:
        Legend position
      • setPosition

        public void setPosition​(LegendPosition value)
        Set legend position
        Parameters:
        value - Legend position
      • getShrink

        public float getShrink​()
        Get shrink
        Returns:
        Shrink
      • setShrink

        public void setShrink​(float value)
        Set shrink
        Parameters:
        value - Shrink
      • getAspect

        public int getAspect​()
        Get aspect
        Returns:
        Aspect
      • setAspect

        public void setAspect​(int value)
        Set aspect
        Parameters:
        value - Aspect
      • getX

        public float getX​()
        Get X
        Returns:
        X value
      • setX

        public void setX​(float value)
        Set X
        Parameters:
        value - X value
      • getY

        public float getY​()
        Get Y
        Returns:
        Y value
      • setY

        public void setY​(float value)
        Set Y
        Parameters:
        value - Y value
      • getWidth

        public int getWidth​()
        Get width
        Returns:
        Width
      • setWidth

        public void setWidth​(int value)
        Set width
        Parameters:
        value - Width
      • getHeight

        public int getHeight​()
        Get height
        Returns:
        Height
      • setHeight

        public void setHeight​(int value)
        Set height
        Parameters:
        value - Height
      • getLegendWidth

        public int getLegendWidth​()
        Get legend width
        Returns:
        Legend width
      • setLegendWidth

        public void setLegendWidth​(int value)
        Set legend width
        Parameters:
        value - Legend width
      • getLegendHeight

        public int getLegendHeight​()
        Get legend height
        Returns:
        Legend height
      • setLegendHeight

        public void setLegendHeight​(int value)
        Set legend height
        Parameters:
        value - Legend height
      • getPlotOrientation

        public PlotOrientation getPlotOrientation​()
        Get plot orientation
        Returns:
        Plot orientation
      • setPlotOrientation

        public void setPlotOrientation​(PlotOrientation value)
        Set plot orientation
        Parameters:
        value - Plot orientation
      • getBackground

        public java.awt.Color getBackground​()
        Get background
        Returns:
        Background
      • setBackground

        public void setBackground​(java.awt.Color value)
        Set background
        Parameters:
        value - Background
      • isDrawBackground

        public boolean isDrawBackground​()
        Get if draw background
        Returns:
        Boolean
      • setDrawBackground

        public void setDrawBackground​(boolean value)
        Set if draw background
        Parameters:
        value - Boolean
      • isDrawNeatLine

        public boolean isDrawNeatLine​()
        Get if draw neat line
        Returns:
        If draw neat line
      • setDrawNeatLine

        public void setDrawNeatLine​(boolean istrue)
        Set if draw neat line
        Parameters:
        istrue - If draw neat line
      • getNeatLineColor

        public java.awt.Color getNeatLineColor​()
        Get neat line color
        Returns:
        Neat line color
      • setNeatLineColor

        public void setNeatLineColor​(java.awt.Color color)
        Set neat line color
        Parameters:
        color - Neat line color
      • getNeatLineSize

        public float getNeatLineSize​()
        Get neat line size
        Returns:
        Neat line size
      • setNeatLineSize

        public void setNeatLineSize​(float size)
        Set neat line size
        Parameters:
        size - Neat line size
      • getLabel

        public ChartText getLabel​()
        Get label
        Returns:
        Label
      • setLabel

        public void setLabel​(ChartText value)
        Set label
        Parameters:
        value - Label
      • getLabelFont

        public java.awt.Font getLabelFont​()
        Get label font
        Returns:
        Label font
      • setLabelFont

        public void setLabelFont​(java.awt.Font value)
        Set label font
        Parameters:
        value - Label font
      • getLabelColor

        public java.awt.Color getLabelColor​()
        Get label color
        Returns:
        Label color
      • setLabelColor

        public void setLabelColor​(java.awt.Color value)
        Set label color
        Parameters:
        value - Label color
      • getLabelLocation

        public java.lang.String getLabelLocation​()
        Get label location (in, out, top, bottom, left, right)
        Returns:
        Label location
      • setLabelLocation

        public void setLabelLocation​(java.lang.String value)
        Set label location
        Parameters:
        value - Label location
      • getTickLabelFont

        public java.awt.Font getTickLabelFont​()
        Get Tick label font
        Returns:
        The Tick label font
      • setTickLabelFont

        public void setTickLabelFont​(java.awt.Font font)
        Set Tick label font
        Parameters:
        font - The Tick label font
      • getTickLabelColor

        public java.awt.Color getTickLabelColor​()
        Get tick label color
        Returns:
        Tick label color
      • setTickLabelColor

        public void setTickLabelColor​(java.awt.Color value)
        Set tick label color
        Parameters:
        value - Tick label color
      • getTickLabelAngle

        public float getTickLabelAngle​()
        Get tick lable angle
        Returns:
        Tick label angle
      • setTickLabelAngle

        public void setTickLabelAngle​(float value)
        Set tick label angle
        Parameters:
        value - Tick label angle
      • getColumnNumber

        public int getColumnNumber​()
        Get column number
        Returns:
        Column number
      • setColumnNumber

        public void setColumnNumber​(int value)
        Set column number
        Parameters:
        value - Column number
      • isAutoRowColNum

        public boolean isAutoRowColNum​()
        Get if automatic set row/col number
        Returns:
        Boolean
      • setAutoRowColNum

        public void setAutoRowColNum​(boolean value)
        Set if automatic set row/col number
        Parameters:
        value - Boolean
      • getSymbolDimension

        public java.awt.Dimension getSymbolDimension​()
        Get symbol dimension
        Returns:
        Symbol dimension
      • setSymbolDimension

        public void setSymbolDimension​(java.awt.Dimension value)
        Set symbol dimension
        Parameters:
        value - Symbol dimension
      • setSymbolWidth

        public void setSymbolWidth​(int value)
        Set symbol width
        Parameters:
        value - Width
      • setSymbolHeight

        public void setSymbolHeight​(int value)
        Set symbol height
        Parameters:
        value - height
      • setSymbolScale

        public void setSymbolScale​(float value)
        Set symbol scale
        Parameters:
        value - Symble scale
      • isExtendRect

        public boolean isExtendRect​()
        Get if extend rectangle - or triangle
        Returns:
        Boolean
      • setExtendRect

        public void setExtendRect​(boolean value)
        Set if extend rectangle - or triangle
        Parameters:
        value - Boolean
      • isAutoExtendFrac

        public boolean isAutoExtendFrac​()
        Get if auto set extend fraction - extend has save width and height Only valid for colorbar
        Returns:
        Boolean
      • setAutoExtendFrac

        public void setAutoExtendFrac​(boolean value)
        Set if auto set extend fraction - extend has save width and height Only valid for colorbar
        Parameters:
        value -
      • setTickCaptions

        public void setTickCaptions​(java.util.List<java.lang.String> value)
        Set tick labels
        Parameters:
        value - Tick labels
      • isDrawMinLabel

        public boolean isDrawMinLabel​()
        Get if draw minimum value label
        Returns:
        Boolean
      • setDrawMinLabel

        public void setDrawMinLabel​(boolean value)
        Set if draw minimum value label
        Parameters:
        value - Boolean
      • isDrawMaxLabel

        public boolean isDrawMaxLabel​()
        Get if draw maximum value label
        Returns:
        Boolean
      • setDrawMaxLabel

        public void setDrawMaxLabel​(boolean value)
        Set if draw maximum value label
        Parameters:
        value - Boolean
      • getXShift

        public float getXShift​()
        Get x shift - pixel unit
        Returns:
        X shift
      • setXShift

        public void setXShift​(float value)
        Set x shift
        Parameters:
        value - X shift
      • getYShift

        public float getYShift​()
        Get y shift - pixel unit
        Returns:
        Y shift
      • setYShift

        public void setYShift​(float value)
        Set y shift
        Parameters:
        value - Y shift
      • draw

        public void draw​(java.awt.Graphics2D g,
                         PointF point)
        Draw legend
        Parameters:
        g - Graphics2D
        point - Start point
      • getLegendDimension

        public java.awt.Dimension getLegendDimension​(java.awt.Graphics2D g,
                                                     java.awt.Dimension limitDim)
        Get legend dimension
        Parameters:
        g - Graphics2D
        limitDim - Limit dimension
        Returns:
        Legend dimension
      • getTickWidth

        protected int getTickWidth​(java.awt.Graphics2D g)
      • getTickHeight

        protected int getTickHeight​(java.awt.Graphics2D g)
      • getTickGap

        protected int getTickGap​(java.awt.Graphics2D g)
        Update tick gap
        Parameters:
        g - Graphics2D
        Returns:
        Ticks gap