[17156] | 1 | package org.greenstone3.ms;
|
---|
| 2 |
|
---|
| 3 | import java.awt.Toolkit;
|
---|
| 4 | import javax.swing.SwingUtilities;
|
---|
| 5 | import javax.swing.UIManager;
|
---|
| 6 | import 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 | public class metadatatable {
|
---|
| 21 | boolean packFrame = false;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * Construct and show the application.
|
---|
| 25 | */
|
---|
| 26 | public metadatatable(String[] dataNames, Object[][] dataset) {
|
---|
| 27 | MetadataTableFrame frame = new MetadataTableFrame(dataNames, dataset);
|
---|
| 28 | // Validate frames that have preset sizes
|
---|
| 29 | // Pack frames that have useful preferred size info, e.g. from their layout
|
---|
| 30 | if (packFrame) {
|
---|
| 31 | frame.pack();
|
---|
| 32 | } else {
|
---|
| 33 | frame.validate();
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | // Center the window
|
---|
| 37 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
---|
| 38 | Dimension frameSize = frame.getSize();
|
---|
| 39 | if (frameSize.height > screenSize.height) {
|
---|
| 40 | frameSize.height = screenSize.height;
|
---|
| 41 | }
|
---|
| 42 | if (frameSize.width > screenSize.width) {
|
---|
| 43 | frameSize.width = screenSize.width;
|
---|
| 44 | }
|
---|
| 45 | frame.setLocation((screenSize.width - frameSize.width) / 2,
|
---|
| 46 | (screenSize.height - frameSize.height) / 2);
|
---|
| 47 | frame.setVisible(true);
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | /**
|
---|
| 51 | * Application entry point.
|
---|
| 52 | *
|
---|
| 53 | * @param args String[]
|
---|
| 54 | */
|
---|
| 55 | public static void main(String[] args) {
|
---|
| 56 | SwingUtilities.invokeLater(new Runnable() {
|
---|
| 57 | public void run() {
|
---|
| 58 | try {
|
---|
| 59 | UIManager.setLookAndFeel(UIManager.
|
---|
| 60 | getSystemLookAndFeelClassName());
|
---|
| 61 | } catch (Exception exception) {
|
---|
| 62 | exception.printStackTrace();
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | new metadatatable(null, null);
|
---|
| 66 | }
|
---|
| 67 | });
|
---|
| 68 | }
|
---|
| 69 | }
|
---|