|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.tiling.IlvThreadedTileLoader
public class IlvThreadedTileLoader
This tile loader class delegates actual tile loading to the tile loader set at construction time. It will load tiles in another thread and update the thread monitoring information.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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 attributes of a persistent object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
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 thread
public IlvThreadedTileLoader(IlvInputStream stream)
throws IlvReadFileException
stream - stream to read from.
IlvReadFileException| Method Detail |
|---|
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 IlvTileLoaderExceptionpublic void release(IlvTile tile)
release in interface IlvTileLoaderpublic boolean isPersistent()
isPersistent in interface IlvTileLoader
public void write(IlvOutputStream stream)
throws IOException
write in interface IlvPersistentObjectwrite in interface IlvTileLoaderstream - the output stream
IOException - thrown when an exception occurs during
the write operation for this object.public int getRepaintPolicy()
REPAINT_AFTER_ALL_TILES,
REPAINT_AFTER_EACH_TILEpublic 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_TILEpublic 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()
CANCEL_OPPOSITE_TASK,
PROCESS_ALL_TASKS,
REPLACE_OPPOSITE_TASKpublic 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_TASKpublic void dispose()
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||