public abstract class Plot
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Plot.PlotChangedListener
Listener to listen for changes in the plot data or properties.
|
static class |
Plot.PlotFlag
Flags to control plot drawing behavior.
|
static class |
Plot.PlotMarker
Class to mark entries in the plot.
|
static class |
Plot.PlotMarkerDefault
Default implementation of the PlotMarker.
|
static class |
Plot.PlotStyle
Possible plot drawing styles.
|
Modifier and Type | Field and Description |
---|---|
java.util.EnumSet<Plot.PlotFlag> |
flags
flags for various (drawing) behaviors
|
BooleanValueList |
inspectValues
List that maps a boolean value to every value in the values list to
indicate whether the drawing function has to inspect the mapped value
further for e.g.
|
boolean |
isVisible
whether the plot is drawn or not.
|
java.lang.String |
plotTitle
the plot's title
|
de.lme.plotview.PlotView.PlotScrollPolicy |
scrollHow |
Plot.PlotStyle |
style
how the plot entries are drawn/connected.
|
de.lme.plotview.Plot.PlotAxis |
valueAxis |
FloatValueList |
values
This array represents the actual values.
|
Constructor and Description |
---|
Plot()
Default constructor.
|
Plot(java.lang.String plotTitle,
Paint paint,
Plot.PlotStyle style,
int maxCache)
Constructor.
|
Plot(java.lang.String plotTitle,
Paint paint,
Plot.PlotStyle style,
int maxCache,
boolean maintainMinMax)
Overloaded constructor to specify maintainMinMax.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
drawGlobalMarks(Canvas can,
de.lme.plotview.PlotView.PlotSurface surface)
Draws global PlotMarkers, if there are any.
|
static Paint |
generatePlotPaint()
Generates a randomized (plot) Paint.
|
static Paint |
generatePlotPaint(float width,
int a,
int r,
int g,
int b)
Convenience method for generating plot paints.
|
static Paint |
generatePlotPaint(Style style,
int a,
int r,
int g,
int b)
Convenience method for generating plot paints.
|
Plot.PlotMarker |
getMarker(int entryIdx)
Returns the PlotMarker for the given entryIdx, if there exists one.
|
int |
getValueHead() |
abstract int |
loadFromFile(Context con,
java.io.InputStream streamIn)
Load m_file
|
abstract boolean |
saveToFile(Context con,
java.lang.String filePath,
java.lang.String header)
Saves the contents of this Plot to a m_file.
|
void |
setAxis(java.lang.String axisTitle,
java.lang.String unitName,
float multiplier) |
void |
setFile(java.lang.String newFile)
Sets a filename/path that will be used to save this Plot.
|
void |
setMarker(int entryIdx,
Plot.PlotMarker marker)
Sets a PlotMarker to the given entry.
|
void |
setMarker(Plot.PlotMarker marker)
Sets a marker for the current head value.
|
void |
setPaint(Paint p)
Sets the m_paint that will be used to draw the plot (lines).
|
void |
setViewport(int numIdx)
Sets the number of value indices to display
|
public FloatValueList values
public BooleanValueList inspectValues
true
a the given index, that value will be
inspected.public java.lang.String plotTitle
public de.lme.plotview.Plot.PlotAxis valueAxis
public boolean isVisible
public Plot.PlotStyle style
public java.util.EnumSet<Plot.PlotFlag> flags
public de.lme.plotview.PlotView.PlotScrollPolicy scrollHow
public Plot()
public Plot(java.lang.String plotTitle, Paint paint, Plot.PlotStyle style, int maxCache)
plotTitle
- title for the plotm_paint
- Paint to use for this plot. Can be null (default m_paint). Use
PlotView.generatePlotPaint to create various randomized paints
easily.style
- type of the plot.maxCache
- maximum number of entries to store. 0 means no limit. due to
performance issues it is HIGHLY recommended that you set this
value! you have to set this to 0 though if you manage the
arrays yourself!public Plot(java.lang.String plotTitle, Paint paint, Plot.PlotStyle style, int maxCache, boolean maintainMinMax)
plotTitle
- m_paint
- style
- maxCache
- maintainMinMax
- public void setAxis(java.lang.String axisTitle, java.lang.String unitName, float multiplier)
axisTitle
- unitName
- multiplier
- public void setPaint(Paint p)
p
- public void setFile(java.lang.String newFile)
newFile
- public static Paint generatePlotPaint()
public static Paint generatePlotPaint(float width, int a, int r, int g, int b)
width
- Width of the strokes (default: 1f)a
- Alpha valuer
- Redg
- Greenb
- Bluepublic static Paint generatePlotPaint(Style style, int a, int r, int g, int b)
style
- paint stylea
- Alpha valuer
- Redg
- Greenb
- Bluepublic void setMarker(Plot.PlotMarker marker)
marker
- public void setMarker(int entryIdx, Plot.PlotMarker marker)
entryIdx
- If -1 the Marker is always drawn, independently of any actual
points in this Plot.marker
- The PlotMarker used.public Plot.PlotMarker getMarker(int entryIdx)
entryIdx
- public void setViewport(int numIdx)
numIdx
- public void drawGlobalMarks(Canvas can, de.lme.plotview.PlotView.PlotSurface surface)
can
- surface
- public int getValueHead()
public void clear()
public abstract boolean saveToFile(Context con, java.lang.String filePath, java.lang.String header)
con
- Contextfilename
- public abstract int loadFromFile(Context con, java.io.InputStream streamIn)
con
- streamIn
-