Skip to content

Commit 8b1831b

Browse files
committed
Preparing release 2.4
1 parent 8d0a63b commit 8b1831b

File tree

1 file changed

+36
-28
lines changed

1 file changed

+36
-28
lines changed

src/main/java/com/manolodominguez/opensimmpls/main/openSimMPLS.java

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.manolodominguez.opensimmpls.main;
1717

18+
import com.manolodominguez.opensimmpls.commons.TIPv4AddressGenerator;
1819
import com.manolodominguez.opensimmpls.gui.utils.TImageBroker;
1920
import javax.swing.UIManager;
2021
import javax.swing.UIManager.LookAndFeelInfo;
@@ -26,6 +27,8 @@
2627
import java.awt.Toolkit;
2728
import java.util.ResourceBundle;
2829
import 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

Comments
 (0)