1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 package org.ximtec.igesture.tool.gesturevisualisation;
28
29 import java.awt.Dimension;
30
31 import javax.swing.ImageIcon;
32 import javax.swing.JLabel;
33 import javax.swing.JPanel;
34
35 import org.ximtec.igesture.core.Gesture;
36 import org.ximtec.igesture.core.GestureSample;
37 import org.ximtec.igesture.util.GestureTool;
38
39
40
41
42
43
44
45 public class NoteGesturePanel implements GesturePanel {
46
47 Gesture< ? > gesture;
48
49
50 @Override
51 public void init(Gesture< ? > gesture) {
52 this.gesture = gesture;
53 }
54
55
56 @Override
57 public JPanel getPanel(Dimension dimension) {
58
59 JPanel panel = null;
60
61 if (gesture != null) {
62 JLabel label = new JLabel(new ImageIcon(GestureTool.createNoteImage(
63 ((GestureSample)gesture).getGesture(), dimension.width,
64 dimension.height)));
65
66 panel = new JPanel();
67 panel.setOpaque(true);
68 panel.add(label);
69
70 }
71 return panel;
72 }
73 }