T
- type of graph render being profiled that is subclass of Graph2DRenderer
S
- dataset type that is associated with T the graph rendererpublic abstract class ProfileGraph2D<T extends Graph2DRenderer,S> extends Profiler
Graph2DRenderer
.
The base class for all graph profilers.
Has parameter T that is a graph renderer.
Has parameter S that is the dataset associated with T.
A profiler creates a loop in which a Graph2DRenderer perform multiple render operations.
Various options are provided to handle the profile statistics.Modifier and Type | Field and Description |
---|---|
protected S |
data |
static String |
LOG_FILEPATH
Default file path for all CSV log files of statistics.
|
protected T |
renderer |
Constructor and Description |
---|
ProfileGraph2D()
Creates a graph profiler.
|
Modifier and Type | Method and Description |
---|---|
protected abstract S |
getDataset()
The data that to be rendered in the render loop.
|
abstract String |
getGraphTitle()
Gets the type of graph renderer.
|
String |
getLogFileName()
Gets the name of the CSV file to save statistics to.
|
int |
getNumDataPoints()
Gets the size of the data set.
|
String |
getProfileTitle() |
protected abstract T |
getRenderer(int imageWidth,
int imageHeight)
The renderer used in the render loop.
|
RenderSettings |
getRenderSettings() |
Resolution |
getResolution() |
SaveSettings |
getSaveSettings()
Gets the settings to be saved to the output file
for a profile.
|
abstract LinkedHashMap<String,Graph2DRendererUpdate> |
getVariations()
Gets the updates associated with the renderer in a map, linking a
description of the update to the update object.
|
protected void |
iterationAction() |
protected void |
postIterationAction() |
protected void |
preLoopAction() |
protected abstract void |
render(Graphics2D graphics,
T renderer,
S data)
The primary method in the profiling render loop.
|
void |
saveImage() |
void |
saveStatistics()
Writes the profile statistics to a CSV file designated to the profile graph.
|
void |
setNumDataPoints(int nPoints)
Sets the size of the data set.
|
getProfileSettings, getStatistics, graphStatistics, printStatistics, profile, saveStatistics
public static final String LOG_FILEPATH
protected S data
protected T extends Graph2DRenderer renderer
protected void preLoopAction()
preLoopAction
in class Profiler
protected void iterationAction()
iterationAction
in class Profiler
protected void postIterationAction()
postIterationAction
in class Profiler
protected abstract S getDataset()
protected abstract T getRenderer(int imageWidth, int imageHeight)
getRenderer()
is capable of rendering getDataset()
.
Thus type T
is capable of rendering type S
.imageWidth
- pixel width of rendered imageimageHeight
- pixel height of rendered imageGraph2DRenderer
associated with data Sprotected abstract void render(Graphics2D graphics, T renderer, S data)
graphics
- where image draws torenderer
- what draws the imagedata
- what is drawnpublic abstract LinkedHashMap<String,Graph2DRendererUpdate> getVariations()
public void saveStatistics()
public void saveImage()
public String getProfileTitle()
getProfileTitle
in class Profiler
public abstract String getGraphTitle()
public String getLogFileName()
getGraphTitle()
.public SaveSettings getSaveSettings()
public RenderSettings getRenderSettings()
public Resolution getResolution()
public int getNumDataPoints()
public void setNumDataPoints(int nPoints)
nPoints
- size of the data set in renderingCopyright © 2015. All rights reserved.