1 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 33 public class PartitionViewer 34 { 35 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 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 } 97 | Popular Tags |