- /**
- * notify manager that we have started, and wait for a free calculation slot
- *
- * @return true if slot is obtained and work still valid, false if another
- * thread has done our work for us.
- */
- protected boolean checkDone()
- {
- calcMan.notifyStart(this);
- ap.paintAlignment(false, false);
- while (!calcMan.notifyWorking(this))
- {
- if (calcMan.isWorking(this))
- {
- return true;
- }
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false, false);
- }
-
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- if (alignViewport.isClosed())
- {
- abortAndDestroy();
- return true;
- }
- return false;
- }
-