OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 80 Rev 83
Line 27... Line 27...
27
public class PreviewFrame extends JFrame {
27
public class PreviewFrame extends JFrame {
28
 
28
 
29
    private PreviewFrame(OpenDocument doc, String title) {
29
    private PreviewFrame(OpenDocument doc, String title) {
30
        super(title);
30
        super(title);
31
        this.setContentPane(new ODSViewerPanel(doc, new DefaultXMLDocumentPrinter()));
31
        this.setContentPane(new ODSViewerPanel(doc, new DefaultXMLDocumentPrinter()));
-
 
32
        init();
-
 
33
    }
-
 
34
 
-
 
35
    public PreviewFrame(String title, String url, String odspXml) {
-
 
36
        this.setContentPane(new ODSViewerPanel(url, odspXml, new DefaultXMLDocumentPrinter(), true));
-
 
37
        this.setTitle(title);
-
 
38
        init();
-
 
39
    }
-
 
40
 
-
 
41
    private void init() {
32
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
42
        final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
33
        this.setMaximizedBounds(ge.getMaximumWindowBounds());
43
        this.setMaximizedBounds(ge.getMaximumWindowBounds());
34
        Dimension maxD = ge.getMaximumWindowBounds().getSize();
44
        final Dimension maxD = ge.getMaximumWindowBounds().getSize();
35
        this.setMaximumSize(maxD);
45
        this.setMaximumSize(maxD);
36
        this.pack();
46
        this.pack();
37
        Dimension d = this.getSize();
47
        Dimension d = this.getSize();
38
        if (d.width > maxD.width) {
48
        if (d.width > maxD.width) {
39
            d.setSize(maxD.width, d.height);
49
            d.setSize(maxD.width, d.height);
Line 58... Line 68...
58
                public void run() {
68
                public void run() {
59
                    new PreviewFrame(doc, title).setVisible(true);
69
                    new PreviewFrame(doc, title).setVisible(true);
60
                }
70
                }
61
            });
71
            });
62
        }
72
        }
63
    }
-
 
64
 
73
 
65
}
74
    }
-
 
75
}