1 package fr.ifremer.dali.ui.swing.util;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import fr.ifremer.quadrige3.ui.swing.ApplicationUIUtil;
25
26 import java.awt.Component;
27 import java.awt.Dimension;
28
29
30
31
32 public class DaliUIs extends ApplicationUIUtil {
33
34
35
36
37 public static final int DALI_COMPONENT_WIDTH = 200;
38
39
40
41
42 public static final int DALI_COMPONENT_HEIGHT = 30;
43
44
45
46
47 public static final int DALI_DOUBLE_LIST_SIZE = 260;
48
49
50
51
52 public static final int DALI_CHECKBOX_WIDTH = 80;
53
54
55
56
57 public static final int DALI_IMAGE_WIDTH = 200;
58
59
60
61
62
63
64 public static void forceComponentSize(Component component) {
65 forceComponentSize(component, DALI_COMPONENT_WIDTH);
66 }
67
68
69
70
71
72
73
74 public static void forceComponentSize(Component component, int width) {
75 forceComponentSize(component, width, DALI_COMPONENT_HEIGHT);
76 }
77
78 public static void forceComponentSize(Component component, int width, int height) {
79 forceComponentSize(component, new Dimension(width, height));
80 }
81
82 public static void forceComponentSize(Component component, Dimension dimension) {
83 component.setPreferredSize(dimension);
84 component.setSize(component.getPreferredSize());
85 component.setMaximumSize(component.getPreferredSize());
86 component.setMinimumSize(component.getPreferredSize());
87 }
88 }