OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 151 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 151 Rev 180
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.ui;
14
 package org.openconcerto.ui;
15
 
15
 
-
 
16
import java.awt.Component;
16
import java.awt.Dimension;
17
import java.awt.Dimension;
17
import java.awt.GridBagConstraints;
18
import java.awt.GridBagConstraints;
18
import java.awt.Insets;
19
import java.awt.Insets;
19
 
20
 
20
import javax.swing.JComponent;
-
 
21
import javax.swing.UIManager;
21
import javax.swing.UIManager;
22
 
22
 
23
public class DefaultGridBagConstraints extends GridBagConstraints {
23
public class DefaultGridBagConstraints extends GridBagConstraints {
24
 
24
 
25
    /**
25
    /**
Line 41... Line 41...
41
            return new Insets((int) (2 * f), (int) (3 * f), (int) (2 * f), (int) (2 * f));
41
            return new Insets((int) (2 * f), (int) (3 * f), (int) (2 * f), (int) (2 * f));
42
        }
42
        }
43
        return new Insets(2, 3, 2, 2);
43
        return new Insets(2, 3, 2, 2);
44
    }
44
    }
45
 
45
 
46
    public static void lockMinimumSize(JComponent c) {
46
    public static void lockMinimumSize(Component c) {
47
        c.setMinimumSize(new Dimension(c.getPreferredSize()));
47
        c.setMinimumSize(new Dimension(c.getPreferredSize()));
48
    }
48
    }
49
 
49
 
50
    public static void lockMaximumSize(JComponent c) {
50
    public static void lockMaximumSize(Component c) {
51
        c.setMaximumSize(new Dimension(c.getPreferredSize()));
51
        c.setMaximumSize(new Dimension(c.getPreferredSize()));
52
    }
52
    }
53
}
53
}