12 |
|
public static final int STARTDATA = 2; |
13 |
|
public static final int STOPDATA = 3; |
14 |
|
public static final int DISCONNECT = 4; |
15 |
< |
|
15 |
> |
public static final int QUIT = 5; |
16 |
> |
|
17 |
|
public ConnectionHandler(DataPanel data, Queue actionQueue) { |
18 |
|
_data = data; |
19 |
|
_actionQueue = actionQueue; |
156 |
|
SwingClient.addMessage("Control Link Error: " + e); |
157 |
|
} |
158 |
|
break; |
159 |
< |
|
159 |
> |
case QUIT: |
160 |
> |
SwingClient.addMessage("Exiting..."); |
161 |
> |
// stop data and control if data up |
162 |
> |
if (_dataLink != null) { |
163 |
> |
_actionQueue.add(new Integer(STOPDATA)); |
164 |
> |
_actionQueue.add(new Integer(DISCONNECT)); |
165 |
> |
_actionQueue.add(new Integer(QUIT)); |
166 |
> |
} |
167 |
> |
// stop control |
168 |
> |
if (_controlLink != null) { |
169 |
> |
_actionQueue.add(new Integer(DISCONNECT)); |
170 |
> |
_actionQueue.add(new Integer(QUIT)); |
171 |
> |
} |
172 |
> |
SwingClient.addMessage("Finished."); |
173 |
> |
// go! |
174 |
> |
System.exit(0); |
175 |
> |
break; |
176 |
|
} |
177 |
|
} |
178 |
|
} |