Documentation of 'de.erichseifert.gral.plots.AbstractPlot' Java class
AbstractPlot
de.erichseifert.gral.plots

Class AbstractPlot

    • Constructor Detail

      • AbstractPlot

        public AbstractPlot(DataSource... series)
        Initializes a new AbstractPlot instance with the specified data series. The series will be visible by default.
        Parameters:
        series - Initial data series to be displayed.
    • Method Detail

      • draw

        public void draw(DrawingContext context)
        Draws the Drawable with the specified drawing context.
        Specified by:
        draw in interface Drawable
        Overrides:
        draw in class DrawableContainer
        Parameters:
        context - Environment used for drawing
      • getAxis

        public Axis getAxis(java.lang.String name)
        Returns the axis with the specified name.
        Specified by:
        getAxis in interface Plot
        Parameters:
        name - Name of the axis.
        Returns:
        Axis.
      • setAxis

        public void setAxis(java.lang.String name,
                            Axis axis)
        Sets the axis with the specified name and the associated AxisRenderer.
        Specified by:
        setAxis in interface Plot
        Parameters:
        name - Name of the axis.
        axis - Axis.
      • removeAxis

        public void removeAxis(java.lang.String name)
        Removes the axis with the specified name.
        Specified by:
        removeAxis in interface Plot
        Parameters:
        name - Name of the axis to be removed.
      • getAxesNames

        public java.util.Collection<java.lang.String> getAxesNames()
        Returns a collection of all names of the axes stored in this plot.
        Specified by:
        getAxesNames in interface Plot
        Returns:
        The names of all axes stored in this plot.
      • autoscaleAxis

        public void autoscaleAxis(java.lang.String axisName)
        Tries to automatically set the ranges of the axes specified by the name if it is set to auto-scale.
        Specified by:
        autoscaleAxis in interface Plot
        Parameters:
        axisName - Name of the axis that should be scaled.
        See Also:
        Axis.setAutoscaled(boolean)
      • getAxisRenderer

        public AxisRenderer getAxisRenderer(java.lang.String axisName)
        Returns the renderer for the axis with the specified name.
        Specified by:
        getAxisRenderer in interface Plot
        Parameters:
        axisName - Axis name.
        Returns:
        Instance that renders the axis.
      • setAxisRenderer

        public void setAxisRenderer(java.lang.String axisName,
                                    AxisRenderer renderer)
        Sets the renderer for the axis with the specified name.
        Specified by:
        setAxisRenderer in interface Plot
        Parameters:
        axisName - Name of the axis to be rendered.
        renderer - Instance to render the axis.
      • getPlotArea

        public PlotArea getPlotArea()
        Returns the drawing area of this plot.
        Specified by:
        getPlotArea in interface Plot
        Returns:
        PlotArea2D.
      • getTitle

        public Label getTitle()
        Returns the title component of this plot.
        Specified by:
        getTitle in interface Plot
        Returns:
        Label representing the title.
      • getLegend

        public Legend getLegend()
        Returns the legend component.
        Specified by:
        getLegend in interface Plot
        Returns:
        Legend.
      • getBackground

        public java.awt.Paint getBackground()
        Description copied from interface: Plot
        Returns the paint which is used to fill the background of the plot.
        Specified by:
        getBackground in interface Plot
        Returns:
        Paint which is used to fill the background of the plot.
      • setBackground

        public void setBackground(java.awt.Paint background)
        Description copied from interface: Plot
        Sets the paint which will be used to fill the background of the plot.
        Specified by:
        setBackground in interface Plot
        Parameters:
        background - Paint which will be used to fill the background of the plot.
      • getBorderStroke

        public java.awt.Stroke getBorderStroke()
        Description copied from interface: Plot
        Returns the stroke which is used to paint the border of the plot.
        Specified by:
        getBorderStroke in interface Plot
        Returns:
        Stroke which is used to paint the border of the plot.
      • setBorderStroke

        public void setBorderStroke(java.awt.Stroke border)
        Description copied from interface: Plot
        Sets the stroke which will be used to paint the border of the plot.
        Specified by:
        setBorderStroke in interface Plot
        Parameters:
        border - Stroke which will be used to paint the border of the plot.
      • getBorderColor

        public java.awt.Paint getBorderColor()
        Description copied from interface: Plot
        Returns the paint which is used to fill the border of the plot.
        Specified by:
        getBorderColor in interface Plot
        Returns:
        Paint which is used to fill the border of the plot.
      • setBorderColor

        public void setBorderColor(java.awt.Paint color)
        Description copied from interface: Plot
        Sets the paint which will be used to fill the border of the plot.
        Specified by:
        setBorderColor in interface Plot
        Parameters:
        color - Paint which will be used to fill the border of the plot.
      • getFont

        public java.awt.Font getFont()
        Description copied from interface: Plot
        Returns the base font used by the plot.
        Specified by:
        getFont in interface Plot
        Returns:
        Font used by the plot.
      • setFont

        public void setFont(java.awt.Font font)
        Description copied from interface: Plot
        Sets the base font that will be used by the plot.
        Specified by:
        setFont in interface Plot
        Parameters:
        font - Font that will used by the plot.
      • isLegendVisible

        public boolean isLegendVisible()
        Description copied from interface: Plot
        Returns whether the legend is shown.
        Specified by:
        isLegendVisible in interface Plot
        Returns:
        true if the legend is shown, false if the legend is hidden.
      • setLegendVisible

        public void setLegendVisible(boolean legendVisible)
        Description copied from interface: Plot
        Sets whether the legend will be shown.
        Specified by:
        setLegendVisible in interface Plot
        Parameters:
        legendVisible - true if the legend should be shown, false if the legend should be hidden.
      • getLegendLocation

        public Location getLegendLocation()
        Description copied from interface: Plot
        Returns the current positioning of the legend inside the plot.
        Specified by:
        getLegendLocation in interface Plot
        Returns:
        Current positioning of the legend inside the plot.
      • setLegendLocation

        public void setLegendLocation(Location location)
        Description copied from interface: Plot
        Sets the positioning of the legend inside the plot.
        Specified by:
        setLegendLocation in interface Plot
        Parameters:
        location - Positioning of the legend inside the plot.
      • getLegendDistance

        public double getLegendDistance()
        Description copied from interface: Plot
        Returns the spacing between the plot area and the legend.
        Specified by:
        getLegendDistance in interface Plot
        Returns:
        Spacing between the plot area and the legend relative to font height.
      • setLegendDistance

        public void setLegendDistance(double distance)
        Description copied from interface: Plot
        Sets the spacing between the plot area and the legend. The distance is defined in font height.
        Specified by:
        setLegendDistance in interface Plot
        Parameters:
        distance - Spacing between the plot area and the legend relative to font height.
      • add

        public void add(DataSource source)
        Adds a new data series to the plot which is visible by default.
        Specified by:
        add in interface Plot
        Parameters:
        source - Data series.
      • add

        public void add(DataSource source,
                        boolean visible)
        Adds a new data series to the plot.
        Specified by:
        add in interface Plot
        Parameters:
        source - Data series.
        visible - true if the series should be displayed, false otherwise.
      • add

        public void add(int index,
                        DataSource source,
                        boolean visible)
        Inserts the specified data series to the plot at a specified position.
        Specified by:
        add in interface Plot
        Parameters:
        index - Position.
        source - Data series.
        visible - true if the series should be displayed, false otherwise.
      • contains

        public boolean contains(DataSource source)
        Returns whether the plot contains the specified data series.
        Specified by:
        contains in interface Plot
        Parameters:
        source - Data series.
        Returns:
        true if the specified element is stored in the plot, otherwise false
      • get

        public DataSource get(int index)
        Returns the data series at a specified index.
        Specified by:
        get in interface Plot
        Parameters:
        index - Position of the data series.
        Returns:
        Instance of the data series.
      • remove

        public boolean remove(DataSource source)
        Deletes the specified data series from the plot.
        Specified by:
        remove in interface Plot
        Parameters:
        source - Data series.
        Returns:
        true if the series existed, otherwise false.
      • clear

        public void clear()
        Removes all data series from this plot.
        Specified by:
        clear in interface Plot
      • getMapping

        public java.lang.String[] getMapping(DataSource source)
        Returns the mapping of data source columns to axis names. The elements of returned array equal the column indexes, i.e. the first element (axis name) matches the first column of source. If no mapping exists null will be stored in the array.
        Specified by:
        getMapping in interface Plot
        Parameters:
        source - Data source.
        Returns:
        Array containing axis names in the order of the columns, or null if no mapping exists for the column.
      • setMapping

        public void setMapping(DataSource source,
                               java.lang.String... axisNames)
        Sets the mapping of data source columns to axis names. The column index is taken from the order of the axis names, i.e. the first column of source will be mapped to first element of axisNames. Axis names with value null will be ignored.
        Specified by:
        setMapping in interface Plot
        Parameters:
        source - Data source.
        axisNames - Sequence of axis names in the order of the columns.
      • getData

        public java.util.List<DataSource> getData()
        Returns a list of all data series stored in the plot.
        Specified by:
        getData in interface Plot
        Returns:
        List of all data series.
      • getVisibleData

        public java.util.List<DataSource> getVisibleData()
        Returns a list of all visible data series stored in the plot.
        Specified by:
        getVisibleData in interface Plot
        Returns:
        List of all visible data series.
      • isVisible

        public boolean isVisible(DataSource source)
        Returns whether the specified data series is drawn.
        Specified by:
        isVisible in interface Plot
        Parameters:
        source - Data series.
        Returns:
        true if visible, false otherwise.
      • setVisible

        public void setVisible(DataSource source,
                               boolean visible)
        Changes the visibility of the specified data series.
        Specified by:
        setVisible in interface Plot
        Parameters:
        source - Data series.
        visible - true if the series should be visible, false otherwise.
      • dataAdded

        public void dataAdded(DataSource source,
                              DataChangeEvent... events)
        Method that is invoked when data has been added. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataAdded in interface DataListener
        Parameters:
        source - Data source that has been changed.
        events - Optional event object describing the data values that have been added.
      • dataUpdated

        public void dataUpdated(DataSource source,
                                DataChangeEvent... events)
        Method that is invoked when data has been updated. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataUpdated in interface DataListener
        Parameters:
        source - Data source that has been changed.
        events - Optional event object describing the data values that have been updated.
      • dataRemoved

        public void dataRemoved(DataSource source,
                                DataChangeEvent... events)
        Method that is invoked when data has been removed. This method is invoked by objects that provide support for DataListeners and should not be called manually.
        Specified by:
        dataRemoved in interface DataListener
        Parameters:
        source - Data source that has been changed.
        events - Optional event object describing the data values that have been removed.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.