ims.map
Class DirectionThread

java.lang.Object
  extended by java.lang.Thread
      extended by ims.map.DirectionThread
All Implemented Interfaces:
java.lang.Runnable

public class DirectionThread
extends java.lang.Thread

Class checks continuously whether the distance (arrow and display of distance on the map) should be shown by reference to the distance checkbox (settings menu) and the status of the device (is the device connected?, is gps input received?).

Copyright © 2014 by Daniela Blum

This file is part of GPSChildFinder.
GPSChildFinder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses.

Author:
Daniela Blum

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DirectionThread(Map map, android.content.Context context)
          Constructor.
 
Method Summary
 void run()
          Checks continuously whether the status of the showDirection boolean have changed and calls the Map.addDirection() (user wants direction components shown and the criteria are fulfilled) or Map.removeDirection() method (user don't want direction to be shown or the criteria arn't fulfilled).
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectionThread

public DirectionThread(Map map,
                       android.content.Context context)
Constructor. Initializes the direction arrow and distance textView and starts the thread/run method.

Parameters:
map - Map class in which the main components of the map are located.
context - map's and directionThread's context
Method Detail

run

public void run()
Checks continuously whether the status of the showDirection boolean have changed and calls the Map.addDirection() (user wants direction components shown and the criteria are fulfilled) or Map.removeDirection() method (user don't want direction to be shown or the criteria arn't fulfilled).
Direction components are the direction arrow and display of distance on the map (distance textView).

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread