1 /*
2 * @(#)$Id: CloseApplication.java 689 2009-07-22 00:10:27Z bsigner $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 * Purpose : Example implementation of an event handler. It will
7 * close the application.
8 *
9 * -----------------------------------------------------------------------
10 *
11 * Revision Information:
12 *
13 * Date Who Reason
14 *
15 * Dec 26, 2006 ukurmann Initial Release
16 * Mar 22, 2007 bsigner Cleanup
17 *
18 * -----------------------------------------------------------------------
19 *
20 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
21 *
22 * This software is the proprietary information of ETH Zurich.
23 * Use is subject to license terms.
24 *
25 */
26
27
28 package org.ximtec.igesture.event.example;
29
30 import java.util.logging.Level;
31 import java.util.logging.Logger;
32
33 import org.ximtec.igesture.core.ResultSet;
34 import org.ximtec.igesture.event.GestureAction;
35
36
37 /**
38 * Example implementation of an event handler. It will close the application.
39 *
40 * @version 1.0, Dec 2006
41 * @author Ueli Kurmann, igesture@uelikurmann.ch
42 * @author Beat Signer, signer@inf.ethz.ch
43 */
44 public class CloseApplication implements GestureAction {
45
46 private static final Logger LOGGER = Logger.getLogger(CloseApplication.class
47 .getName());
48
49 private static final String SHUTTING_DOWN = "Application is shutting down...";
50
51 private String name;
52
53
54 public CloseApplication(String name) {
55 this.name = name;
56 }
57
58
59 public String getName() {
60 return name;
61 } // getName
62
63
64 public void actionPerformed(ResultSet resultSet) {
65 LOGGER.log(Level.INFO, SHUTTING_DOWN);
66 System.exit(0);
67 } // run
68
69 }