Package totalcross.ui.image
Class BulkImageLoader
- java.lang.Object
-
- java.lang.Thread
-
- totalcross.ui.image.BulkImageLoader
-
- All Implemented Interfaces:
java.lang.Runnable
public class BulkImageLoader extends java.lang.ThreadThis class is used to load and release lots of images when used for a book, for example. It loads the images in a thread and release old images to keep memory usage low. Use it with DynImage. See the ImageBook and the Product Store samples.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBulkImageLoader.DynImageclass used to show the Image on screen.
-
Constructor Summary
Constructors Constructor Description BulkImageLoader(int pagesInMemory, int pageSize, java.lang.String imageFolder, java.lang.String[] arqs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImagegetImage(int idx)Returns the image at the given indexvoidrun()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
running
public boolean running
-
pagesInMemory
public int pagesInMemory
-
pageSize
public int pageSize
-
current
public int current
-
arqs
public java.lang.String[] arqs
-
loaded
public Image[] loaded
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
getImage
public Image getImage(int idx) throws IOException
Returns the image at the given index- Throws:
IOException
-
-