Class AbstractPlotReportItem

    • Constructor Detail

      • AbstractPlotReportItem

        public AbstractPlotReportItem​(String title)
        Constructs a new report item containing a plotted density graphic. The graphic is stored in a temporary file. This is accessible via the getFilename method.
        Parameters:
        title - Title of the plotted graphic.
      • AbstractPlotReportItem

        public AbstractPlotReportItem​(String title,
                                      int height,
                                      int width,
                                      int fontSize)
        Constructs a new report item containing a plotted density graphic. The graphic is stored in a temporary file. This is accessible via the getFilename method.
        Parameters:
        title - Title of the plotted graphic.
        height - height of the plotted graphic.
        width - width of the plotted graphics.
        fontSize - the default pointsize of plotted text, interpreted at 72 dpi, so one point is approximately one pixel.
    • Method Detail

      • addData

        public void addData​(String id,
                            String displayName,
                            String rVariable)
        Adds a new data set to the plot.
        Parameters:
        id - Identifier for the data series.
        displayName - The display name for the data series.
        rVariable - The name of the R variable.
      • removeData

        public void removeData​(String id)
        Remove the data series from the plot.
        Parameters:
        id - Identifier of the data series.
      • getDataSeries

        protected String[] getDataSeries()
        Returns the identifiers for the data series.
        Returns:
        the identifiers.
      • getName

        protected String getName​(String id)
        Get the name for the data series.
        Parameters:
        id - The identifier of the data series.
        Returns:
        The name of the data series.
      • getDataCommand

        protected String getDataCommand​(String id)
        Get the R variable for the data series.
        Parameters:
        id - The identifier of the data series.
        Returns:
        The name of the data series.
      • getTemporaryRasterGraphicFilename

        public String getTemporaryRasterGraphicFilename()
        Returns the complete path to the temporary file containing the raster graphic.
        Returns:
        The complete path.
      • getTemporaryVectorGraphicFilename

        public String getTemporaryVectorGraphicFilename()
        Returns the complete path to the temporary file containing the vector graphic.
        Returns:
        The complete path.
      • generatePlotCommand

        protected abstract String generatePlotCommand()
        Overwrite this method to generate custom graphics.
        Returns:
        The R command which execution leads to the creation of the plot.
      • generateVectorGraphic

        public void generateVectorGraphic​(File pdfFile,
                                          RConnection rConnection)
        Exports the plot as vector graphic in the PDF format.
        Parameters:
        pdfFile - The file to which the graphic is saved.
        rConnection - The connection to the R engine.
      • generateRasterGraphic

        public void generateRasterGraphic​(File pngFile,
                                          RConnection rConnection)
        Exports the plot as raster graphic in the PNG format.
        Parameters:
        pngFile - The file to which the graphic is saved.
        rConnection - The connection to the R engine.
      • generateData

        public void generateData​(RConnection connection)
        Initializes the generation of data for the report item.
        Parameters:
        connection - connection to the R engine used for the generation
      • generateLinesLegend

        protected String generateLinesLegend()
        Returns the R commands which generate a line legend in R.
        Returns:
        The necessary R commands.
      • generateColorsLegend

        protected String generateColorsLegend()
        Returns the R commands which generate a color legend in R.
        Returns:
        The necessary R commads.