[Git][java-team/filius][master] 3 commits: New upstream version 2.7.1+ds

Andreas B. Mundt (@andi) gitlab at salsa.debian.org
Sat Dec 14 14:42:13 GMT 2024



Andreas B. Mundt pushed to branch master at Debian Java Maintainers / filius


Commits:
96203af1 by Andreas B. Mundt at 2024-12-14T13:08:50+01:00
New upstream version 2.7.1+ds
- - - - -
a12e05f4 by Andreas B. Mundt at 2024-12-14T13:08:50+01:00
Update upstream source from tag 'upstream/2.7.1+ds'

Update to upstream version '2.7.1+ds'
with Debian dir 97110e729809e473aee8b8cd545fbcb243b4cae5
- - - - -
35dd1012 by Andreas B. Mundt at 2024-12-14T13:12:27+01:00
Update changelog and prepare release

- - - - -


17 changed files:

- Changelog.md
- debian/changelog
- pom.xml
- src/main/java/filius/Main.java
- src/main/java/filius/gui/GUIMainMenu.java
- + src/main/java/filius/gui/LanguageSelectionDialog.java
- src/main/java/filius/rahmenprogramm/Information.java
- src/main/java/filius/rahmenprogramm/SzenarioVerwaltung.java
- src/main/java/filius/software/lokal/Terminal.java
- src/main/java/filius/software/vermittlungsschicht/ARP.java
- src/main/java/filius/software/vermittlungsschicht/ICMP.java
- src/main/java/filius/software/vermittlungsschicht/IP.java
- src/main/resources/filius/messages/MessagesBundle_de_DE.properties
- src/main/resources/filius/messages/MessagesBundle_en_GB.properties
- src/main/resources/filius/messages/MessagesBundle_fr_FR.properties
- + src/main/resources/gfx/allgemein/settings.png
- src/main/resources/gfx/copyright_and_license.txt


Changes:

=====================================
Changelog.md
=====================================
@@ -1,5 +1,22 @@
 # Changelog Filius
 
+## [2.7.1] - 2024-11-30
+### Fixed
+ * Start-up with Filius scenario as program argument fixed
+ 
+## [2.7.0] - 2024-11-23
+### Added
+ * New settings dialog to change the language
+ 
+### Changed
+ * Store changes automatically in personal profile when exiting the program
+ * Closing the program without prompt to store changes
+
+### Fixed
+ * Tracerout starts first ping with TTL 1
+ * Fix DHCP issues that are caused by not sending ARP requests without proper IP configuration
+ * Fix tooltip text: shortcut for info dialog
+ 
 ## [2.6.1] - 2024-08-23
 ### Changed
  * Shortcut to open info dialog changed to Ctrl+I


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+filius (2.7.1+ds-1) unstable; urgency=medium
+
+  * New upstream version 2.7.1+ds
+
+ -- Andreas B. Mundt <andi at debian.org>  Sat, 14 Dec 2024 13:11:43 +0100
+
 filius (2.6.1+ds-1) unstable; urgency=medium
 
   * Fix watch file


=====================================
pom.xml
=====================================
@@ -4,9 +4,9 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>filius</groupId>
 	<artifactId>filius</artifactId>
-	<version>2.6.1</version>
+	<version>2.7.1</version>
 	<properties>
-		<buildDate>23.08.2024</buildDate>
+		<buildDate>30.11.2024</buildDate>
 		<publisher>Stefan Freischlad</publisher>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<junit.version>4.10</junit.version>


=====================================
src/main/java/filius/Main.java
=====================================
@@ -37,7 +37,6 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Locale;
 
-import javax.swing.JOptionPane;
 import javax.swing.UIManager;
 import javax.swing.UnsupportedLookAndFeelException;
 
@@ -51,6 +50,7 @@ import ch.qos.logback.core.joran.spi.JoranException;
 import filius.gui.GUIContainer;
 import filius.gui.GUIMainMenu;
 import filius.gui.JMainFrame;
+import filius.gui.LanguageSelectionDialog;
 import filius.gui.SplashScreen;
 import filius.hardware.Verbindung;
 import filius.rahmenprogramm.FiliusArgs;
@@ -65,10 +65,6 @@ import filius.rahmenprogramm.SzenarioVerwaltung;
 public class Main implements I18n {
     private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
-    private static final String FRANCAIS = "Français";
-    private static final String ENGLISH = "English";
-    private static final String DEUTSCH = "Deutsch";
-
     /**
      * Der Start laeuft folgendermassen ab:
      * <ol>
@@ -87,8 +83,6 @@ public class Main implements I18n {
         LOG.trace("INVOKED (static) filius.Main, starten(" + szenarioDatei + ")");
         SplashScreen splashScreen;
         XMLDecoder xmldec;
-        String konfigPfad;
-        Object[] programmKonfig;
 
         try {
             Information.getInformation().loadIni();
@@ -96,30 +90,19 @@ public class Main implements I18n {
             LOG.debug("ini could not be read: " + e1.getMessage());
         }
 
-        konfigPfad = Information.getInformation().getArbeitsbereichPfad() + "konfig.xml";
+        String konfigPfad = Information.getInformation().getArbeitsbereichPfad() + "konfig.xml";
+        String lastSzenarioDatei = null;
+        String editedSzenarioDatei = null;
         if (!(new File(konfigPfad)).exists() && null == Information.getInformation().getLocale()) {
-            String[] possibleValues = { DEUTSCH, ENGLISH, FRANCAIS };
-            String selectedValue = (String) JOptionPane.showInputDialog(null, "", "Sprache/Language/Langue",
-                    JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]);
-            if (selectedValue == null) {
-                Information.getInformation().setLocale(Locale.GERMANY);
-            } else if (ENGLISH.equals(selectedValue)) {
-                Information.getInformation().setLocale(Locale.UK);
-            } else if (FRANCAIS.equals(selectedValue)) {
-                Information.getInformation().setLocale(Locale.FRANCE);
-            } else {
-                Information.getInformation().setLocale(Locale.GERMANY);
-            }
+            LanguageSelectionDialog.selectLanguage(false);
         } else {
             try {
                 xmldec = new XMLDecoder(new BufferedInputStream(Files.newInputStream(Paths.get(konfigPfad))));
-                programmKonfig = (Object[]) xmldec.readObject();
+                Object[] programmKonfig = (Object[]) xmldec.readObject();
                 if (programmKonfig != null) {
                     if (programmKonfig.length >= 4) {
                         JMainFrame.getJMainFrame().setBounds((Rectangle) programmKonfig[0]);
-                        if (szenarioDatei == null) {
-                            szenarioDatei = (String) programmKonfig[1];
-                        }
+                        lastSzenarioDatei = (String) programmKonfig[1];
                         if (programmKonfig[2] != null && programmKonfig[3] != null
                                 && null == Information.getInformation().getLocale()) {
                             Information.getInformation()
@@ -129,6 +112,11 @@ public class Main implements I18n {
                     if (programmKonfig.length >= 5) {
                         Information.getInformation().setLastOpenedDirectory((String) programmKonfig[4]);
                     }
+                    if (programmKonfig.length >= 6 && (Boolean) programmKonfig[5]) {
+                        editedSzenarioDatei = Information.getInformation().getArbeitsbereichPfad()
+                                + Information.FILENAME_EDITED_SZENARIO;
+                        ;
+                    }
                 }
             } catch (Exception e) {
                 LOG.debug("There is no user configuration available.");
@@ -148,13 +136,22 @@ public class Main implements I18n {
 
         long splashTime = System.currentTimeMillis();
 
-        if (szenarioDatei != null) {
-            try {
+        try {
+            if (null != szenarioDatei) {
                 SzenarioVerwaltung.getInstance().laden(szenarioDatei, GUIContainer.getGUIContainer().getKnotenItems(),
                         GUIContainer.getGUIContainer().getCableItems(), GUIContainer.getGUIContainer().getDocuItems());
-            } catch (Exception e) {
-                LOG.debug("", e);
+            } else if (null != editedSzenarioDatei) {
+                SzenarioVerwaltung.getInstance().laden(editedSzenarioDatei,
+                        GUIContainer.getGUIContainer().getKnotenItems(), GUIContainer.getGUIContainer().getCableItems(),
+                        GUIContainer.getGUIContainer().getDocuItems());
+                SzenarioVerwaltung.getInstance().setCurrentFile(lastSzenarioDatei, true);
+            } else if (null != lastSzenarioDatei) {
+                SzenarioVerwaltung.getInstance().laden(lastSzenarioDatei,
+                        GUIContainer.getGUIContainer().getKnotenItems(), GUIContainer.getGUIContainer().getCableItems(),
+                        GUIContainer.getGUIContainer().getDocuItems());
             }
+        } catch (Exception e) {
+            LOG.debug("", e);
         }
         GUIContainer.getGUIContainer().setProperty(null);
         GUIContainer.getGUIContainer().updateViewport();
@@ -207,17 +204,22 @@ public class Main implements I18n {
         GUIContainer.getGUIContainer().getMenu().selectMode(GUIMainMenu.MODUS_ENTWURF);
 
         if (SzenarioVerwaltung.getInstance().istGeaendert()) {
-            entscheidung = JOptionPane.showConfirmDialog(JMainFrame.getJMainFrame(), messages.getString("main_msg1"),
-                    messages.getString("main_msg2"), JOptionPane.YES_NO_OPTION);
-            abbruch = entscheidung != JOptionPane.YES_OPTION;
+            // entscheidung = JOptionPane.showConfirmDialog(JMainFrame.getJMainFrame(), messages.getString("main_msg1"),
+            // messages.getString("main_msg2"), JOptionPane.YES_NO_OPTION);
+            // abbruch = entscheidung != JOptionPane.YES_OPTION;
+            SzenarioVerwaltung.getInstance().speichern(
+                    Information.getInformation().getArbeitsbereichPfad() + Information.FILENAME_EDITED_SZENARIO,
+                    GUIContainer.getGUIContainer().getKnotenItems(), GUIContainer.getGUIContainer().getCableItems(),
+                    GUIContainer.getGUIContainer().getDocuItems());
         }
         if (!abbruch) {
-            programmKonfig = new Object[5];
+            programmKonfig = new Object[6];
             programmKonfig[0] = JMainFrame.getJMainFrame().getBounds();
             programmKonfig[1] = SzenarioVerwaltung.getInstance().holePfad();
             programmKonfig[2] = Information.getInformation().getLocale().getLanguage();
             programmKonfig[3] = Information.getInformation().getLocale().getCountry();
             programmKonfig[4] = Information.getInformation().getLastOpenedDirectory();
+            programmKonfig[5] = SzenarioVerwaltung.getInstance().istGeaendert();
 
             String applicationConfigPath = Information.getInformation().getArbeitsbereichPfad() + "konfig.xml";
             try (FileOutputStream fos = new FileOutputStream(applicationConfigPath);


=====================================
src/main/java/filius/gui/GUIMainMenu.java
=====================================
@@ -85,6 +85,7 @@ public class GUIMainMenu implements Serializable, I18n {
     private JButton btWizard;
     private JButton btHilfe;
     private JButton btInfo;
+    private JButton btSettings;
 
     public GUIMainMenu() {
         LOG.trace("INVOKED (" + this.hashCode() + ") " + getClass() + " (GUIMainMenu), constr: GUIMainMenu()");
@@ -96,6 +97,12 @@ public class GUIMainMenu implements Serializable, I18n {
         menupanel.setEnabled(false);
         menupanel.setBackgroundImage("gfx/allgemein/menue_hg.png");
 
+        btNeu = new JButton();
+        btNeu.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/neu.png")));
+        btNeu.setBounds(10, 5, btNeu.getIcon().getIconWidth(), btNeu.getIcon().getIconHeight());
+        btNeu.setActionCommand("neu");
+        btNeu.setToolTipText(messages.getString("guimainmemu_msg5"));
+
         btOeffnen = new JButton();
         btOeffnen.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/oeffnen.png")));
         btOeffnen.setBounds(80, 5, btOeffnen.getIcon().getIconWidth(), btOeffnen.getIcon().getIconHeight());
@@ -108,6 +115,12 @@ public class GUIMainMenu implements Serializable, I18n {
         btSpeichern.setActionCommand("speichern");
         btSpeichern.setToolTipText(messages.getString("guimainmemu_msg2"));
 
+        btDokumodus = new JButton();
+        btDokumodus.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/dokumodus.png")));
+        btDokumodus.setBounds(250, 5, btDokumodus.getIcon().getIconWidth(), btDokumodus.getIcon().getIconHeight());
+        btDokumodus.setActionCommand("dokumodus");
+        btDokumodus.setToolTipText(messages.getString("guimainmemu_msg14"));
+
         btEntwurfsmodus = new JButton();
         btEntwurfsmodus.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/entwurfsmodus_aktiv.png")));
         btEntwurfsmodus.setBounds(350, 5, btEntwurfsmodus.getIcon().getIconWidth(),
@@ -122,38 +135,32 @@ public class GUIMainMenu implements Serializable, I18n {
         btAktionsmodus.setActionCommand("aktionsmodus");
         btAktionsmodus.setToolTipText(messages.getString("guimainmemu_msg4"));
 
-        btNeu = new JButton();
-        btNeu.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/neu.png")));
-        btNeu.setBounds(10, 5, btNeu.getIcon().getIconWidth(), btNeu.getIcon().getIconHeight());
-        btNeu.setActionCommand("neu");
-        btNeu.setToolTipText(messages.getString("guimainmemu_msg5"));
-
-        btDokumodus = new JButton();
-        btDokumodus.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/dokumodus.png")));
-        btDokumodus.setBounds(250, 5, btDokumodus.getIcon().getIconWidth(), btDokumodus.getIcon().getIconHeight());
-        btDokumodus.setActionCommand("dokumodus");
-        btDokumodus.setToolTipText(messages.getString("guimainmemu_msg14"));
-
         if (isSoftwareWizardEnabled()) {
             btWizard = new JButton();
             btWizard.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/button_wizard.png")));
-            btWizard.setBounds(720, 5, btWizard.getIcon().getIconWidth(), btWizard.getIcon().getIconHeight());
+            btWizard.setBounds(700, 5, btWizard.getIcon().getIconWidth(), btWizard.getIcon().getIconHeight());
             btWizard.setActionCommand("wizard");
             btWizard.setToolTipText(messages.getString("guimainmemu_msg6"));
         }
 
         btHilfe = new JButton();
         btHilfe.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/hilfe.png")));
-        btHilfe.setBounds(840, 5, btHilfe.getIcon().getIconWidth(), btHilfe.getIcon().getIconHeight());
+        btHilfe.setBounds(800, 5, btHilfe.getIcon().getIconWidth(), btHilfe.getIcon().getIconHeight());
         btHilfe.setActionCommand("hilfe");
         btHilfe.setToolTipText(messages.getString("guimainmemu_msg7"));
 
         btInfo = new JButton();
         btInfo.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/info.png")));
-        btInfo.setBounds(910, 5, btInfo.getIcon().getIconWidth(), btInfo.getIcon().getIconHeight());
+        btInfo.setBounds(870, 5, btInfo.getIcon().getIconWidth(), btInfo.getIcon().getIconHeight());
         btInfo.setActionCommand("info");
         btInfo.setToolTipText(messages.getString("guimainmemu_msg8"));
 
+        btSettings = new JButton();
+        btSettings.setIcon(new ImageIcon(getClass().getResource("/gfx/allgemein/settings.png")));
+        btSettings.setBounds(940, 5, btInfo.getIcon().getIconWidth(), btInfo.getIcon().getIconHeight());
+        btSettings.setActionCommand("settings");
+        btSettings.setToolTipText(messages.getString("guimainmemu_msg18"));
+
         ActionListener al = new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                 if (isSoftwareWizardEnabled() && e.getActionCommand().equals(btWizard.getActionCommand())) {
@@ -187,6 +194,8 @@ public class GUIMainMenu implements Serializable, I18n {
                     selectMode(MODUS_DOKUMENTATION);
                 } else if (e.getActionCommand().equals(btInfo.getActionCommand())) {
                     (new InfoDialog(JMainFrame.getJMainFrame())).setVisible(true);
+                } else if (e.getActionCommand().equals(btSettings.getActionCommand())) {
+                    LanguageSelectionDialog.selectLanguage(true);
                 }
             }
         };
@@ -202,6 +211,7 @@ public class GUIMainMenu implements Serializable, I18n {
         }
         btInfo.addActionListener(al);
         btHilfe.addActionListener(al);
+        btSettings.addActionListener(al);
 
         geschwindigkeit = new JLabel();
         geschwindigkeit.setVisible(true);
@@ -238,6 +248,7 @@ public class GUIMainMenu implements Serializable, I18n {
         }
         menupanel.add(btHilfe);
         menupanel.add(btInfo);
+        menupanel.add(btSettings);
     }
 
     private void updateLatency() {
@@ -297,6 +308,8 @@ public class GUIMainMenu implements Serializable, I18n {
             btHilfe.doClick();
         else if (button.equals("btInfo"))
             btInfo.doClick();
+        else if (button.equals("btSettings"))
+            btSettings.doClick();
         else
             return false;
         return true;
@@ -398,7 +411,9 @@ public class GUIMainMenu implements Serializable, I18n {
                 erfolg = SzenarioVerwaltung.getInstance().speichern(targetFilePath,
                         GUIContainer.getGUIContainer().getKnotenItems(), GUIContainer.getGUIContainer().getCableItems(),
                         GUIContainer.getGUIContainer().getDocuItems());
-                if (!erfolg) {
+                if (erfolg) {
+                    SzenarioVerwaltung.getInstance().setCurrentFile(targetFilePath, false);
+                } else {
                     JOptionPane.showMessageDialog(JMainFrame.getJMainFrame(), messages.getString("guimainmemu_msg11"));
                 }
             }


=====================================
src/main/java/filius/gui/LanguageSelectionDialog.java
=====================================
@@ -0,0 +1,224 @@
+/*
+ ** This file is part of Filius, a network construction and simulation software.
+ ** 
+ ** Originally created at the University of Siegen, Institute "Didactics of
+ ** Informatics and E-Learning" by a students' project group:
+ **     members (2006-2007): 
+ **         André Asschoff, Johannes Bade, Carsten Dittich, Thomas Gerding,
+ **         Nadja Haßler, Ernst Johannes Klebert, Michell Weyer
+ **     supervisors:
+ **         Stefan Freischlad (maintainer until 2009), Peer Stechert
+ ** Project is maintained since 2010 by Christian Eibl <filius at c.fameibl.de>
+ **         and Stefan Freischlad
+ ** Filius 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 2 of the License, or
+ ** (at your option) version 3.
+ ** 
+ ** Filius 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 Filius.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package filius.gui;
+
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+
+import filius.Main;
+import filius.rahmenprogramm.Information;
+
+ at SuppressWarnings("serial")
+public class LanguageSelectionDialog extends JDialog {
+
+    private static final String FRANCAIS = "Français";
+    private static final String ENGLISH = "English";
+    private static final String DEUTSCH = "Deutsch";
+
+    private JLabel selectLanguageLabel = new JLabel();
+    private JComboBox<String> languageSelection = new JComboBox<>();
+    private JLabel restartHint = new JLabel();
+    private JButton confirm = new JButton();
+    private JButton confirmAndExit = new JButton();
+    private JButton cancel = new JButton();
+    private Box buttonBox = Box.createHorizontalBox();
+
+    private LanguageSelectionDialog(boolean restartMode) {
+        super(restartMode ? JMainFrame.getJMainFrame() : null);
+        this.setModal(true);
+        Image image = Toolkit.getDefaultToolkit()
+                .getImage(LanguageSelectionDialog.class.getResource("/gfx/hardware/kabel.png"));
+        this.setIconImage(image);
+        this.setTitle("Sprache / Language / Langue");
+        this.setResizable(false);
+        initialize(restartMode);
+        initializeText(Information.getInformation().getLocaleOrDefault());
+    }
+
+    private void initializeText(Locale locale) {
+        ResourceBundle bundle = ResourceBundle.getBundle("filius.messages.MessagesBundle", locale);
+
+        selectLanguageLabel.setText(bundle.getString("languageSelection_msg1"));
+        restartHint.setText("<html>" + bundle.getString("languageSelection_msg2") + "</html>");
+        confirm.setText(bundle.getString("languageSelection_msg3"));
+        confirmAndExit.setText(bundle.getString("languageSelection_msg4"));
+        cancel.setText(bundle.getString("languageSelection_msg5"));
+
+        buttonBox.updateUI();
+    }
+
+    public static void selectLanguage(boolean restart) {
+        LanguageSelectionDialog instance = new LanguageSelectionDialog(restart);
+        instance.setVisible(true);
+    }
+
+    private void apply() {
+        String selectedValue = (String) languageSelection.getSelectedItem();
+        Information.getInformation().setLocale(languateToLocale(selectedValue));
+    }
+
+    private Locale languateToLocale(String language) {
+        Locale locale = Locale.UK;
+        if (FRANCAIS.equals(language)) {
+            locale = Locale.FRANCE;
+        } else if (DEUTSCH.equals(language)) {
+            locale = Locale.GERMANY;
+        }
+        return locale;
+    }
+
+    private String localeToLanguage(Locale locale) {
+        String language;
+        if (null == locale || Locale.UK.getCountry().equals(locale.getCountry())) {
+            language = ENGLISH;
+        } else if (Locale.FRANCE.getCountry().equals(locale.getCountry())) {
+            language = FRANCAIS;
+        } else {
+            language = DEUTSCH;
+        }
+        return language;
+    }
+
+    private void initialize(boolean restartMode) {
+        Box verticalBox = Box.createVerticalBox();
+        verticalBox.setPreferredSize(new Dimension(400, 240));
+        getContentPane().add(verticalBox);
+        pack();
+
+        if (restartMode) {
+            Rectangle mainFrameBounds = JMainFrame.getJMainFrame().getBounds();
+            setLocation(mainFrameBounds.x + mainFrameBounds.width / 2 - getWidth() / 2,
+                    mainFrameBounds.y + mainFrameBounds.height / 2 - getHeight() / 2);
+        } else {
+            setLocation((getToolkit().getScreenSize().width - getWidth()) / 2,
+                    (getToolkit().getScreenSize().height - getHeight()) / 2);
+        }
+
+        verticalBox.add(Box.createVerticalStrut(10));
+
+        Box labelBox = Box.createHorizontalBox();
+        labelBox.add(Box.createHorizontalStrut(10));
+        labelBox.add(selectLanguageLabel);
+        labelBox.add(Box.createGlue());
+        verticalBox.add(labelBox);
+
+        verticalBox.add(Box.createVerticalStrut(10));
+
+        languageSelection.addItem(DEUTSCH);
+        languageSelection.addItem(ENGLISH);
+        languageSelection.addItem(FRANCAIS);
+        languageSelection.setSelectedItem(localeToLanguage(Information.getInformation().getLocaleOrDefault()));
+        languageSelection.setMaximumSize(new Dimension(380, 30));
+        languageSelection.setPreferredSize(new Dimension(380, 30));
+        languageSelection.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                LanguageSelectionDialog.this
+                        .initializeText(languateToLocale((String) languageSelection.getSelectedItem()));
+            }
+        });
+
+        Box selectBox = Box.createHorizontalBox();
+        selectBox.add(Box.createHorizontalStrut(10));
+        selectBox.add(languageSelection);
+        selectBox.add(Box.createGlue());
+        verticalBox.add(selectBox);
+
+        if (restartMode) {
+            verticalBox.add(Box.createVerticalStrut(10));
+
+            Box hintBox = Box.createHorizontalBox();
+            hintBox.add(Box.createHorizontalStrut(10));
+            // hintBox.setBorder(BorderFactory.createEtchedBorder());
+            restartHint.setPreferredSize(new Dimension(350, 60));
+            restartHint.setSize(new Dimension(350, 60));
+            restartHint.setMinimumSize(new Dimension(350, 60));
+            hintBox.add(restartHint);
+            hintBox.add(Box.createGlue());
+            verticalBox.add(hintBox);
+
+            verticalBox.add(Box.createVerticalStrut(10));
+        } else {
+            verticalBox.add(Box.createVerticalStrut(90));
+        }
+
+        // buttonBox.setAlignmentX(Box.RIGHT_ALIGNMENT);
+        // buttonBox.setBorder(BorderFactory.createEtchedBorder());
+        buttonBox.setSize(new Dimension(390, 50));
+        buttonBox.setPreferredSize(new Dimension(390, 50));
+        buttonBox.setMinimumSize(new Dimension(390, 50));
+        if (restartMode) {
+            cancel.setPreferredSize(new Dimension(120, 30));
+            cancel.addActionListener(new ActionListener() {
+
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    LanguageSelectionDialog.this.setVisible(false);
+                }
+            });
+            buttonBox.add(cancel);
+            buttonBox.add(Box.createHorizontalStrut(10));
+
+            confirmAndExit.addActionListener(new ActionListener() {
+
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    LanguageSelectionDialog.this.apply();
+                    Main.beenden();
+                }
+            });
+            buttonBox.add(confirmAndExit);
+        } else {
+            confirm.setPreferredSize(new Dimension(250, 30));
+            confirm.addActionListener(new ActionListener() {
+
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    LanguageSelectionDialog.this.apply();
+                    LanguageSelectionDialog.this.setVisible(false);
+                }
+            });
+            buttonBox.add(confirm);
+        }
+
+        verticalBox.add(Box.createVerticalGlue());
+
+        verticalBox.add(buttonBox);
+    }
+}


=====================================
src/main/java/filius/rahmenprogramm/Information.java
=====================================
@@ -71,6 +71,8 @@ public class Information implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    public static final String FILENAME_EDITED_SZENARIO = "edited_scenario.fls";
+
     /** Zur Implementierung des Singleton */
     private static Information information = null;
 
@@ -260,9 +262,7 @@ public class Information implements Serializable {
      * @return
      */
     public ResourceBundle holeResourceBundle() {
-        ResourceBundle bundle;
-
-        bundle = ResourceBundle.getBundle("filius.messages.MessagesBundle", getLocaleOrDefault());
+        ResourceBundle bundle = ResourceBundle.getBundle("filius.messages.MessagesBundle", getLocaleOrDefault());
 
         return bundle;
     }


=====================================
src/main/java/filius/rahmenprogramm/SzenarioVerwaltung.java
=====================================
@@ -130,15 +130,6 @@ public class SzenarioVerwaltung extends Observable implements I18n {
             LOG.debug("ERROR (" + this.hashCode() + "): Speicherung der Projektdatei fehlgeschlagen!");
             erfolg = false;
         }
-
-        if (erfolg) {
-            pfad = datei;
-            geaendert = false;
-
-            this.setChanged();
-            this.notifyObservers();
-        }
-
         loescheDateien(tmpDir);
 
         return erfolg;
@@ -223,16 +214,20 @@ public class SzenarioVerwaltung extends Observable implements I18n {
         }
 
         if (erfolg) {
-            pfad = datei;
-            geaendert = false;
-
-            this.setChanged();
-            this.notifyObservers();
+            setCurrentFile(datei, false);
         }
 
         return erfolg;
     }
 
+    public void setCurrentFile(String scenarioPath, boolean changeStatus) {
+        pfad = scenarioPath;
+        geaendert = changeStatus;
+
+        this.setChanged();
+        this.notifyObservers();
+    }
+
     private static boolean netzwerkLaden(String datei, List<GUIKnotenItem> hardwareItems, List<GUIKabelItem> kabelItems,
             List<GUIDocuItem> docuItems) {
         LOG.trace("INVOKED (static) filius.rahmenprogramm.SzenarioVerwaltung, netzwerkLaden(" + datei + ","


=====================================
src/main/java/filius/software/lokal/Terminal.java
=====================================
@@ -974,7 +974,7 @@ public class Terminal extends ClientAnwendung implements I18n {
         int fehler = 0;
         int ttl;
 
-        for (ttl = 0; ttl < maxHops && !interrupted; ttl++) {
+        for (ttl = 1; ttl <= maxHops && !interrupted; ttl++) {
             benachrichtigeBeobachter(" " + ttl + "    ");
 
             for (int i = 0; i < 3 && !interrupted; i++) {


=====================================
src/main/java/filius/software/vermittlungsschicht/ARP.java
=====================================
@@ -251,6 +251,11 @@ public class ARP extends VermittlungsProtokoll {
                 bestNic = nic;
             }
         }
+        // If the IP address is not yet initialized, no NIC could be selected. So use the first NIC (required for DHCP)
+        if (null == bestNic) {
+            bestMask = IP.inetAton(((InternetKnotenBetriebssystem) holeSystemSoftware()).primarySubnetMask());
+            bestNic = ((InternetKnoten) holeSystemSoftware().getKnoten()).getNetzwerkInterfaces().get(0);
+        }
         return bestNic;
     }
 


=====================================
src/main/java/filius/software/vermittlungsschicht/ICMP.java
=====================================
@@ -215,7 +215,7 @@ public class ICMP extends VermittlungsProtokoll implements I18n {
      *            das zu versendende ICMP-Paket
      */
     public void weiterleitenPaket(IcmpPaket icmpPaket) {
-        if (icmpPaket.getTtl() <= 0) {
+        if (icmpPaket.getTtl() <= 1) {
             // TTL ist abgelaufen.
             // (wird in ICMPThread.verarbeiteDatenEinheit()
             // dekrementiert, bevor diese Funktion aufgerufen


=====================================
src/main/java/filius/software/vermittlungsschicht/IP.java
=====================================
@@ -282,7 +282,7 @@ public class IP extends VermittlungsProtokoll implements I18n {
     public void weiterleitenPaket(IpPaket paket) {
         InternetKnotenBetriebssystem bs = (InternetKnotenBetriebssystem) holeSystemSoftware();
 
-        if (paket.getTtl() <= 0) {
+        if (paket.getTtl() <= 1) {
             bs.holeICMP().sendeICMP(ICMP.TYPE_TIME_EXCEEDED, ICMP.CODE_TTL_EXPIRED, paket.getSender());
         } else {
             try {


=====================================
src/main/resources/filius/messages/MessagesBundle_de_DE.properties
=====================================
@@ -8,6 +8,12 @@ main_dlg_YES = Ja
 main_dlg_NO = Nein
 main_dlg_CANCEL = Abbrechen
 
+languageSelection_msg1 = Sprache whlen
+languageSelection_msg2 = Damit die nderung wirksam wird, muss FILIUS neu gestartet werden.
+languageSelection_msg3 = Besttigen
+languageSelection_msg4 = Besttigen und Programm beenden
+languageSelection_msg5 = Abbrechen
+
 splashscreen_msg1 = Lizenz: GNU General Public License Version 2 oder 3
 
 docusidebar_msg1 = Text
@@ -515,7 +521,7 @@ guimainmemu_msg4 = Wechselt in den Aktionsmodus (Strg+R)
 guimainmemu_msg5 = Erstellt ein neues Projekt (Strg+N)
 guimainmemu_msg6 = Startet den Software-Assistenten (Strg+W)
 guimainmemu_msg7 = Zeigt die Hilfe an (Strg+H)
-guimainmemu_msg8 = Informationen zu FILIUS (Strg+A)
+guimainmemu_msg8 = Informationen zu FILIUS (Strg+I)
 guimainmemu_msg9 = Wollen Sie wirklich ein neues Projekt beginnen? \n Alle bisherigen Einstellungen gehen dann verloren. \n Auch eigene Anwendungen werden entfernt.
 guimainmemu_msg10 = Fortfahren?
 guimainmemu_msg11 = Fehler beim Speichern aufgetreten!
@@ -525,6 +531,7 @@ guimainmemu_msg14 = Wechselt in den Dokumentationsmodus
 guimainmemu_msg15 = Aktuelle Simulationsgeschwindigkeit
 guimainmemu_msg16 = Simulationsgeschwindigkeit anpassen
 guimainmemu_msg17 = M\u00f6chten Sie die vorhandene Datei ersetzen?
+guimainmemu_msg18 = Sprache ndern
 
 infodialog_msg1 = Information
 infodialog_msg2 = <html><p><b>FILIUS</b> wurde im Rahmen einer studentischen Projektgruppe an der Universität Siegen entwickelt. (2006-2007)</p>


=====================================
src/main/resources/filius/messages/MessagesBundle_en_GB.properties
=====================================
@@ -8,6 +8,12 @@ main_dlg_YES = Yes
 main_dlg_NO = No
 main_dlg_CANCEL = Cancel
 
+languageSelection_msg1 = Select Language
+languageSelection_msg2 = FILIUS must be restarted to apply change.
+languageSelection_msg3 = Confirm
+languageSelection_msg4 = Confirm and Close Program
+languageSelection_msg5 = Cancel
+
 splashscreen_msg1 = License: GNU General Public License version 2 or 3
 
 docusidebar_msg1 = Text
@@ -514,7 +520,7 @@ guimainmemu_msg4 = Change to Simulation Mode (Ctrl+R)
 guimainmemu_msg5 = Create New Project (Ctrl+N)
 guimainmemu_msg6 = Start Software Assistant (Ctrl+W)
 guimainmemu_msg7 = Show Help (Ctrl+H)
-guimainmemu_msg8 = Information About FILIUS (Ctrl+A)
+guimainmemu_msg8 = Information About FILIUS (Ctrl+I)
 guimainmemu_msg9 = Do you really want to start a new project? \n All previous settings will be discarded. \n Also new applications will be removed.
 guimainmemu_msg10 = Continue?
 guimainmemu_msg11 = Error occured!
@@ -524,6 +530,7 @@ guimainmemu_msg14 = Change to Documentation Mode
 guimainmemu_msg15 = Current Simulation Velocity
 guimainmemu_msg16 = Adjust Simulation Velocity
 guimainmemu_msg17 = Do you want to overwrite the existing file?
+guimainmemu_msg18 = Change Language
 
 infodialog_msg1 = Information
 infodialog_msg2 = <html><p><b>FILIUS</b> was developed as a student project at the Universität Siegen. (2006-2007)</p>


=====================================
src/main/resources/filius/messages/MessagesBundle_fr_FR.properties
=====================================
@@ -9,6 +9,12 @@ main_dlg_YES = Oui
 main_dlg_NO = Non
 main_dlg_CANCEL = Annuler
 
+languageSelection_msg1 = Slectionner la langue
+languageSelection_msg2 = FILIUS doit tre redmarr pour appliquer les modifications.
+languageSelection_msg3 = Confirmer
+languageSelection_msg4 = Confirmer et fermer le programme
+languageSelection_msg5 = Annuler
+
 splashscreen_msg1 = Licence\u00a0: GNU General Public License Version 2 ou 3
 
 docusidebar_msg1 = Texte
@@ -522,7 +528,7 @@ guimainmemu_msg4 = Passer en mode simulation (Ctrl+R)
 guimainmemu_msg5 = Nouveau projet (Ctrl+N)
 guimainmemu_msg6 = D\u00e9marrer l\u2019assistant logiciel (Ctrl+W)
 guimainmemu_msg7 = Afficher l\u2019aide (Ctrl+H)
-guimainmemu_msg8 = \u00c0 propos de FILIUS (Ctrl+A)
+guimainmemu_msg8 = \u00c0 propos de FILIUS (Ctrl+I)
 guimainmemu_msg9 = Les derni\u00e8res modifications n\u2019ont pas \u00e9t\u00e9 sauvegard\u00e9es.\n\
                    Voulez-vous cr\u00e9er un nouveau projet malgr\u00e9 tout\u00a0?
 guimainmemu_msg10 = Nouveau projet
@@ -533,6 +539,7 @@ guimainmemu_msg14 = Passer en mode documentation
 guimainmemu_msg15 = Vitesse de la simulation
 guimainmemu_msg16 = Ajuster la vitesse de simulation
 guimainmemu_msg17 = Voulez-vous replacer le fichier existant?
+guimainmemu_msg18 = Changer de langue
 
 infodialog_msg1 = Information
 infodialog_msg2 = <html><p><b>FILIUS</b> a été développé dans le cadre du projet d’un groupe d’étudiants de l’université de Siegen. (2006-2007)</p>


=====================================
src/main/resources/gfx/allgemein/settings.png
=====================================
Binary files /dev/null and b/src/main/resources/gfx/allgemein/settings.png differ


=====================================
src/main/resources/gfx/copyright_and_license.txt
=====================================
@@ -30,3 +30,9 @@ Nuvola_mimetypes_pdf.png / pdf_small.png
 Designer: David Vignoni / ICON KING
 License: GNU GPL 2.1 or later
 https://commons.wikimedia.org/wiki/File:Nuvola_mimetypes_pdf.png
+
+settings.png
+-----------------------
+Designer: Pau Giner
+License: Creative Commons CC0 1.0 Universal Public Domain Dedication
+https://commons.wikimedia.org/wiki/File:WMF-Agora-Settings_BCBCBC.svg
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/java-team/filius/-/compare/baa26db43326c5f47ed6b0a6738261c4ba0f29a2...35dd1012e4c38ce39e93c968cde66400700bd470

-- 
View it on GitLab: https://salsa.debian.org/java-team/filius/-/compare/baa26db43326c5f47ed6b0a6738261c4ba0f29a2...35dd1012e4c38ce39e93c968cde66400700bd470
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20241214/b844330f/attachment.htm>


More information about the pkg-java-commits mailing list