Class ActualVsPredictedPlot

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ClearableDisplay, DisplayTypeSupporter, ErrorHandler, InputConsumer, ComponentSupplier, DisplayPanelProvider, AntiAliasingSupporter, MenuBarProvider, SendToActionSupporter, Serializable, Comparable

    public class ActualVsPredictedPlot
    extends AbstractGraphicalDisplay
    implements DisplayPanelProvider, AntiAliasingSupporter
    Plots actual vs predicted columns obtained from a spreadsheet.

    Input/output:
    - accepts:
       adams.data.spreadsheet.SpreadSheet


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ActualVsPredictedPlot
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; useful for critical 
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -short-title <boolean> (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
        default: false
     
    -display-type <adams.flow.core.displaytype.AbstractDisplayType> (property: displayType)
        Determines how to show the display, eg as standalone frame (default) or
        in the Flow editor window.
        default: adams.flow.core.displaytype.Default
     
    -width <int> (property: width)
        The width of the dialog.
        default: 800
        minimum: -1
     
    -height <int> (property: height)
        The height of the dialog.
        default: 350
        minimum: -1
     
    -x <int> (property: x)
        The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right
        ).
        default: -1
        minimum: -3
     
    -y <int> (property: y)
        The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom
        ).
        default: -1
        minimum: -3
     
    -writer <adams.gui.print.JComponentWriter> (property: writer)
        The writer to use for generating the graphics output.
        default: adams.gui.print.NullWriter
     
    -actual <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: actual)
        The column with the actual values.
        default: Actual
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
     
    -actual-min <double> (property: actualMin)
        The minimum to use for the display of the actual axis; use NaN for unlimited.
        default: -Infinity
     
    -actual-max <double> (property: actualMax)
        The maximum to use for the display of the actual axis; use NaN for unlimited.
        default: Infinity
     
    -predicted <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: predicted)
        The column with the predicted values.
        default: Predicted
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
     
    -predicted-min <double> (property: predictedMin)
        The minimum to use for the display of the predicted axis; use NaN for unlimited.
        default: -Infinity
     
    -predicted-max <double> (property: predictedMax)
        The maximum to use for the display of the predicted axis; use NaN for unlimited.
        default: Infinity
     
    -error <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: error)
        The column with the error values.
        default:
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
     
    -additional <adams.data.spreadsheet.SpreadSheetColumnRange> (property: additional)
        The additional columns to add to the plot containers.
        default:
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
     
    -use-column-names-as-titles <boolean> (property: useColumnNamesAsTitles)
        If enabled, the column titles in the spreadsheet are used as axes titles.
        default: false
     
    -swap-axes <boolean> (property: swapAxes)
        If enabled, the axes get swapped.
        default: false
     
    -title <java.lang.String> (property: title)
        The (optional) title of the plot.
        default:
     
    -plot-name <java.lang.String> (property: plotName)
        The (optional) name for the plot.
        default:
     
    -limit <NONE|ACTUAL|SPECIFIED> (property: limit)
        The type of limit to impose on the axes; NONE just uses the range determined
        from the data; ACTUAL uses the min/max from the actual column for both axes;
         SPECIFIED uses the specified limits or, if a value is 'infinity' then the
        corresponding value from the determine range.
        default: NONE
     
    -show-side-panel <boolean> (property: showSidePanel)
        If enabled, the side panel gets displayed which allows access to the underlying
        data for the plot.
        default: true
     
    -diameter <int> (property: diameter)
        The diameter of the cross in pixels (if no error data supplied).
        default: 7
        minimum: 1
     
    -anti-aliasing-enabled <boolean> (property: antiAliasingEnabled)
        If enabled, uses anti-aliasing for drawing.
        default: true
     
    -meta-data-color <adams.gui.visualization.sequence.metadatacolor.AbstractMetaDataColor> (property: metaDataColor)
        The scheme to use for extracting the color from the meta-data; ignored if
        adams.gui.visualization.sequence.metadatacolor.Dummy.
        default: adams.gui.visualization.sequence.metadatacolor.Dummy
     
    -use-custom-paintlet <boolean> (property: useCustomPaintlet)
        If enabled, the custom paintlet is used instead of cross/error paintlet,
        anti-aliasing and meta-data color scheme.
        default: false
     
    -custom-paintlet <adams.gui.visualization.sequence.XYSequencePaintlet> (property: customPaintlet)
        The custom paintlet to use instead of cross/error paintlet, anti-aliasing
        and meta-data color scheme.
        default: adams.gui.visualization.sequence.MetaDataValuePaintlet -meta-data-color adams.gui.visualization.sequence.metadatacolor.Dummy
     
    -overlay <adams.gui.visualization.sequence.XYSequencePaintlet> [-overlay ...] (property: overlays)
        The overlays to use in the plot.
        default: adams.gui.visualization.sequence.StraightLineOverlayPaintlet
     
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_UseColumnNamesAsTitles

        protected boolean m_UseColumnNamesAsTitles
        whether to use the column names as axes titles.
      • m_SwapAxes

        protected boolean m_SwapAxes
        whether to swap the axes.
      • m_Title

        protected String m_Title
        the title.
      • m_PlotName

        protected String m_PlotName
        the (optional) plot name.
      • m_ActualMin

        protected double m_ActualMin
        the minimum to use for the actual values (neg inf = no restriction).
      • m_ActualMax

        protected double m_ActualMax
        the maximum to use for the actual values (pos inf = no restriction).
      • m_PredictedMin

        protected double m_PredictedMin
        the minimum to use for the predicted values (neg inf = no restriction).
      • m_PredictedMax

        protected double m_PredictedMax
        the maximum to use for the predicted values (pos inf = no restriction).
      • m_Additional

        protected SpreadSheetColumnRange m_Additional
        the additional columns in the spreadsheet to add to the plot containers.
      • m_ShowSidePanel

        protected boolean m_ShowSidePanel
        whether to show the side panel.
      • m_Diameter

        protected int m_Diameter
        the diameter of the cross.
      • m_AntiAliasingEnabled

        protected boolean m_AntiAliasingEnabled
        whether anti-aliasing is enabled.
      • m_MetaDataColor

        protected AbstractMetaDataColor m_MetaDataColor
        for obtaining the color from the meta-data.
      • m_UseCustomPaintlet

        protected boolean m_UseCustomPaintlet
        whether to use a custom paintlet.
    • Constructor Detail

      • ActualVsPredictedPlot

        public ActualVsPredictedPlot()
    • Method Detail

      • getDefaultWidth

        protected int getDefaultWidth()
        Returns the default width for the dialog.
        Overrides:
        getDefaultWidth in class AbstractDisplay
        Returns:
        the default width
      • getDefaultHeight

        protected int getDefaultHeight()
        Returns the default height for the dialog.
        Overrides:
        getDefaultHeight in class AbstractDisplay
        Returns:
        the default height
      • setActual

        public void setActual​(SpreadSheetColumnIndex value)
        Sets the column with the actual values.
        Parameters:
        value - the column
      • getActual

        public SpreadSheetColumnIndex getActual()
        Returns the column with the actual values.
        Returns:
        the range
      • actualTipText

        public String actualTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setActualMin

        public void setActualMin​(double value)
        Sets the lower limit in use for the actual values.
        Parameters:
        value - the limit, neg inf if unlimited
      • getActualMin

        public double getActualMin()
        Returns the lower limit in use for the actual values.
        Returns:
        the limit, neg inf if unlimited
      • actualMinTipText

        public String actualMinTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setActualMax

        public void setActualMax​(double value)
        Sets the upper limit in use for the actual values.
        Parameters:
        value - the limit, pos inf if unlimited
      • getActualMax

        public double getActualMax()
        Returns the upper limit in use for the actual values.
        Returns:
        the limit, pos inf if unlimited
      • actualMaxTipText

        public String actualMaxTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPredicted

        public void setPredicted​(SpreadSheetColumnIndex value)
        Sets the column with the predicted values.
        Parameters:
        value - the column
      • getPredicted

        public SpreadSheetColumnIndex getPredicted()
        Returns the column with the predicted values.
        Returns:
        the range
      • predictedTipText

        public String predictedTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPredictedMin

        public void setPredictedMin​(double value)
        Sets the lower limit in use for the predicted values.
        Parameters:
        value - the limit, neg inf if unlimited
      • getPredictedMin

        public double getPredictedMin()
        Returns the lower limit in use for the predicted values.
        Returns:
        the limit, neg inf if unlimited
      • predictedMinTipText

        public String predictedMinTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPredictedMax

        public void setPredictedMax​(double value)
        Sets the upper limit in use for the predicted values.
        Parameters:
        value - the limit, pos inf if unlimited
      • getPredictedMax

        public double getPredictedMax()
        Returns the upper limit in use for the predicted values.
        Returns:
        the limit, pos inf if unlimited
      • predictedMaxTipText

        public String predictedMaxTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setError

        public void setError​(SpreadSheetColumnIndex value)
        Sets the column with the error values.
        Parameters:
        value - the column
      • getError

        public SpreadSheetColumnIndex getError()
        Returns the column with the error values.
        Returns:
        the column
      • errorTipText

        public String errorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAdditional

        public void setAdditional​(SpreadSheetColumnRange value)
        Sets the additional columns to add to the plot containers.
        Parameters:
        value - the columns
      • getAdditional

        public SpreadSheetColumnRange getAdditional()
        Returns the additional columns to add to the plot containers.
        Returns:
        the columns
      • additionalTipText

        public String additionalTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseColumnNamesAsTitles

        public void setUseColumnNamesAsTitles​(boolean value)
        Sets whether to use the column names as titles for the axes.
        Parameters:
        value - true if to use
      • getUseColumnNamesAsTitles

        public boolean getUseColumnNamesAsTitles()
        Returns whether to use the column names as titles for the axes.
        Returns:
        true if to use
      • useColumnNamesAsTitlesTipText

        public String useColumnNamesAsTitlesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSwapAxes

        public void setSwapAxes​(boolean value)
        Sets whether to swap the axes.
        Parameters:
        value - true if to swap
      • getSwapAxes

        public boolean getSwapAxes()
        Returns whether to swap the axes.
        Returns:
        true if to swap
      • swapAxesTipText

        public String swapAxesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTitle

        public void setTitle​(String value)
        Sets the (optional) title of the plot.
        Parameters:
        value - the title
      • getTitle

        public String getTitle()
        Returns the (optional) title of the plot.
        Returns:
        the title
      • titleTipText

        public String titleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPlotName

        public void setPlotName​(String value)
        Sets the (optional) name for the plot.
        Parameters:
        value - the name
      • getPlotName

        public String getPlotName()
        Returns the (optional) name for the plot.
        Returns:
        the name
      • plotNameTipText

        public String plotNameTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • limitTipText

        public String limitTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setShowSidePanel

        public void setShowSidePanel​(boolean value)
        Sets whether to show the side panel.
        Parameters:
        value - true if to show
      • getShowSidePanel

        public boolean getShowSidePanel()
        Returns whether to show the side panel.
        Returns:
        the limit type
      • showSidePanelTipText

        public String showSidePanelTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setDiameter

        public void setDiameter​(int value)
        Sets the cross diameter.
        Parameters:
        value - the diameter
      • getDiameter

        public int getDiameter()
        Returns the diameter of the cross.
        Returns:
        the diameter
      • diameterTipText

        public String diameterTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAntiAliasingEnabled

        public void setAntiAliasingEnabled​(boolean value)
        Sets whether to use anti-aliasing.
        Specified by:
        setAntiAliasingEnabled in interface AntiAliasingSupporter
        Parameters:
        value - if true then anti-aliasing is used
      • isAntiAliasingEnabled

        public boolean isAntiAliasingEnabled()
        Returns whether anti-aliasing is used.
        Specified by:
        isAntiAliasingEnabled in interface AntiAliasingSupporter
        Returns:
        true if anti-aliasing is used
      • antiAliasingEnabledTipText

        public String antiAliasingEnabledTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMetaDataColor

        public void setMetaDataColor​(AbstractMetaDataColor value)
        Sets the scheme for extracting the color from the meta-data.
        Parameters:
        value - the scheme
      • getMetaDataColor

        public AbstractMetaDataColor getMetaDataColor()
        Returns the scheme for extracting the color from the meta-data.
        Returns:
        the scheme
      • metaDataColorTipText

        public String metaDataColorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseCustomPaintlet

        public void setUseCustomPaintlet​(boolean value)
        Sets whether to use the custom paintlet.
        Parameters:
        value - true if custom
      • getUseCustomPaintlet

        public boolean getUseCustomPaintlet()
        Returns whether to use the custom paintlet.
        Returns:
        true if custom
      • useCustomPaintletTipText

        public String useCustomPaintletTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCustomPaintlet

        public void setCustomPaintlet​(XYSequencePaintlet value)
        Sets the custom paintlet.
        Parameters:
        value - the paintlet
      • getCustomPaintlet

        public XYSequencePaintlet getCustomPaintlet()
        Returns the custom paintlet.
        Returns:
        the paintlet
      • customPaintletTipText

        public String customPaintletTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOverlays

        public void setOverlays​(XYSequencePaintlet[] value)
        Sets the overlays to use in the plot.
        Parameters:
        value - the overlays
      • getOverlays

        public XYSequencePaintlet[] getOverlays()
        Returns the overlays to use in the plot.
        Returns:
        the overlays
      • overlaysTipText

        public String overlaysTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        the Class of objects that can be processed
      • getDefaultAxisX

        protected AxisPanelOptions getDefaultAxisX()
        Returns the setup for the X axis.
        Returns:
        the setup
      • getDefaultAxisY

        protected AxisPanelOptions getDefaultAxisY()
        Returns the setup for the Y axis.
        Returns:
        the setup
      • addData

        protected void addData​(SequencePlotterPanel panel,
                               SpreadSheet sheet)
        Adds the spreadsheet to the given panel.
        Parameters:
        panel - the panel to the add the spreadsheet data to
        sheet - the data to add
      • display

        protected void display​(Token token)
        Displays the token (the panel and dialog have already been created at this stage).
        Specified by:
        display in class AbstractDisplay
        Parameters:
        token - the token to display
      • displayPanelRequiresScrollPane

        public boolean displayPanelRequiresScrollPane()
        Returns whether the created display panel requires a scroll pane or not.
        Specified by:
        displayPanelRequiresScrollPane in interface DisplayPanelProvider
        Returns:
        true if the display panel requires a scroll pane