Class LinesPlotState


  • public class LinesPlotState
    extends PlotState
    PlotState subclass for use with stacked line plots.
    Since:
    3 Mar 2006
    Author:
    Mark Taylor
    • Constructor Detail

      • LinesPlotState

        public LinesPlotState​(int ngraph)
        Constructs a new state.
        Parameters:
        ngraph - number of graphs in the stack
    • Method Detail

      • getGraphCount

        public int getGraphCount()
        Returns the number of graphs in the stack.
        Returns:
        graph count
      • setYAxes

        public void setYAxes​(uk.ac.starlink.table.ValueInfo[] yAxes)
        Sets the metadata for the different Y axes to be plotted (one for each graph). Note the submitted axes array is not used directly, the relevant information is abstracted from it and stored (subsequent calls of getYAxes() will not return the same array or component objects).
        Parameters:
        yAxes - Y axis metadata array
      • setYAxisLabels

        public void setYAxisLabels​(java.lang.String[] yAxisLabels)
        Sets the text labels for the different Y axes to be plotted (one for each graph).
        Parameters:
        yAxisLabels - Y axis label array
      • getYAxisLabels

        public java.lang.String[] getYAxisLabels()
        Returns the text labels for the different Y axes to be plotted (one for each graph).
        Returns:
        Y axis label array
      • getYAxes

        public uk.ac.starlink.table.ValueInfo[] getYAxes()
        Returns the metatdata for the different Y axes to be plotted (one for each graph).
        Returns:
        Y axis metadata array
      • setYRanges

        public void setYRanges​(double[][] yRanges)
        Sets data ranges for each different Y axis (one for each graph). yRanges is an N-element array of 2-element double arrays. Each of its elements gives (low,high) limits for the data to be considered. Either or both elements may be NaN. A non-NaN value is considered as a request to fix the lower/upper limit of the indicated axis to the value given. A NaN value normally means that the limit should be determined dynamically (by assessing the range of the available data points).
        Parameters:
        yRanges - array of (low,high) fixed range limits
      • getYRanges

        public double[][] getYRanges()
        Returns the data ranges for each different Y axis (one for each graph).
        Returns:
        array of (low,high) fixed range limits
        See Also:
        PlotState.setRanges(double[][])
      • setYLogFlags

        public void setYLogFlags​(boolean[] yLogFlags)
        Sets flags for which Y axes will be plotted logarithmically (one for each graph).
        Parameters:
        yLogFlags - Y log flags
      • getYLogFlags

        public boolean[] getYLogFlags()
        Returns flags for which Y axes will be plotted logarithmically (one for each graph).
        Returns:
        Y log flags
      • setYFlipFlags

        public void setYFlipFlags​(boolean[] yFlipFlags)
        Sets flags for which Y axes will be plotted inverted (one for each graph).
        Parameters:
        yFlipFlags - Y flip flags
      • getYFlipFlags

        public boolean[] getYFlipFlags()
        Returns flags for which Y axes will be plotted inverted (one for each graph).
        Returns:
        Y flip flags
      • setYZeroFlag

        public void setYZeroFlag​(boolean yZeroFlag)
        Sets whether a line should be drawn at y=0 on all the graphs.
        Parameters:
        yZeroFlag - true to draw y=0 lines
      • getYZeroFlag

        public boolean getYZeroFlag()
        Returns whether a line should be drawn at y=0 on all the graphs.
        Returns:
        true to draw y=0 lines
      • setYConverters

        public void setYConverters​(ValueConverter[] yConverters)
        Sets an array of numeric converter objects, one for the Y axis of each graph. The ValueConverter.unconvert(java.lang.Object) method of these should convert a numeric value back to the formatted (text) version of a value on the corresponding axis. Any of the elements may be null if the value is numeric anyway.
        Parameters:
        yConverters - Y numeric converter array, one for each graph
      • getYConverters

        public ValueConverter[] getYConverters()
        Returns the array of numeric converter objects, one for the Y axis of each graph.
        Returns:
        Y numeric converter array, one for each graph
      • setGraphIndices

        public void setGraphIndices​(int[] graphIndices)
        Sets the mapping of subsets to graph indices. This defines which graph each subset will be displayed in. The i'th element of the array gives the index of the graph that subset i will be displayed in.
        Parameters:
        graphIndices - subset to graph mapping
      • getGraphIndices

        public int[] getGraphIndices()
        Returns the mapping of subsets to graph indices.
        Returns:
        subset to graph mapping
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class PlotState
      • compare

        public java.lang.String compare​(PlotState o)
        Description copied from class: PlotState
        Returns a string giving a list of items in which this state differs from a given state o. This method is used only for debugging purposes, and may not be fully implemented at any given time.
        Overrides:
        compare in class PlotState
        Parameters:
        o - state for comparison with this one
        Returns:
        text summary of differences