source: other-projects/trunk/greenstone3-extension/mat/Greenstone3Project/src/org/greenstone3/ms/MainApplication.java@ 17156

Last change on this file since 17156 was 17156, checked in by cc108, 16 years ago

Adding the project Metadata Quality for Digital Libraries into the repository

File size: 2.1 KB
Line 
1package org.greenstone3.ms;
2
3import java.awt.Toolkit;
4import javax.swing.SwingUtilities;
5import javax.swing.UIManager;
6import java.awt.Dimension;
7
8/**
9 * <p>Title: </p>
10 *
11 * <p>Description: </p>
12 *
13 * <p>Copyright: Copyright (c) 2007</p>
14 *
15 * <p>Company: </p>
16 *
17 * @author not attributable
18 * @version 1.0
19 */
20
21public class MainApplication {
22 boolean packFrame = false;
23
24 /**
25 * Construct and show the application.
26 */
27 public MainApplication(String collectionName) {
28 DescribeMessager dm = new DescribeMessager(collectionName,"http://repositoryaut.lconz.ac.nz/cgi/oai2.cgi");
29 dm.describeMatadata(collectionName,"http://researchcommons.waikato.ac.nz/cgi/oai2.cgi");
30 //System.out.println("step1");
31 //HashMap
32 Frame1 frame = new Frame1(dm.getElementClass());
33 // Validate frames that have preset sizes
34 // Pack frames that have useful preferred size info, e.g. from their layout
35 if (packFrame) {
36 frame.pack();
37 } else {
38 frame.validate();
39 }
40
41 // Center the window
42 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
43 Dimension frameSize = frame.getSize();
44 if (frameSize.height > screenSize.height) {
45 frameSize.height = screenSize.height;
46 }
47 if (frameSize.width > screenSize.width) {
48 frameSize.width = screenSize.width;
49 }
50 frame.setLocation((screenSize.width - frameSize.width) / 2,
51 (screenSize.height - frameSize.height) / 2);
52 frame.setVisible(true);
53 }
54
55 /**
56 * Application entry point.
57 *
58 * @param args String[]
59 */
60 public static void main(String[] args) {
61 SwingUtilities.invokeLater(new Runnable() {
62 public void run() {
63 try {
64 UIManager.setLookAndFeel(UIManager.
65 getSystemLookAndFeelClassName());
66 } catch (Exception exception) {
67 exception.printStackTrace();
68 }
69
70 new MainApplication("");
71 }
72 });
73 }
74}
Note: See TracBrowser for help on using the repository browser.