1 /*
2 * @(#)$Id: RectangleDescriptor.java 760 2009-08-25 20:10:41Z kurmannu $
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.descriptor;
28
29 import java.awt.Graphics2D;
30 import java.awt.RenderingHints;
31
32 import org.sigtec.ink.Note;
33 import org.ximtec.igesture.core.DigitalDescriptor;
34
35
36 /**
37 * @version 1.0 Nov 2006
38 * @author Ueli Kurmann, igesture@uelikurmann.ch
39 * @author Beat Signer, signer@inf.ethz.ch
40 */
41 public class RectangleDescriptor extends DigitalDescriptor {
42
43 public RectangleDescriptor() {
44 super();
45 }
46
47
48 @Override
49 public void getDigitalObject(Graphics2D graphic, Note note) {
50 graphic.setRenderingHint(RenderingHints.KEY_RENDERING,
51 RenderingHints.VALUE_RENDER_QUALITY);
52 graphic.drawRect((int)note.getBounds2D().getMinX(), (int)note
53 .getBounds2D().getMinY(), (int)note.getBounds2D().getWidth(),
54 (int)note.getBounds2D().getHeight());
55 } // getDigitalObject
56
57 @Override
58 public String getName() {
59 return this.getClass().getSimpleName();
60 }
61
62 }