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.util;
28
29 import javax.swing.BorderFactory;
30 import javax.swing.JLabel;
31
32 import org.ximtec.igesture.core.DataObject;
33 import org.ximtec.igesture.tool.binding.BindingFactory;
34
35
36
37
38
39
40
41
42 public class TitleFactory {
43
44 public static JLabel createStaticTitle(String s){
45 JLabel title = new JLabel(s);
46 title.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
47 title.setFont(FontFactory.getArialBold(24));
48 return title;
49 }
50
51 public static JLabel createDynamicTitle(DataObject obj, String property){
52 JLabel title = new JLabel();
53 BindingFactory.createInstance(title, obj, property);
54 title.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
55 title.setFont(FontFactory.getArialBold(24));
56 return title;
57 }
58
59 }