1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ldap.server.db.gui ;
18
19
20 import org.apache.ldap.server.db.Database;
21 import org.apache.ldap.server.db.SearchEngine;
22
23 import javax.naming.NamingException;
24 import java.awt.*;
25
26
27 /***
28 * A partition database viewer.
29 *
30 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
31 * @version $Rev: 159259 $
32 */
33 public class PartitionViewer
34 {
35 /*** A handle on the atomic partition */
36 private Database db;
37 private SearchEngine eng;
38
39
40 public PartitionViewer( Database db, SearchEngine eng )
41 {
42 this.db = db;
43 this.eng = eng;
44 }
45
46
47 /***
48 // * Viewer main is not really used.
49 // *
50 // * @param argv the var args
51 // */
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 public void execute() throws NamingException
81 {
82 MainFrame frame = new MainFrame( db, eng ) ;
83
84 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize() ;
85 Dimension frameSize = frame.getSize() ;
86 frameSize.height = ( ( frameSize.height > screenSize.height )
87 ? screenSize.height : frameSize.height) ;
88 frameSize.width = ( ( frameSize.width > screenSize.width )
89 ? screenSize.width : frameSize.width ) ;
90 frame.setLocation( ( screenSize.width - frameSize.width ) / 2,
91 ( screenSize.height - frameSize.height ) / 2) ;
92
93 frame.setVisible( true );
94 System.out.println( frameSize ) ;
95 }
96 }