1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.bcel.verifier;
18
19 import java.awt.Dimension;
20 import java.awt.Toolkit;
21 import javax.swing.UIManager;
22 import org.apache.bcel.generic.Type;
23
24 /***
25 * A graphical user interface application demonstrating JustIce.
26 *
27 * @version $Id: GraphicalVerifier.java 386056 2006-03-15 11:31:56Z tcurdt $
28 * @author Enver Haase
29 */
30 public class GraphicalVerifier {
31
32 boolean packFrame = false;
33
34
35 /*** Constructor. */
36 public GraphicalVerifier() {
37 VerifierAppFrame frame = new VerifierAppFrame();
38
39
40 if (packFrame) {
41 frame.pack();
42 } else {
43 frame.validate();
44 }
45
46 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
47 Dimension frameSize = frame.getSize();
48 if (frameSize.height > screenSize.height) {
49 frameSize.height = screenSize.height;
50 }
51 if (frameSize.width > screenSize.width) {
52 frameSize.width = screenSize.width;
53 }
54 frame.setLocation((screenSize.width - frameSize.width) / 2,
55 (screenSize.height - frameSize.height) / 2);
56 frame.setVisible(true);
57 frame.classNamesJList.setModel(new VerifierFactoryListModel());
58 VerifierFactory.getVerifier(Type.OBJECT.getClassName());
59 frame.classNamesJList.setSelectedIndex(0);
60 }
61
62
63 /*** Main method. */
64 public static void main( String[] args ) {
65 try {
66 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
67 } catch (Exception e) {
68 e.printStackTrace();
69 }
70 new GraphicalVerifier();
71 }
72 }