skip to main content
Defense > Programmer's documentation > Programming with JViews Maps > Creating a map application using the API > Overview of multithreading
 
Overview of multithreading
Heavy tasks are performed in threads to prevent the application GUI from freezing. Some of the threads are hidden, others can be controlled.
Use of threads in the Map Builder
All Map Builder import tasks are performed in separate threads to ensure GUI responsiveness. This means that you can open a batch of files of different formats without having to wait for the current file to finish being imported. This is basically achieved by calling the start methods of the associated data sources in a dedicated thread.
Use of threads in map labelling
The map labelling mechanism in JViews Maps is implemented in a background thread so that the user can continuously zoom, pan, and scroll the view without being slowed down by the sometimes CPU-intensive layout algorithms.
As soon as user interaction with the view stops, a timer starts. If no further change occurs in the view within a certain length of time (a few hundreds of milliseconds typically), the label layout process starts in the dedicated background thread. If it does not finish before the view changes again, the current task is canceled so that the next one can start as soon as possible.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.