Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java 2.21 KB
1353e182   Nathanael Jourdane   Add minimal eleme...
1
2
3
4
5
/*
 * This file is a part of EpnTAPClient.
 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
1e543ea0   Nathanael Jourdane   Code clean-up
6
 *
1353e182   Nathanael Jourdane   Add minimal eleme...
7
8
9
10
11
12
13
14
15
16
17
18
 * This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU General Public License for more details. You should have received a copy of
 * the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

package eu.omp.irap.vespa.epntapclient;

5d3c344e   Nathanael Jourdane   Use Java logging ...
19
20
import java.util.logging.Logger;

1353e182   Nathanael Jourdane   Add minimal eleme...
21
22
23
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

1353e182   Nathanael Jourdane   Add minimal eleme...
24
import eu.omp.irap.vespa.epntapclient.controller.EpnTapController;
1353e182   Nathanael Jourdane   Add minimal eleme...
25
26
27

/**
 * Simple class to have a main function to launch the EPNTap client.
1e543ea0   Nathanael Jourdane   Code clean-up
28
 *
1353e182   Nathanael Jourdane   Add minimal eleme...
29
30
31
 * @author N. Jourdane
 */
public class EpnTapMainApp {
5d3c344e   Nathanael Jourdane   Use Java logging ...
32
	/** The logger for the class EpnTapMainApp. */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
33
	static final Logger logger = Logger.getLogger(EpnTapMainApp.class.getName());
7706bfa4   Nathanael Jourdane   Use log4j as logg...
34

a7aff3e3   Nathanael Jourdane   Fix Sonar issues
35
36
37
38
	/** Constructor to hide the implicit public one. */
	private EpnTapMainApp() {
	}

1353e182   Nathanael Jourdane   Add minimal eleme...
39
40
	/**
	 * Main function to start the application as standalone.
1e543ea0   Nathanael Jourdane   Code clean-up
41
	 *
1353e182   Nathanael Jourdane   Add minimal eleme...
42
43
	 * @param args The program arguments (not used).
	 */
42819b99   Nathanael Jourdane   Make EpnTAPClient...
44
45
46
47
	public static void main(final String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
1e543ea0   Nathanael Jourdane   Code clean-up
48
				EpnTapMainApp.logger.info("Lauching EPN-TAP application...");
5af53be7   Nathanael Jourdane   Make the applicat...
49
				EpnTapController epnTapControl = new EpnTapController();
42819b99   Nathanael Jourdane   Make EpnTAPClient...
50
51
52
53
54
55
56
57
58
59
60
61
				if (args.length != 0) {
					System.console().writer().println("Usage: EpnTapMainApp");
					return;
				}

				JFrame frame = new JFrame("EPN-TAP client");
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				frame.setContentPane(epnTapControl.getView());
				frame.setVisible(true);
				frame.pack();
				frame.setLocationRelativeTo(null);
			}
1353e182   Nathanael Jourdane   Add minimal eleme...
62
63
64
		});
	}
}