public class IlvThreadedTileLoader extends Object implements IlvTileLoader
Modifier and Type | Field and Description |
---|---|
static int |
CANCEL_OPPOSITE_TASK
Indicates what to do when a unload and load have to be managed at the
same time: none will be done.
|
static int |
PROCESS_ALL_TASKS
Indicates what to do when a unload and load have to be managed at the
same time: will do both
|
static int |
REPAINT_AFTER_ALL_TILES
Indicates whether the tiles should be redrawn only after all have
been loaded.
|
static int |
REPAINT_AFTER_EACH_TILE
Indicates whether the tiles should be redrawn after each tile is loaded.
|
static int |
REPLACE_OPPOSITE_TASK
Indicates what to do when a unload and load have to be managed at the
same time: only last task will be processed.
|
Constructor and Description |
---|
IlvThreadedTileLoader(IlvInputStream stream)
Reads a threaded tile loader from an input stream.
|
IlvThreadedTileLoader(IlvTileLoader tileLoader,
boolean threaded)
Creates a tile loader loading tiles on a background thread.
|
Modifier and Type | Method and Description |
---|---|
void |
addNonCancellableTask(IlvTile currentTile)
Specify that a task related to the given tile can not be cancel.
|
void |
dispose()
Disposes of the resources used by this loader.
|
int |
getActiveTasksCount()
Returns the number of tiles to load.
|
IlvTileLoader |
getDelegateLoader()
Returns the delegate IlvTileLoader of this threaded loader.
|
int |
getEnqueuePolicy()
Returns the current enqueue Policy.
|
int |
getRepaintPolicy()
Returns the repaint policy.
|
int |
getThreadPriority()
Returns the priority of threads used by this threaded loader.
|
boolean |
isPersistent()
Returns true if the object must be saved by a tile controller.
|
boolean |
isThreaded()
Returns
true if the load/release work is performed
in a separate thread. |
void |
load(IlvTile tile)
Function called when a tile has to be loaded.
|
void |
release(IlvTile tile)
Function called when a tile has to be released.
|
void |
setEnqueuePolicy(int enqueuePolicy)
Sets the enqueue policy.
|
void |
setRepaintPolicy(int repaintPolicy)
Sets the new repaint policy.
|
void |
setThreaded(boolean threaded,
boolean wait)
Sets whether the load/release work should be performed in a separate
thread.
|
void |
setThreadPriority(int threadPriority)
Set the priority of threads used by this loader.
|
void |
write(IlvOutputStream stream)
Writes the tile loader to an
IlvOutputStream |
public static int REPAINT_AFTER_EACH_TILE
public static int REPAINT_AFTER_ALL_TILES
public static int PROCESS_ALL_TASKS
public static int CANCEL_OPPOSITE_TASK
public static int REPLACE_OPPOSITE_TASK
public IlvThreadedTileLoader(IlvTileLoader tileLoader, boolean threaded)
tileLoader
- delegate that does the real loading and unloadingthreaded
- true if load/release should be performed in a separate threadpublic IlvThreadedTileLoader(IlvInputStream stream) throws IlvReadFileException
stream
- stream to read from.IlvReadFileException
public int getActiveTasksCount()
public boolean isThreaded()
true
if the load/release work is performed
in a separate thread.public void setThreaded(boolean threaded, boolean wait)
threaded
- true
if the load/release work should be
performed in a separate thread.wait
- true
to wait for all current tiles being loaded
before switching to non-threaded mode.public void load(IlvTile tile) throws Exception
IlvTile.loadComplete
to notify the
tile listeners.load
in interface IlvTileLoader
Exception
public void release(IlvTile tile)
release
in interface IlvTileLoader
public boolean isPersistent()
isPersistent
in interface IlvTileLoader
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
write
in interface IlvPersistentObject
write
in interface IlvTileLoader
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.public int getRepaintPolicy()
REPAINT_AFTER_ALL_TILES
,
REPAINT_AFTER_EACH_TILE
public void setRepaintPolicy(int repaintPolicy)
repaintPolicy
- The policy to set.
Possible values are REPAINT_AFTER_ALL_TILES and REPAINT_AFTER_EACH_TILEREPAINT_AFTER_ALL_TILES
,
REPAINT_AFTER_EACH_TILE
public void addNonCancellableTask(IlvTile currentTile)
currentTile
- the tilepublic IlvTileLoader getDelegateLoader()
public int getThreadPriority()
public void setThreadPriority(int threadPriority)
threadPriority
- The threadPriority to set.public int getEnqueuePolicy()
public void setEnqueuePolicy(int enqueuePolicy)
enqueuePolicy
- The policy to set.
Possible values are : CANCEL_OPPOSITE_TASK, PROCESS_ALL_TASKS or REPLACE_OPPOSITE_TASKCANCEL_OPPOSITE_TASK
,
PROCESS_ALL_TASKS
,
REPLACE_OPPOSITE_TASK
public void dispose()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.