X
- X coordinate typeY
- Y coordinate typepublic class DataReducingObservableList<X extends Number,Y extends Number> extends ModifiableObservableListBase<XYChart.Data<X,Y>>
ObservableList
that contains a reduced number of points with respect to the wrapped
source list of data. The data reduction is performed by the data reducer strategy
on
data that is within the bounds of associated X axis. By default DefaultDataReducer
is used, but you can
provide other implementation of DataReducer
to this property to use it instead.
The primary usage of this collection is an efficient display of series containing a large number of data points, allowing to see more "details" when the visible data range is narrowed e.g. by performing a zoom-in.
This collection is unmodifiable - all changes to the data should be performed on the wrapped source data.
Type | Property and Description |
---|---|
ObjectProperty<ChartData<X,Y>> |
data
Array data to be reduced.
|
ObjectProperty<DataReducer<X,Y>> |
dataReducer
Property holding the data reduction strategy.
|
IntegerProperty |
maxPointsCount
The maximum number of points that the list should contain after the reduction.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_POINTS_COUNT
The default value of
maxPointsCountProperty() . |
modCount
Constructor and Description |
---|
DataReducingObservableList(ValueAxis<X> xAxis)
Creates a new instance of DataReducingObservableList without any data.
|
DataReducingObservableList(ValueAxis<X> xAxis,
ChartData<X,Y> chartData)
Creates a new instance of DataReducingObservableList.
|
DataReducingObservableList(ValueAxis<X> xAxis,
ObservableList<XYChart.Data<X,Y>> sourceData) |
Modifier and Type | Method and Description |
---|---|
ObjectProperty<ChartData<X,Y>> |
dataProperty()
Array data to be reduced.
|
ObjectProperty<DataReducer<X,Y>> |
dataReducerProperty()
Property holding the data reduction strategy.
|
protected void |
doAdd(int index,
XYChart.Data<X,Y> element) |
protected XYChart.Data<X,Y> |
doRemove(int index) |
protected XYChart.Data<X,Y> |
doSet(int index,
XYChart.Data<X,Y> element) |
XYChart.Data<X,Y> |
get(int index) |
ChartData<X,Y> |
getData()
Returns the value of the
dataProperty() . |
DataReducer<X,Y> |
getDataReducer()
Returns the data reduction strategy used by this list.
|
int |
getMaxPointsCount()
Returns value of the
maxPointsCountProperty() . |
IntegerProperty |
maxPointsCountProperty()
The maximum number of points that the list should contain after the reduction.
|
void |
setData(ChartData<X,Y> value)
Sets the value of the
dataProperty() . |
void |
setDataReducer(DataReducer<X,Y> reducer)
Sets the data reduction strategy to be used.
|
void |
setMaxPointsCount(int value)
Sets the value of
maxPointsCountProperty() . |
int |
size() |
add, addAll, addAll, remove, remove, removeAll, removeRange, retainAll, set, setAll, subList
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
add, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator
contains, containsAll, isEmpty, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
filtered, sorted, sorted
add, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public final ObjectProperty<ChartData<X extends Number,Y extends Number>> dataProperty
getData()
,
setData(ChartData)
public final ObjectProperty<DataReducer<X extends Number,Y extends Number>> dataReducerProperty
DataReducer
.getDataReducer()
,
setDataReducer(DataReducer)
public final IntegerProperty maxPointsCountProperty
getMaxPointsCount()
,
setMaxPointsCount(int)
public static final int DEFAULT_MAX_POINTS_COUNT
maxPointsCountProperty()
.public DataReducingObservableList(ValueAxis<X> xAxis)
setData(ChartData)
.xAxis
- X coordinates axis of the chart displaying the datapublic DataReducingObservableList(ValueAxis<X> xAxis, ObservableList<XYChart.Data<X,Y>> sourceData)
public final ObjectProperty<ChartData<X,Y>> dataProperty()
getData()
,
setData(ChartData)
public final void setData(ChartData<X,Y> value)
dataProperty()
.value
- data to be set.public final ChartData<X,Y> getData()
dataProperty()
.public final ObjectProperty<DataReducer<X,Y>> dataReducerProperty()
DataReducer
.getDataReducer()
,
setDataReducer(DataReducer)
public final DataReducer<X,Y> getDataReducer()
public final void setDataReducer(DataReducer<X,Y> reducer)
reducer
- data reduction strategy. If null
, no reduction will be applied on the source data.
maxPointsCountProperty()
property is ignored in such case.public final IntegerProperty maxPointsCountProperty()
getMaxPointsCount()
,
setMaxPointsCount(int)
public final int getMaxPointsCount()
maxPointsCountProperty()
.public final void setMaxPointsCount(int value)
maxPointsCountProperty()
.value
- the maximum number of points (grater than 1) that the collection can contain.protected void doAdd(int index, XYChart.Data<X,Y> element)
doAdd
in class ModifiableObservableListBase<XYChart.Data<X extends Number,Y extends Number>>
protected XYChart.Data<X,Y> doSet(int index, XYChart.Data<X,Y> element)
doSet
in class ModifiableObservableListBase<XYChart.Data<X extends Number,Y extends Number>>
protected XYChart.Data<X,Y> doRemove(int index)
doRemove
in class ModifiableObservableListBase<XYChart.Data<X extends Number,Y extends Number>>
public XYChart.Data<X,Y> get(int index)
get
in interface List<XYChart.Data<X extends Number,Y extends Number>>
get
in class ModifiableObservableListBase<XYChart.Data<X extends Number,Y extends Number>>
public int size()
size
in interface Collection<XYChart.Data<X extends Number,Y extends Number>>
size
in interface List<XYChart.Data<X extends Number,Y extends Number>>
size
in class ModifiableObservableListBase<XYChart.Data<X extends Number,Y extends Number>>
Copyright © 2019 CERN. All rights reserved.