View Javadoc

1   /*
2    * Trip Tracker, a real-time position tracking system for the Internet.
3    * Copyright (C) 2006  Team Trip Tracker
4    *
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or (at your
8    * option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful, but
11   * WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License along
16   * with this program; if not, write to the Free Software Foundation, Inc.,
17   * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18   */
19  
20  package triptracker.client.gps.core;
21  
22  import java.io.IOException;
23  
24  import triptracker.core.Coordinate;
25  
26  /***
27   * Interface for events recieved from the
28   * {@link triptracker.client.gps.core.GPSConnection} class by its serialEvent
29   * method.
30   */
31  public interface GPSListener {
32  	/***
33  	 * Invoked when a new coordinate is received from the GPS unit.
34  	 * 
35  	 * @param coord the new coordinate
36  	 */
37  	public void coordReceived(Coordinate coord);
38  	
39  	/***
40  	 * Invoked when the state for the connected GPS unit changes.
41  	 * 
42  	 * @param state new state
43  	 */
44  	public void statusUpdate(GPSStatusState state);
45  	
46  	/***
47  	 * Invoked when a GPS unit is connected or disconnected.
48  	 * 
49  	 * @param connected true if connected, false if disconnected
50  	 */
51  	public void connected(boolean connected);
52  	
53  	/***
54  	 * Invoked when exception in the method who is reading data
55  	 * from the GPS-unit occurs. 
56  	 * 
57  	 * @param e the exception
58  	 */
59  	public void readExcepion(IOException e);
60  		
61  	
62  }