Class AbstractPlotReportItem
java.lang.Object
de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.AbstractRReportItem
de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.AbstractPlotReportItem
- All Implemented Interfaces:
IReportItem
- Direct Known Subclasses:
CdfReportItem
,HistogramReportItem
,PdfReportItem
,TimeSeriesReportItem
Report item to display generated graphics.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Position of the legend relative to the plot. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default font size for the graphic.static final int
Default size of the graphic.static final AbstractPlotReportItem.LegendPosition
Default position of the legend.Fields inherited from class de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.AbstractRReportItem
DEFAULT_DESCRIPTION
-
Constructor Summary
ConstructorDescriptionAbstractPlotReportItem
(String title) Constructs a new report item containing a plotted density graphic.AbstractPlotReportItem
(String title, int height, int width, int fontSize) Constructs a new report item containing a plotted density graphic. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new data set to the plot.protected String
Returns the R commands which generate a color legend in R.void
generateData
(RConnection connection) Initializes the generation of data for the report item.protected String
Returns the R commands which generate a line legend in R.protected abstract String
Overwrite this method to generate custom graphics.void
generateRasterGraphic
(File pngFile, RConnection rConnection) Exports the plot as raster graphic in the PNG format.void
generateVectorGraphic
(File pdfFile, RConnection rConnection) Exports the plot as vector graphic in the PDF format.protected String
getDataCommand
(String id) Get the R variable for the data series.protected String[]
Returns the identifiers for the data series.protected String
Get the name for the data series.Returns the complete path to the temporary file containing the raster graphic.Returns the complete path to the temporary file containing the vector graphic.void
removeData
(String id) Remove the data series from the plot.void
setLegendPos
(AbstractPlotReportItem.LegendPosition newLegendPosition) Sets the legend position.void
Used by the visitor to display the report item.Methods inherited from class de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.AbstractRReportItem
getDescription
-
Field Details
-
DEFAULT_LEGEND_POSITION
Default position of the legend. -
DEFAULT_GRAPHIC_SIZE
public static final int DEFAULT_GRAPHIC_SIZEDefault size of the graphic.- See Also:
-
DEFAULT_FONT_SIZE
public static final int DEFAULT_FONT_SIZEDefault font size for the graphic.- See Also:
-
-
Constructor Details
-
AbstractPlotReportItem
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
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 Details
-
addData
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
Remove the data series from the plot.- Parameters:
id
- Identifier of the data series.
-
getDataSeries
Returns the identifiers for the data series.- Returns:
- the identifiers.
-
getName
Get the name for the data series.- Parameters:
id
- The identifier of the data series.- Returns:
- The name of the data series.
-
getDataCommand
Get the R variable for the data series.- Parameters:
id
- The identifier of the data series.- Returns:
- The name of the data series.
-
visit
Used by the visitor to display the report item. Used to render the report item.- Specified by:
visit
in interfaceIReportItem
- Specified by:
visit
in classAbstractRReportItem
- Parameters:
v
- Visitor used for rendering the content of each item.
-
getTemporaryRasterGraphicFilename
Returns the complete path to the temporary file containing the raster graphic.- Returns:
- The complete path.
-
getTemporaryVectorGraphicFilename
Returns the complete path to the temporary file containing the vector graphic.- Returns:
- The complete path.
-
generatePlotCommand
Overwrite this method to generate custom graphics.- Returns:
- The R command which execution leads to the creation of the plot.
-
generateVectorGraphic
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
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
Initializes the generation of data for the report item.- Parameters:
connection
- connection to the R engine used for the generation
-
generateLinesLegend
Returns the R commands which generate a line legend in R.- Returns:
- The necessary R commands.
-
generateColorsLegend
Returns the R commands which generate a color legend in R.- Returns:
- The necessary R commads.
-
setLegendPos
Sets the legend position.- Parameters:
newLegendPosition
- New position to set.
-