Class JLDataView
java.lang.Object
fr.esrf.tangoatk.widget.util.chart.JLDataView
- All Implemented Interfaces:
Serializable
A class to handle data view. It handles data and all graphics stuff related to a serie of data.
- Author:
- JL Pons
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFixed X and Y coordinates in pixelstatic final intFollow X axis scale, Fixed Y coordinates in pixelstatic final intFollow Y axis scale, Fixed X coordinates in pixelstatic final intNormal drawing modestatic final intHatch fill stylestatic final intHatch fill stylestatic final intHatch fill stylestatic final intHatch fill stylestatic final intHatch fill stylestatic final intHatch fill stylestatic final intNo fillingstatic final intHatch fill stylestatic final intHatch fill stylestatic final intHatch fill stylestatic final intSolid fill stylestatic final intCosine interpolation methodstatic final intstatic final intstatic final intLinear interpolation methodstatic final intNo interpolationstatic final intDisplay a box for each point of the viewstatic final intDisplay a circle for each point of the viewstatic final intDisplay a cross for each point of the viewstatic final intDisplay a diamond for each point of the viewstatic final intDisplay a dot for each point of the viewstatic final intDisplay an horizontal line for each point of the viewstatic final intNo marker displayedstatic final intDisplay a square for each point of the viewstatic final intDisplay a start for each point of the viewstatic final intDisplay a triangle for each point of the viewstatic final intDisplay a vertical line for each point of the viewstatic final intDerivative operationstatic final intFFT (modulus) operationstatic final intFFT (phase) operationstatic final intIntegral operationstatic final intNo mathematical operationstatic final intFill curve and bar from the bottom of the graphstatic final intFill curve and bar from the top of the graphstatic final intFill curve and bar from zero position (on Yaxis)static final doubleNaN value used with y to represent a negative infinity valuestatic final doubleNaN value used with y to represent a null valuestatic final doubleNaN value used with y to represent a positive infinity valuestatic final intflat smoothing extrapolation (duplicate last and end value)static final intLinear smoothing extrapolation (linear extrapolation)static final intNo smoothing extrapolationstatic final intFlat smoothing (Flat shape)static final intGaussian smoothing (Gaussian shape)static final intNo smoothingstatic final intLinear smoothing (Triangular shape)static final intDash line stylestatic final intDash + Dot line stylestatic final intDot line stylestatic final intLong Dash line stylestatic final intSolid line stylestatic final intBarGraph stylestatic final intLine styleprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double x, double y) Add datum to the dataview.voidadd(double x, double y, boolean updateFilter) Add datum to the dataview.voidAdd datum to the dataview.voidAdd a listener to this dataview, triggered when a setting change.voidapplyConfiguration(String prefix, CfFileReader f) Apply dataview configuration.voidvoidCommit change when some data has been in modified in the DataList (via getData())voidComputes and stores min and max on x and ydoubleCompute minimun of positive value.double[]Expert usage.formatValue(double v) Format the given value according the userFormat or to the Axis format.voidgarbagePointLimit(int garbageLimit) Garbage old data according to data length.intgarbagePointTime(double garbageLimit) Garbage old data according to time.doublegetA0()Gets the A0 transformation coeficient.doublegetA1()Gets the A1 transformation coeficient.doublegetA2()Gets the A2 transformation coeficient.getAxis()Expert usage.getBarFillColorAt(int idx) Return the fill color for the specified indexGets the filling color vector for a barchart.intGets the bar width.getColor()Gets the curve color.getConfiguration(String prefix) Build a configuration string that can be write into a file and is compatible with CfFileReader.getData()Return a handle on the data.intGets the number of data in this view.double[][]double[][]intReturns the drawingModeGets the extended name.Gets the filling color.intGets the current filling style.intGets the current filling style.static StringdoubledoubleintintGet last value.Get last value ignoring filterintGets the line width.intGets the marker type.Gets the marker color.intGets the marker size.intdoubleExpert usage.doubleExpert usage.doubleExpert usage.doubleExpert usage.doubleExpert usage.doubleExpert usage.getName()Gets the view name.doubleExpert usage.doubleExpert usage.booleandoubleintdoubleintintdouble[]double[]intgetStyle()Gets the line style.doublegetTransformedValue(double x) Compute transformed value of x.getUnit()Gets the dataView unit.intGets view type.doublegetXValueByIndex(int idx) Returns X value according to index.doublegetYValueByIndex(int idx) Returns Y value according to index.booleanDetermines wether this view is affected by a transform.booleanDetermines wether this views has a transformation.booleanbooleanbooleanisFill()Provided for backward compatibility.booleanbooleanReturns whether data is supposed to be sorted on x or notstatic voidmergeSort(double[] array, double[] associated) Applies merge sort on an array of double.voidvoidConvenience function for removing this dataview from its axis (if any)voidreset()Clear all data in this view.voidsetA0(double d) Set A0 transformation coeficient.voidsetA1(double d) Set A1 transformation coeficient.voidsetA2(double d) Set A2 transformation coeficient.voidExpert usage.voidsetBarFillColorAt(int idx, Color fillColor) Change the default bar filling color for the specified index.voidsetBarFillColors(Vector<ColorItem> bfColors) Sets the filling color vector for a barchart.voidsetBarWidth(int w) Sets the width of the bar in pixel (Bar graph mode).voidsetClickable(boolean b) Sets this view clickable or not.voidSets the color of the curve.voidsetData(double[] x, double[] y) Set data of this dataview.voidsetDrawingMode(int mode) Sets the drawing modevoidsetDrawOnNaN(boolean drawOnNaN) In Bar chart mode, draw a bar up to the yAxis maximum on a NaN valuevoidsetFill(boolean b) Provided for backward compatibility.voidSets the filling color of this dataView.voidsetFillMethod(int m) Sets the filling method for this view.voidsetFillStyle(int b) Sets the filling style of this view.voidsetHermiteBias(double bias) Set the Hermite interpolation bias coefficient.voidsetHermiteTension(double tension) Set the Hermite interpolation tension coefficientvoidsetInterpolationMethod(int method) Set an interpolation on this dataview using the specified method.voidsetInterpolationStep(int step) Sets the interpolation stepvoidsetLabelColor(Color labelColor) voidsetLabelVisible(boolean b) Display the label of this view when true.voidsetLineWidth(int c) Sets the line width (pixel).voidsetMarker(int m) Sets the marker type.voidSets the marker color.voidsetMarkerSize(int c) Sets the marker size (pixel).voidsetMathFunction(int function) Sets a mathematical functionvoidSets the view name.voidsetRemoveAverage(boolean remove) Remove average when calculating FFTvoidsetSamplingFrequency(double f) Sets the smapling freqncy used for FFT calculationvoidsetSmoothingExtrapolation(int extMode) Sets the extrapolation method used in smoothing operationvoidsetSmoothingGaussSigma(double sigma) Sets the standard deviation of the gaussian (Smoothing filter).voidsetSmoothingMethod(int method) Sets the smoothing method (Convolution product).voidsetSmoothingNeighbors(int n) Sets number of neighbors for smoothingvoidsetStyle(int c) Set the plot line style.voidSet the dataView unit.voidsetUnorderedData(double[] x, double[] y) Set data of this dataview and order value according to the x valuevoidsetUserFormat(String format) Sets the format property for this dataview (C format).voidsetViewType(int s) Sets the graph type (Line or BarGraph).voidsetXDataSorted(boolean dataSorted) Set whether data is supposed to be sorted on x or not.voidUpdate filter calulation.
-
Field Details
-
MARKER_NONE
public static final int MARKER_NONENo marker displayed- See Also:
-
MARKER_DOT
public static final int MARKER_DOTDisplay a dot for each point of the view- See Also:
-
MARKER_BOX
public static final int MARKER_BOXDisplay a box for each point of the view- See Also:
-
MARKER_TRIANGLE
public static final int MARKER_TRIANGLEDisplay a triangle for each point of the view- See Also:
-
MARKER_DIAMOND
public static final int MARKER_DIAMONDDisplay a diamond for each point of the view- See Also:
-
MARKER_STAR
public static final int MARKER_STARDisplay a start for each point of the view- See Also:
-
MARKER_VERT_LINE
public static final int MARKER_VERT_LINEDisplay a vertical line for each point of the view- See Also:
-
MARKER_HORIZ_LINE
public static final int MARKER_HORIZ_LINEDisplay an horizontal line for each point of the view- See Also:
-
MARKER_CROSS
public static final int MARKER_CROSSDisplay a cross for each point of the view- See Also:
-
MARKER_CIRCLE
public static final int MARKER_CIRCLEDisplay a circle for each point of the view- See Also:
-
MARKER_SQUARE
public static final int MARKER_SQUAREDisplay a square for each point of the view- See Also:
-
STYLE_SOLID
public static final int STYLE_SOLIDSolid line style- See Also:
-
STYLE_DOT
public static final int STYLE_DOTDot line style- See Also:
-
STYLE_DASH
public static final int STYLE_DASHDash line style- See Also:
-
STYLE_LONG_DASH
public static final int STYLE_LONG_DASHLong Dash line style- See Also:
-
STYLE_DASH_DOT
public static final int STYLE_DASH_DOTDash + Dot line style- See Also:
-
TYPE_LINE
public static final int TYPE_LINELine style- See Also:
-
TYPE_BAR
public static final int TYPE_BARBarGraph style- See Also:
-
METHOD_FILL_FROM_TOP
public static final int METHOD_FILL_FROM_TOPFill curve and bar from the top of the graph- See Also:
-
METHOD_FILL_FROM_ZERO
public static final int METHOD_FILL_FROM_ZEROFill curve and bar from zero position (on Yaxis)- See Also:
-
METHOD_FILL_FROM_BOTTOM
public static final int METHOD_FILL_FROM_BOTTOMFill curve and bar from the bottom of the graph- See Also:
-
FILL_STYLE_NONE
public static final int FILL_STYLE_NONENo filling- See Also:
-
FILL_STYLE_SOLID
public static final int FILL_STYLE_SOLIDSolid fill style- See Also:
-
FILL_STYLE_LARGE_RIGHT_HATCH
public static final int FILL_STYLE_LARGE_RIGHT_HATCHHatch fill style- See Also:
-
FILL_STYLE_LARGE_LEFT_HATCH
public static final int FILL_STYLE_LARGE_LEFT_HATCHHatch fill style- See Also:
-
FILL_STYLE_LARGE_CROSS_HATCH
public static final int FILL_STYLE_LARGE_CROSS_HATCHHatch fill style- See Also:
-
FILL_STYLE_SMALL_RIGHT_HATCH
public static final int FILL_STYLE_SMALL_RIGHT_HATCHHatch fill style- See Also:
-
FILL_STYLE_SMALL_LEFT_HATCH
public static final int FILL_STYLE_SMALL_LEFT_HATCHHatch fill style- See Also:
-
FILL_STYLE_SMALL_CROSS_HATCH
public static final int FILL_STYLE_SMALL_CROSS_HATCHHatch fill style- See Also:
-
FILL_STYLE_DOT_PATTERN_1
public static final int FILL_STYLE_DOT_PATTERN_1Hatch fill style- See Also:
-
FILL_STYLE_DOT_PATTERN_2
public static final int FILL_STYLE_DOT_PATTERN_2Hatch fill style- See Also:
-
FILL_STYLE_DOT_PATTERN_3
public static final int FILL_STYLE_DOT_PATTERN_3Hatch fill style- See Also:
-
NAN_FOR_NULL
public static final double NAN_FOR_NULLNaN value used with y to represent a null value -
NAN_FOR_POSITIVE_INFINITY
public static final double NAN_FOR_POSITIVE_INFINITYNaN value used with y to represent a positive infinity value -
NAN_FOR_NEGATIVE_INFINITY
public static final double NAN_FOR_NEGATIVE_INFINITYNaN value used with y to represent a negative infinity value -
INTERPOLATE_NONE
public static final int INTERPOLATE_NONENo interpolation- See Also:
-
INTERPOLATE_LINEAR
public static final int INTERPOLATE_LINEARLinear interpolation method- See Also:
-
INTERPOLATE_COSINE
public static final int INTERPOLATE_COSINECosine interpolation method- See Also:
-
INTERPOLATE_CUBIC
public static final int INTERPOLATE_CUBIC- See Also:
-
INTERPOLATE_HERMITE
public static final int INTERPOLATE_HERMITE- See Also:
-
SMOOTH_NONE
public static final int SMOOTH_NONENo smoothing- See Also:
-
SMOOTH_FLAT
public static final int SMOOTH_FLATFlat smoothing (Flat shape)- See Also:
-
SMOOTH_TRIANGULAR
public static final int SMOOTH_TRIANGULARLinear smoothing (Triangular shape)- See Also:
-
SMOOTH_GAUSSIAN
public static final int SMOOTH_GAUSSIANGaussian smoothing (Gaussian shape)- See Also:
-
SMOOTH_EXT_NONE
public static final int SMOOTH_EXT_NONENo smoothing extrapolation- See Also:
-
SMOOTH_EXT_FLAT
public static final int SMOOTH_EXT_FLATflat smoothing extrapolation (duplicate last and end value)- See Also:
-
SMOOTH_EXT_LINEAR
public static final int SMOOTH_EXT_LINEARLinear smoothing extrapolation (linear extrapolation)- See Also:
-
MATH_NONE
public static final int MATH_NONENo mathematical operation- See Also:
-
MATH_DERIVATIVE
public static final int MATH_DERIVATIVEDerivative operation- See Also:
-
MATH_INTEGRAL
public static final int MATH_INTEGRALIntegral operation- See Also:
-
MATH_FFT_MODULUS
public static final int MATH_FFT_MODULUSFFT (modulus) operation- See Also:
-
MATH_FFT_PHASE
public static final int MATH_FFT_PHASEFFT (phase) operation- See Also:
-
DRAWMODE_NORMAL
public static final int DRAWMODE_NORMALNormal drawing mode- See Also:
-
DRAWMODE_FOLLOWX
public static final int DRAWMODE_FOLLOWXFollow X axis scale, Fixed Y coordinates in pixel- See Also:
-
DRAWMODE_FOLLOWY
public static final int DRAWMODE_FOLLOWYFollow Y axis scale, Fixed X coordinates in pixel- See Also:
-
DRAWMODE_FOLLOWNONE
public static final int DRAWMODE_FOLLOWNONEFixed X and Y coordinates in pixel- See Also:
-
xDataSorted
protected boolean xDataSorted
-
-
Constructor Details
-
JLDataView
public JLDataView()DataView constructor.
-
-
Method Details
-
getHelpString
- Returns:
- a string containing the configuration file help.
-
setViewType
public void setViewType(int s) Sets the graph type (Line or BarGraph). -
getViewType
public int getViewType()Gets view type.- Returns:
- View type
- See Also:
-
setFillStyle
public void setFillStyle(int b) Sets the filling style of this view.- Parameters:
b- Filling style- See Also:
-
getFillStyle
public int getFillStyle()Gets the current filling style.- Returns:
- Filling style
- See Also:
-
setFillMethod
public void setFillMethod(int m) Sets the filling method for this view.- Parameters:
m- Filling method- See Also:
-
getFillMethod
public int getFillMethod()Gets the current filling style.- Returns:
- Filling method
- See Also:
-
setFillColor
Sets the filling color of this dataView.- Parameters:
c- Filling color- See Also:
-
getFillColor
Gets the filling color.- Returns:
- Filling color
- See Also:
-
setBarFillColorAt
Change the default bar filling color for the specified index.- Parameters:
idx- Value indexfillColor- Filling color
-
getBarFillColorAt
Return the fill color for the specified index- Parameters:
idx- Value index- Returns:
- The filling color or default fill color if index not found.
-
setBarFillColors
Sets the filling color vector for a barchart.- Parameters:
bfColors- A vector of Filling colors for barchart- See Also:
-
getBarFillColors
Gets the filling color vector for a barchart.- Returns:
- A vector of Filling colors for barchart
- See Also:
-
setColor
Sets the color of the curve.- Parameters:
c- Curve color- See Also:
-
getColor
Gets the curve color.- Returns:
- Curve color
- See Also:
-
isFill
public boolean isFill()Provided for backward compatibility.- Returns:
- true if the view is filled, false otherwise
- See Also:
-
setFill
public void setFill(boolean b) Provided for backward compatibility.- Parameters:
b- true if the view is filled, false otherwise- See Also:
-
setClickable
public void setClickable(boolean b) Sets this view clickable or not. When set to false, this view is excluded from the search that occurs when the user click on the chart. Default is true.- Parameters:
b- Clickable state
-
isClickable
public boolean isClickable()- Returns:
- the clickable state.
- See Also:
-
setLabelVisible
public void setLabelVisible(boolean b) Display the label of this view when true. This has effects only if the parent chart has visible labels.- Parameters:
b- visible state- See Also:
-
isLabelVisible
public boolean isLabelVisible()- Returns:
- true when the label is visible.
- See Also:
-
getLabelColor
-
setLabelColor
-
setInterpolationMethod
public void setInterpolationMethod(int method) Set an interpolation on this dataview using the specified method. (Cubic interpolation requires constant x interval)- Parameters:
method- Interpolation method- See Also:
-
getInterpolationMethod
public int getInterpolationMethod()- Returns:
- current interpolation mode.
- See Also:
-
setInterpolationStep
public void setInterpolationStep(int step) Sets the interpolation step- Parameters:
step- Interpolation step (must be >=2)- See Also:
-
getInterpolationStep
public int getInterpolationStep()- Returns:
- the interpolation step.
- See Also:
-
setHermiteTension
public void setHermiteTension(double tension) Set the Hermite interpolation tension coefficient- Parameters:
tension- Hermite interpolation tension coefficient (1=high, 0=normal, -1=low)
-
getHermiteTension
public double getHermiteTension()- Returns:
- the Hermite interpolation tension coefficient
- See Also:
-
setHermiteBias
public void setHermiteBias(double bias) Set the Hermite interpolation bias coefficient. 0 for no bias, positive value towards first segment, negative value towards the others.- Parameters:
bias- Hermite interpolation bias coefficient
-
getHermiteBias
public double getHermiteBias()- Returns:
- the Hermite interpolation bias coefficient.
-
setSmoothingMethod
public void setSmoothingMethod(int method) Sets the smoothing method (Convolution product). Requires constant x intervals.- Parameters:
method- Smoothing filer type- See Also:
-
getSmoothingMethod
public int getSmoothingMethod()- Returns:
- the smoothing method.
- See Also:
-
setSmoothingNeighbors
public void setSmoothingNeighbors(int n) Sets number of neighbors for smoothing- Parameters:
n- Number of neighbors (Must be >= 2)
-
getSmoothingNeighbors
public int getSmoothingNeighbors()- Returns:
- number of neighbors for smoothing
- See Also:
-
setSmoothingGaussSigma
public void setSmoothingGaussSigma(double sigma) Sets the standard deviation of the gaussian (Smoothing filter).- Parameters:
sigma- Standard deviation- See Also:
-
getSmoothingGaussSigma
public double getSmoothingGaussSigma()- Returns:
- the standard deviation of the gaussian (Smoothing filter).
- See Also:
-
setSmoothingExtrapolation
public void setSmoothingExtrapolation(int extMode) Sets the extrapolation method used in smoothing operation- Parameters:
extMode- Extrapolation mode- See Also:
-
getSmoothingExtrapolation
public int getSmoothingExtrapolation()- Returns:
- the extrapolation method used in smoothing operation.
- See Also:
-
setMathFunction
public void setMathFunction(int function) Sets a mathematical function- Parameters:
function- Function- See Also:
-
getMathFunction
public int getMathFunction()- Returns:
- the current math function.
- See Also:
-
setBarWidth
public void setBarWidth(int w) Sets the width of the bar in pixel (Bar graph mode). Pass 0 to have bar auto scaling.- Parameters:
w- Bar width (pixel)- See Also:
-
getBarWidth
public int getBarWidth()Gets the bar width.- Returns:
- Bar width (pixel)
- See Also:
-
setMarkerColor
Sets the marker color.- Parameters:
c- Marker color- See Also:
-
getMarkerColor
Gets the marker color.- Returns:
- Marker color
- See Also:
-
setStyle
public void setStyle(int c) Set the plot line style.- Parameters:
c- Line style- See Also:
-
getMarkerSize
public int getMarkerSize()Gets the marker size.- Returns:
- Marker size (pixel)
- See Also:
-
setMarkerSize
public void setMarkerSize(int c) Sets the marker size (pixel).- Parameters:
c- Marker size (pixel)- See Also:
-
getStyle
public int getStyle()Gets the line style.- Returns:
- Line style
- See Also:
-
getLineWidth
public int getLineWidth()Gets the line width.- Returns:
- Line width
- See Also:
-
setLineWidth
public void setLineWidth(int c) Sets the line width (pixel).- Parameters:
c- Line width (pixel)- See Also:
-
setName
Sets the view name.- Parameters:
s- Name of this view- See Also:
-
getName
Gets the view name.- Returns:
- Dataview name
- See Also:
-
setUnit
Set the dataView unit. (Used only for display)- Parameters:
s- Dataview unit.- See Also:
-
getUnit
Gets the dataView unit.- Returns:
- Dataview unit
- See Also:
-
getExtendedName
Gets the extended name. (including transform description when used)- Returns:
- Extended name of this view.
-
getMarker
public int getMarker()Gets the marker type.- Returns:
- Marker type
- See Also:
-
setMarker
public void setMarker(int m) Sets the marker type.- Parameters:
m- Marker type- See Also:
-
setDrawOnNaN
public void setDrawOnNaN(boolean drawOnNaN) In Bar chart mode, draw a bar up to the yAxis maximum on a NaN value- Parameters:
drawOnNaN- Draw on NaN flag
-
isDrawOnNaN
public boolean isDrawOnNaN() -
getA0
public double getA0()Gets the A0 transformation coeficient.- Returns:
- A0 value
- See Also:
-
getA1
public double getA1()Gets the A1 transformation coeficient.- Returns:
- A1 value
- See Also:
-
getA2
public double getA2()Gets the A2 transformation coeficient.- Returns:
- A2 value
- See Also:
-
setA0
public void setA0(double d) Set A0 transformation coeficient. The transformation computes new value = A0 + A1*v + A2*v*v. Transformation is disabled when A0=A2=0 and A1=1.- Parameters:
d- A0 value
-
setA1
public void setA1(double d) Set A1 transformation coeficient. The transformation computes new value = A0 + A1*v + A2*v*v. Transformation is disabled when A0=A2=0 and A1=1.- Parameters:
d- A1 value
-
setA2
public void setA2(double d) Set A2 transformation coeficient. The transformation computes new value = A0 + A1*v + A2*v*v. Transformation is disabled when A0=A2=0 and A1=1.- Parameters:
d- A2 value
-
hasTransform
public boolean hasTransform()Determines wether this views has a transformation.- Returns:
- false when A0=A2=0 and A1=1, true otherwise
-
hasFilter
public boolean hasFilter()Determines wether this view is affected by a transform.- Returns:
- false when no filtering true otherwise.
- See Also:
-
setAxis
Expert usage. Sets the parent axis. ( Used by JLAxis.addDataView() )- Parameters:
a- Parent axis
-
getAxis
Expert usage. Gets the parent axis.- Returns:
- Parent axis
-
getMinimum
public double getMinimum()Expert usage. Gets the minimum (Y axis).- Returns:
- Minimum value
-
getMaximum
public double getMaximum()Expert usage. Gets the maximum (Y axis).- Returns:
- Maximun value
-
getMinTime
public double getMinTime()Expert usage. Gets the minimun on X axis (with TIME_ANNO).- Returns:
- Minimum time
-
getMinXValue
public double getMinXValue()Expert usage. Gets the minimum on X axis.- Returns:
- Minimum x value
-
getPositiveMinXValue
public double getPositiveMinXValue()Expert usage. Get the positive minimum on X axis.- Returns:
- Minimum value strictly positive
-
getPositiveMinTime
public double getPositiveMinTime()Expert usage. Get the positive minimum on X axis.- Returns:
- Minimum value strictly positive
-
getMaxXValue
public double getMaxXValue()Expert usage. Get the maximum on X axis- Returns:
- Maximum x value
-
getMaxTime
public double getMaxTime()Expert usage. Get the maxinmun on X axis (with TIME_ANNO)- Returns:
- Maximum value
-
getDataLength
public int getDataLength()Gets the number of data in this view.- Returns:
- Data length
-
getData
Return a handle on the data. If you modify data, call commitChange() after the update. Expert usage.- Returns:
- A handle to the data.
- See Also:
-
commitChange
public void commitChange()Commit change when some data has been in modified in the DataList (via getData())- See Also:
-
add
public void add(double x, double y) Add datum to the dataview. If you call this routine directly the graph will be updated only after a repaint and your data won't be garbaged (if a display duration is specified). You should use JLChart.addData instead.- Parameters:
x- x coordinates (real space)y- y coordinates (real space)- See Also:
-
add
public void add(double x, double y, boolean updateFilter) Add datum to the dataview. If you call this routine directly the graph will be updated only after a repaint and your data won't be garbaged (if a display duration is specified). You should use JLChart.addData instead.- Parameters:
x- x coordinates (real space)y- y coordinates (real space)updateFilter- update filter flag.- See Also:
-
setData
public void setData(double[] x, double[] y) Set data of this dataview.- Parameters:
x- x valuesy- y values- See Also:
-
setUnorderedData
public void setUnorderedData(double[] x, double[] y) Set data of this dataview and order value according to the x value- Parameters:
x- x valuesy- y values- See Also:
-
add
Add datum to the dataview. If you call this routine directly the graph will be updated only after a repaint and your data won't be garbaged (if a display duration is specified). You should use JLChart.addData instead.- Parameters:
p- point (real space)- See Also:
-
garbagePointTime
public int garbagePointTime(double garbageLimit) Garbage old data according to time.- Parameters:
garbageLimit- Limit time (in millisec)- Returns:
- Number of deleted point.
-
garbagePointLimit
public void garbagePointLimit(int garbageLimit) Garbage old data according to data length. It will remove the (dataLength-garbageLimit) first points.- Parameters:
garbageLimit- Index limit
-
computeDataBounds
public void computeDataBounds()Computes and stores min and max on x and y -
computeTransformedMinMax
public double[] computeTransformedMinMax()Expert usage. Compute transformed min and max.- Returns:
- Transformed min and max
-
computePositiveMin
public double computePositiveMin()Compute minimun of positive value.- Returns:
- Double.MAX_VALUE when no positive value are found
-
getTransformedValue
public double getTransformedValue(double x) Compute transformed value of x.- Parameters:
x- Value to transform- Returns:
- transformed value (through A0,A1,A2 transformation)
-
getLastValue
Get last value.- Returns:
- Last value
-
getLastValueRaw
Get last value ignoring filter- Returns:
- Last value
-
reset
public void reset()Clear all data in this view. -
applyConfiguration
Apply dataview configuration.- Parameters:
prefix- settings prefixf- CfFileReader object wich contains dataview parametters- See Also:
-
getConfiguration
Build a configuration string that can be write into a file and is compatible with CfFileReader.- Parameters:
prefix- DataView prefix- Returns:
- A string containing param.
- See Also:
-
getYValueByIndex
public double getYValueByIndex(int idx) Returns Y value according to index.- Parameters:
idx- Value index- Returns:
- Y value
-
getXValueByIndex
public double getXValueByIndex(int idx) Returns X value according to index.- Parameters:
idx- Value index- Returns:
- X value
-
setUserFormat
Sets the format property for this dataview (C format). By default, it uses the Axis format.- Parameters:
format- Format (C style)
-
setDrawingMode
public void setDrawingMode(int mode) Sets the drawing mode- Parameters:
mode- Drawing mode- See Also:
-
getDrawingMode
public int getDrawingMode()Returns the drawingMode- Returns:
- Drawing mode
- See Also:
-
addChangeListener
Add a listener to this dataview, triggered when a setting change.- Parameters:
l- ChangeListener
-
removeChangeListener
-
clearChangeListener
public void clearChangeListener() -
getUserFormat
- Returns:
- the current user format (null when none).
-
formatValue
Format the given value according the userFormat or to the Axis format.- Parameters:
v- Value to be formated- Returns:
- The formatted string
-
isXDataSorted
public boolean isXDataSorted()Returns whether data is supposed to be sorted on x or not- Returns:
- a boolean value
-
setXDataSorted
public void setXDataSorted(boolean dataSorted) Set whether data is supposed to be sorted on x or not.falseby default- Parameters:
dataSorted- a boolean value
-
getSortedTimes
public double[] getSortedTimes() -
getSortedValues
public double[] getSortedValues() -
getDataSortedByTimes
public double[][] getDataSortedByTimes() -
getDataSortedByValues
public double[][] getDataSortedByValues() -
removeFromAxis
public void removeFromAxis()Convenience function for removing this dataview from its axis (if any) -
mergeSort
public static void mergeSort(double[] array, double[] associated) Applies merge sort on an array of double. If an associated array is given, its elements are moved the same way as the array to sort.- Parameters:
array- The array to sortassociated- The associated array. Must be null or of the same length ofarray
-
setRemoveAverage
public void setRemoveAverage(boolean remove) Remove average when calculating FFT- Parameters:
remove- True to remove average
-
getRemoveAverage
public boolean getRemoveAverage()- Returns:
- true if average is removed during FFT calculation
-
setSamplingFrequency
public void setSamplingFrequency(double f) Sets the smapling freqncy used for FFT calculation- Parameters:
f- Smapling frequnecy
-
getSamplingFrequency
public double getSamplingFrequency()- Returns:
- the smapling freqncy used for FFT calculation
-
updateFilters
public void updateFilters()Update filter calulation. Call this function if you're using the add(x,y,false) mehtod.
-