source: other-projects/trunk/greenstone3-extension/mat/src/org/greenstone/gsdl3_extension/mat/MainApplication.java@ 18093

Last change on this file since 18093 was 18093, checked in by cc108, 15 years ago

new Mat source code

File size: 1.4 KB
Line 
1package org.greenstone.gsdl3_extension.mat;
2
3import java.awt.Toolkit;
4import javax.swing.SwingUtilities;
5import javax.swing.UIManager;
6import java.awt.Dimension;
7
8public class MainApplication {
9 boolean packFrame = false;
10
11
12 public MainApplication(){}
13
14 public MainApplication(String collectionName) {
15
16 DescribeMessenger dm = new DescribeMessenger(collectionName," ");
17 MainApplication ma = new MainApplication ();
18 ma.start(dm, collectionName);
19 }
20
21 public void start(DescribeMessenger dm, String collectionName){
22
23 dm.describeMatadata(collectionName,"");
24
25 MainApplicationFrame frame = new MainApplicationFrame(dm.getElementClass());
26
27 if (packFrame) {
28 frame.pack();
29 } else {
30 frame.validate();
31 }
32
33 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
34 Dimension frameSize = frame.getSize();
35
36 if (frameSize.height > screenSize.height) {
37 frameSize.height = screenSize.height;
38 }
39 if (frameSize.width > screenSize.width) {
40 frameSize.width = screenSize.width;
41 }
42 frame.setLocation((screenSize.width - frameSize.width) / 2,
43 (screenSize.height - frameSize.height) / 2);
44 frame.setVisible(true);
45 }
46
47 public static void main(String[] args) {
48 String collectionName = args[0];
49 new MainApplication(collectionName);
50 }
51}
Note: See TracBrowser for help on using the repository browser.