Class WalkThread
- java.lang.Object
-
- java.lang.Thread
-
- org.openstreetmap.josm.plugins.streetside.actions.WalkThread
-
- All Implemented Interfaces:
java.lang.Runnable,StreetsideDataListener
public class WalkThread extends java.lang.Thread implements StreetsideDataListener
Thread containing the walk process.
-
-
Field Summary
Fields Modifier and Type Field Description private StreetsideDatadataprivate booleanendprivate booleanfollowSelectedprivate booleangoForwardprivate intintervalprivate java.awt.image.BufferedImagelastImage(package private) static org.apache.log4j.Loggerloggerprivate booleanpausedprivate booleanwaitForFullQuality
-
Constructor Summary
Constructors Constructor Description WalkThread(int interval, boolean waitForPicture, boolean followSelected, boolean goForward)Main constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend()Called when the walk stops by itself of forcefully.voidimagesAdded()Fired when any image is added to the database.voidpause()Pauses the execution.voidplay()Continues with the execution if paused.private voidpreDownloadCubemaps(StreetsideImage startImage, int n)private static voidpreDownloadImages(StreetsideImage startImage, int n, CacheUtils.PICTURE type)Downloads n images into the cache beginning from the supplied start-image (including the start-image itself).voidrun()voidselectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)Fired when the selected image is changed by something different from manually clicking on the icon.voidstopWalk()Stops the execution.-
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
-
interval
private final int interval
-
data
private final StreetsideData data
-
end
private boolean end
-
waitForFullQuality
private final boolean waitForFullQuality
-
followSelected
private final boolean followSelected
-
goForward
private final boolean goForward
-
lastImage
private java.awt.image.BufferedImage lastImage
-
paused
private volatile boolean paused
-
logger
static final org.apache.log4j.Logger logger
-
-
Constructor Detail
-
WalkThread
public WalkThread(int interval, boolean waitForPicture, boolean followSelected, boolean goForward)
Main constructor.- Parameters:
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.
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
preDownloadCubemaps
private void preDownloadCubemaps(StreetsideImage startImage, int n)
-
preDownloadImages
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).- Parameters:
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)
-
imagesAdded
public void imagesAdded()
Description copied from interface:StreetsideDataListenerFired when any image is added to the database.- Specified by:
imagesAddedin interfaceStreetsideDataListener
-
selectedImageChanged
public void selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)
Description copied from interface:StreetsideDataListenerFired when the selected image is changed by something different from manually clicking on the icon.- Specified by:
selectedImageChangedin interfaceStreetsideDataListener- Parameters:
oldImage- Old selectedStreetsideAbstractImagenewImage- New selectedStreetsideAbstractImage
-
play
public void play()
Continues with the execution if paused.
-
pause
public void pause()
Pauses the execution.
-
stopWalk
public void stopWalk()
Stops the execution.
-
end
public void end()
Called when the walk stops by itself of forcefully.
-
-