public class IlvDataTileController extends Object
Loaded tiles that are not displayed by any chart are put in a cache (called tile cache) for quick access.
Every change in data tile status is notified by DataTileEvent
events that are sent to all the subscribed DataTileListener
listeners.
Every instance of IlvDataTileController
can be associated to
only one IlvLODDataSet
.
This class is multithread-safe.
IlvDataTileLoader
,
IlvDataTileCache
,
IlvDataTile
Constructor and Description |
---|
IlvDataTileController(IlvDataTileLoader loader,
IlvDataTileCache cache,
double tileOrigin,
double tileLength,
int tileCapacity)
Creates a new controller with the specified tile loader.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataTileListener(DataTileListener listener)
Adds a listener that will be notified of changes in tile status.
|
void |
dispose()
Stops the load-on-demand mechanism.
|
IlvDataTileCache |
getCache()
Returns the cache used by the controller.
|
IlvLODDataSet |
getDataSet()
Returns the data set associated with the controller.
|
IlvDataTileLoader |
getLoader()
Returns the data tile loader.
|
int |
getTileCapacity()
Returns the capacity of the tile.
|
int[] |
getTileIndices(IlvDataInterval range)
Returns the indices of the tiles intersecting a given range.
|
double |
getTileLength()
Returns the length of the tiles intervals.
|
double |
getTileOrigin()
Returns the origin used to compute the tiles intervals.
|
boolean |
isActive()
Indicates whether the controller is in activity.
|
boolean |
isLoadingInCache()
Indicates whether tiles whose loading is not complete
are put in the cache or released.
|
void |
removeDataTileListener(DataTileListener listener)
Removes the specified listener.
|
void |
requestLoading(IlvDataInterval range,
Object req)
Requests the loading of data according to the specified range.
|
void |
setActive(boolean active)
Specifies whether the controller is active.
|
void |
setLoadingInCache(boolean load)
Specifies whether tiles whose loading is not complete
are put in the cache or released.
|
void |
unlockTiles(Object lock)
Unlocks all the tiles locked by the specified object.
|
public IlvDataTileController(IlvDataTileLoader loader, IlvDataTileCache cache, double tileOrigin, double tileLength, int tileCapacity)
loader
- The object that will load the data into new tiles.cache
- The object that implements the strategy for caching/releasing
the tiles.tileOrigin
- The starting x-value of the first tile.tileLength
- The length of a tile along the x-axis.tileCapacity
- The capacity of a tile. This number represents the
maximum number of data points a tile can hold. This capacity is used by the
controller to provide indexed access to data points.public final IlvDataTileLoader getLoader()
public IlvDataTileCache getCache()
public double getTileOrigin()
public double getTileLength()
public final int getTileCapacity()
public final IlvLODDataSet getDataSet()
public final boolean isLoadingInCache()
setLoadingInCache(boolean)
public void setLoadingInCache(boolean load)
The default value of this property is false
.
load
- If true
, a tile that is not yet fully
loaded will be stored in the cache, where the loading can be completed. If set to
false
, the tile will be discarded and the loading canceled.isLoadingInCache()
public final boolean isActive()
setActive(boolean)
public void setActive(boolean active)
isActive()
public void addDataTileListener(DataTileListener listener)
public void removeDataTileListener(DataTileListener listener)
public int[] getTileIndices(IlvDataInterval range)
range
- The range.public void unlockTiles(Object lock)
public void requestLoading(IlvDataInterval range, Object req)
If a chart displays a load-on-demand data set associated with the
controller, this method is automatically called when the visible range of
the x-axis of this chart changes. You can also use this method to
explicitly query the loading of data that are not displayed by any
chart. In this case, an object is associated with the request, and
used to lock the corresponding data tiles. Once the loaded data is no
more needed, the unlockTiles(Object)
should be used to release these
tiles.
range
- The range for which data should be loaded.req
- The object that performs the request. This object will be
used as a lock on the tiles.public void dispose()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.