OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 17 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 151
Line 16... Line 16...
16
import java.awt.Dimension;
16
import java.awt.Dimension;
17
import java.awt.GridBagConstraints;
17
import java.awt.GridBagConstraints;
18
import java.awt.Insets;
18
import java.awt.Insets;
19
 
19
 
20
import javax.swing.JComponent;
20
import javax.swing.JComponent;
-
 
21
import javax.swing.UIManager;
21
 
22
 
22
public class DefaultGridBagConstraints extends GridBagConstraints {
23
public class DefaultGridBagConstraints extends GridBagConstraints {
23
 
24
 
24
    /**
25
    /**
25
     * Contraintes par défaut pour les UI
26
     * Contraintes par défaut pour les UI
Line 33... Line 34...
33
        this.fill = GridBagConstraints.HORIZONTAL;
34
        this.fill = GridBagConstraints.HORIZONTAL;
34
        this.anchor = GridBagConstraints.WEST;
35
        this.anchor = GridBagConstraints.WEST;
35
    }
36
    }
36
 
37
 
37
    public static Insets getDefaultInsets() {
38
    public static Insets getDefaultInsets() {
-
 
39
        if (UIManager.get("dpi.scale") != null) {
-
 
40
            float f = (Float) UIManager.get("dpi.scale");
-
 
41
            return new Insets((int) (2 * f), (int) (3 * f), (int) (2 * f), (int) (2 * f));
-
 
42
        }
38
        return new Insets(2, 3, 2, 2);
43
        return new Insets(2, 3, 2, 2);
39
    }
44
    }
40
 
45
 
41
    public static void lockMinimumSize(JComponent c) {
46
    public static void lockMinimumSize(JComponent c) {
42
        c.setMinimumSize(new Dimension(c.getPreferredSize()));
47
        c.setMinimumSize(new Dimension(c.getPreferredSize()));