public class WalkThread extends Thread implements StreetsideDataListener
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
private StreetsideData |
data |
private boolean |
end |
private boolean |
followSelected |
private boolean |
goForward |
private int |
interval |
private BufferedImage |
lastImage |
private boolean |
paused |
private boolean |
waitForFullQuality |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
WalkThread(int interval,
boolean waitForPicture,
boolean followSelected,
boolean goForward)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
end()
Called when the walk stops by itself of forcefully.
|
void |
imagesAdded()
Fired when any image is added to the database.
|
void |
pause()
Pauses the execution.
|
void |
play()
Continues with the execution if paused.
|
private void |
preDownloadCubemaps(StreetsideImage startImage,
int n) |
private static void |
preDownloadImages(StreetsideImage startImage,
int n,
CacheUtils.PICTURE type)
Downloads n images into the cache beginning from the supplied start-image (including the start-image itself).
|
void |
run() |
void |
selectedImageChanged(StreetsideAbstractImage oldImage,
StreetsideAbstractImage newImage)
Fired when the selected image is changed by something different from
manually clicking on the icon.
|
void |
stopWalk()
Stops the execution.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private final int interval
private final StreetsideData data
private boolean end
private final boolean waitForFullQuality
private final boolean followSelected
private final boolean goForward
private BufferedImage lastImage
private volatile boolean paused
public WalkThread(int interval, boolean waitForPicture, boolean followSelected, boolean goForward)
interval
- How often the images switch.waitForPicture
- If it must wait for the full resolution picture or just the
thumbnail.followSelected
- Zoom to each image that is selected.goForward
- true to go forward; false to go backwards.private void preDownloadCubemaps(StreetsideImage startImage, int n)
private static void preDownloadImages(StreetsideImage startImage, int n, CacheUtils.PICTURE type)
startImage
- the image to start with (this and the next n-1 images in the same sequence are downloaded)n
- the number of images to downloadtype
- the quality of the image (full or thumbnail)public void imagesAdded()
StreetsideDataListener
imagesAdded
in interface StreetsideDataListener
public void selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)
StreetsideDataListener
selectedImageChanged
in interface StreetsideDataListener
oldImage
- Old selected StreetsideAbstractImage
newImage
- New selected StreetsideAbstractImage
public void play()
public void pause()
public void stopWalk()
public void end()