1515 */
1616package com .manolodominguez .opensimmpls .main ;
1717
18+ import com .manolodominguez .opensimmpls .commons .TIPv4AddressGenerator ;
1819import com .manolodominguez .opensimmpls .gui .utils .TImageBroker ;
1920import javax .swing .UIManager ;
2021import javax .swing .UIManager .LookAndFeelInfo ;
2627import java .awt .Toolkit ;
2728import java .util .ResourceBundle ;
2829import javax .swing .SwingUtilities ;
30+ import org .slf4j .Logger ;
31+ import org .slf4j .LoggerFactory ;
2932
3033/**
3134 * This class implements a new OpenSimMPLS network simulator. This is the main
@@ -44,37 +47,42 @@ public class openSimMPLS {
4447 * @since 2.0
4548 */
4649 public static void main (String args []) {
47- // Enable text antialiasing
48- System .setProperty ("awt.useSystemAAFontSettings" , "on" );
49- translations = ResourceBundle .getBundle (AvailableBundles .MAIN_OPENSIMMPLS .getPath ());
50- try {
51- boolean nimbusSet = false ;
52- for (LookAndFeelInfo info : UIManager .getInstalledLookAndFeels ()) {
53- if ("Nimbus" .equals (info .getName ())) {
54- UIManager .setLookAndFeel (info .getClassName ());
55- nimbusSet = true ;
56- break ;
50+ if (args .length > 0 ) {
51+ final Logger logger = LoggerFactory .getLogger (openSimMPLS .class );
52+ logger .info ("OpenSimMPLS GoS/MPLS Network Simulator. Visit https://opensimmpls.manolodominguez.com for additional info." );
53+ } else {
54+ // Enable text antialiasing
55+ System .setProperty ("awt.useSystemAAFontSettings" , "on" );
56+ translations = ResourceBundle .getBundle (AvailableBundles .MAIN_OPENSIMMPLS .getPath ());
57+ try {
58+ boolean nimbusSet = false ;
59+ for (LookAndFeelInfo info : UIManager .getInstalledLookAndFeels ()) {
60+ if ("Nimbus" .equals (info .getName ())) {
61+ UIManager .setLookAndFeel (info .getClassName ());
62+ nimbusSet = true ;
63+ break ;
64+ }
5765 }
66+ if (!nimbusSet ) {
67+ UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
68+ }
69+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e ) {
70+ // FIX: I189N required
71+ System .out .println ("An error happened when starting OpenSimMPLS. Cannot set LaF." );
5872 }
59- if (!nimbusSet ) {
60- UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
61- }
62- } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e ) {
63- // FIX: I189N required
64- System .out .println ("An error happened when starting OpenSimMPLS. Cannot set LaF." );
73+ splash = new JSplash ();
74+ SwingUtilities .invokeLater (() -> {
75+ splash .setVisible (true );
76+ });
77+ splash .setMessage (translations .getString ("Loading_icons..." ));
78+ imagesBroker = TImageBroker .getInstance ();
79+ splash .setMessage (translations .getString ("openSimMPLS.generandoInterfaz" ));
80+ simulator = new JOpenSimMPLS (imagesBroker );
81+ Dimension screenDimensions = Toolkit .getDefaultToolkit ().getScreenSize ();
82+ simulator .setBounds (0 , 0 , screenDimensions .width , screenDimensions .height );
83+ simulator .setVisible (true );
84+ splash .dispose ();
6585 }
66- splash = new JSplash ();
67- SwingUtilities .invokeLater (() -> {
68- splash .setVisible (true );
69- });
70- splash .setMessage (translations .getString ("Loading_icons..." ));
71- imagesBroker = TImageBroker .getInstance ();
72- splash .setMessage (translations .getString ("openSimMPLS.generandoInterfaz" ));
73- simulator = new JOpenSimMPLS (imagesBroker );
74- Dimension screenDimensions = Toolkit .getDefaultToolkit ().getScreenSize ();
75- simulator .setBounds (0 , 0 , screenDimensions .width , screenDimensions .height );
76- simulator .setVisible (true );
77- splash .dispose ();
7886 }
7987
8088 // Variables declaration - do not modify
0 commit comments