1 /*
2 * @(#)$Id: DeleteEventHandler.java 799 2010-05-04 15:10:56Z bpuype $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 * Purpose :
7 *
8 * -----------------------------------------------------------------------
9 *
10 * Revision Information:
11 *
12 * Date Who Reason
13 *
14 * Nov 24, 2006 ukurmann Initial Release
15 * Mar 24, 2007 bsigner Cleanup
16 *
17 * -----------------------------------------------------------------------
18 *
19 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20 *
21 * This software is the proprietary information of ETH Zurich.
22 * Use is subject to license terms.
23 *
24 */
25
26
27 package org.ximtec.igesture.app.showcaseapp.eventhandler;
28
29 import java.awt.Color;
30 import java.awt.Graphics2D;
31
32 import org.sigtec.ink.Note;
33 import org.ximtec.igesture.core.ResultSet;
34 import org.ximtec.igesture.event.GestureAction;
35
36
37 /**
38 * @version 1.0 Nov 2006
39 * @author Ueli Kurmann, igesture@uelikurmann.ch
40 * @author Beat Signer, signer@inf.ethz.ch
41 */
42 public class DeleteEventHandler implements GestureAction {
43
44 private Graphics2D graphic;
45
46
47 public DeleteEventHandler(Graphics2D graphic) {
48 this.graphic = graphic;
49 }
50
51
52 public void actionPerformed(ResultSet resultSet) {
53 Note note = (Note)resultSet.getGesture().getGesture();
54 graphic.setColor(Color.WHITE);
55 graphic.fillRect((int)note.getBounds2D().getMinX(), (int)note
56 .getBounds2D().getMinY(), (int)note.getBounds2D().getWidth(),
57 (int)note.getBounds2D().getHeight());
58 } // run
59
60 }