OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 67 Rev 80
Line 48... Line 48...
48
            stateManager = new WindowStateManager(frame, new File(Configuration.getInstance().getConfDir(), "Configuration" + File.separator + "Frame" + File.separator + name.toString() + ".xml"),
48
            stateManager = new WindowStateManager(frame, new File(Configuration.getInstance().getConfDir(), "Configuration" + File.separator + "Frame" + File.separator + name.toString() + ".xml"),
49
                    true);
49
                    true);
50
        } else {
50
        } else {
51
            System.err.println("Warning: no action name for action " + this + ", unable to use a window state manager.");
51
            System.err.println("Warning: no action name for action " + this + ", unable to use a window state manager.");
52
        }
52
        }
53
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-
 
-
 
53
 
54
        frame.pack();
54
        frame.pack();
55
 
55
 
56
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
56
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
57
        int w = Math.min(d.width - 100, frame.getWidth());
57
        int w = Math.min(d.width - 100, frame.getWidth());
58
        int h = Math.min(d.height - 100, frame.getHeight());
58
        int h = Math.min(d.height - 100, frame.getHeight());
59
        frame.setMinimumSize(new Dimension(w, h));
59
        frame.setMinimumSize(new Dimension(w, h));
60
        frame.setLocationRelativeTo(null);
60
        frame.setLocationRelativeTo(null);
61
        if (mustLoadState && stateManager != null) {
61
        if (mustLoadState && stateManager != null) {
62
            stateManager.loadState();
62
            stateManager.loadState();
63
        }
63
        }
-
 
64
 
-
 
65
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
64
        FrameUtil.show(frame);
66
        FrameUtil.show(frame);
65
 
67
 
66
    }
68
    }
67
 
69
 
68
    abstract public JFrame createFrame();
70
    abstract public JFrame createFrame();