summaryrefslogtreecommitdiff
path: root/sources/prefs
diff options
context:
space:
mode:
authorPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
committerPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
commit9fc2fc3ccdedf1b7e48f8dfb618ca6cb6a2a662e (patch)
tree0fa92fe4e75cb53ffbf7eb56b5455eb9457bb06c /sources/prefs
parentf7873669a43421331e14b8921ebdaa8af4393bd5 (diff)
parent32749241efc1f5f70056d74a90237388f57ea350 (diff)
Merge remote-tracking branch 'remotes/github/packages' into packagespackages
Diffstat (limited to 'sources/prefs')
-rw-r--r--sources/prefs/VSDefaultPrefs.java301
-rw-r--r--sources/prefs/VSDefaultPrefsDE.java275
-rw-r--r--sources/prefs/VSPrefs.java1210
-rw-r--r--sources/prefs/VSPrefsRestriction.java157
-rw-r--r--sources/prefs/VSSerializablePrefs.java60
-rw-r--r--sources/prefs/editors/VSAbstractBetterEditor.java126
-rw-r--r--sources/prefs/editors/VSAbstractEditor.java1061
-rw-r--r--sources/prefs/editors/VSColorChooser.java78
-rw-r--r--sources/prefs/editors/VSEditorFrame.java117
-rw-r--r--sources/prefs/editors/VSEditorTable.java314
-rw-r--r--sources/prefs/editors/VSProcessEditor.java131
-rw-r--r--sources/prefs/editors/VSSimulatorEditor.java143
12 files changed, 0 insertions, 3973 deletions
diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java
deleted file mode 100644
index 63a2127..0000000
--- a/sources/prefs/VSDefaultPrefs.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package prefs;
-
-import java.awt.Color;
-import java.awt.event.KeyEvent;
-
-/**
- * The class VSDefaultPrefs, makes sure that the simulator has its default
- * configuration values.
- *
- * @author Paul C. Buetow
- */
-public class VSDefaultPrefs extends VSSerializablePrefs {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /**
- * Inits a prefs object with default values.
- *
- * @return the lang.process.removeprefs
- */
- public static VSPrefs init() {
- VSDefaultPrefs prefs = new VSDefaultPrefs();
- prefs.fillWithDefaults();
- return prefs;
- }
-
- /**
- * Fill everything with ts defaults.
- */
- public void fillWithDefaults() {
- super.clear();
- addWithDefaults();
- }
-
- /**
- * Adds default values if not existent.
- */
- public void addWithDefaults() {
- fillDefaultBooleans();
- fillDefaultColors();
- fillDefaultFloats();
- fillDefaultIntegers();
- fillDefaultLongs();
- fillDefaultStrings();
- }
-
- /**
- * Fill with default strings.
- */
- public void fillDefaultStrings() {
- initString("lang.en.about", "About");
- initString("lang.en.about.info", "This program used to be the diploma thesis of Paul C. Buetow. Please contact vs@dev.buetow.org, if you find any errors!");
- initString("lang.en.activate", "activate");
- initString("lang.en.activated", "activated");
- initString("lang.en.actualize", "Activation");
- initString("lang.en.all", "All");
- initString("lang.en.antialiasing", "Anti-Aliasing");
- initString("lang.en.cancel", "Abort");
- initString("lang.en.client", "Client");
- initString("lang.en.clientrequest.start", "Start client request");
- initString("lang.en.close", "Close");
- initString("lang.en.colorchooser", "Color chooser");
- initString("lang.en.colorchooser2", "Please select color");
- initString("lang.en.copy", "Copy");
- initString("lang.en.crashed", "Crashed");
- initString("lang.en.dat", "Simulation (.dat)");
- initString("lang.en.deactivate", "deactivate");
- initString("lang.en.deactivated", "deactivated");
- initString("lang.en.default", "Defaults");
- initString("lang.en.edit", "Edit");
- initString("lang.en.editor", "Editor");
- initString("lang.en.event", "Event");
- initString("lang.en.event.add.global", "Insert global event");
- initString("lang.en.event.add.local", "Insert local event");
- initString("lang.en.event.add.time", "at");
- initString("lang.en.events", "Events");
- initString("lang.en.events.process", "Process events");
- initString("lang.en.file", "File");
- initString("lang.en.filter", "Filter");
- initString("lang.en.loging.active", "Logging");
- initString("lang.en.loging.clear", "Delete logs");
- initString("lang.en.message", "Message");
- initString("lang.en.message.recv", "Message received");
- initString("lang.en.message.sent", "Message sent");
- initString("lang.en.mode.expert", "Expert mode");
- initString("lang.en.name", "VS-Simulator 1.1");
- initString("lang.en.ok", "OK");
- initString("lang.en.open", "Open");
- initString("lang.en.pause", "Paus");
- initString("lang.en.prefs", "Preferences");
- initString("lang.en.prefs.color", "Color preferences");
- initString("lang.en.prefs.diverse", "Diverse preferences");
- initString("lang.en.prefs.ext", "Extended preferences");
- initString("lang.en.prefs.message", "Message preferences");
- initString("lang.en.prefs.message.defaults", "Message prefs. for new processes");
- initString("lang.en.prefs.more", "More preferences");
- initString("lang.en.prefs.process", "Process preferences");
- initString("lang.en.prefs.process", "Standard process preferences");
- initString("lang.en.prefs.process.defaults", "Preferences for new processes");
- initString("lang.en.prefs.process.ext", "Extended process preferences");
- initString("lang.en.prefs.protocols", "Protocol preferences");
- initString("lang.en.prefs.simulator", "Simulator preferences");
- initString("lang.en.process", "Process");
- initString("lang.en.process.add.new", "Insert new process");
- initString("lang.en.process.crash", "Crash process");
- initString("lang.en.process.edit", "Edit process");
- initString("lang.en.process.id", "PID");
- initString("lang.en.process.new", "New process");
- initString("lang.en.process.not.selected", "No process selected");
- initString("lang.en.process.recover", "Recover process");
- initString("lang.en.process.remove", "Remove process");
- initString("lang.en.process.selected", "Selected process");
- initString("lang.en.process.time.local", "Local time");
- initString("lang.en.processes.all", "All processes");
- initString("lang.en.protocol", "Protocol");
- initString("lang.en.protocol.client", "Client side");
- initString("lang.en.protocol.editor", "Protocol editor");
- initString("lang.en.protocol.server", "Server side");
- initString("lang.en.protocol.tasks.activation", "Client-/Server protocol activation");
- initString("lang.en.protocol.tasks.client", "Client Task-Manager (Client request)");
- initString("lang.en.protocols", "Protocols");
- initString("lang.en.quit", "Quit");
- initString("lang.en.recovered", "Recovered");
- initString("lang.en.remove", "Remove");
- initString("lang.en.replay", "Repeat");
- initString("lang.en.reset", "Reset");
- initString("lang.en.save", "Save");
- initString("lang.en.saveas", "Save as");
- initString("lang.en.server", "Server");
- initString("lang.en.serverrequest.start", "Start server request");
- initString("lang.en.simulator", "Simulator");
- initString("lang.en.simulator.close", "Close simulation");
- initString("lang.en.simulator.finished", "Simulation closed");
- initString("lang.en.simulator.new", "New simulation");
- initString("lang.en.simulator.paused", "Simulation paused");
- initString("lang.en.simulator.resetted", "Simulation resetted");
- initString("lang.en.simulator.started", "Simulation started");
- initString("lang.en.start", "Start");
- initString("lang.en.stop", "Stop");
- initString("lang.en.takeover", "Take over");
- initString("lang.en.task", "Task");
- initString("lang.en.task.manager", "Event editor");
- initString("lang.en.tasks.fullfilled", "Fullfilled tasks");
- initString("lang.en.tasks.global", "GLobal tasks");
- initString("lang.en.tasks.local", "Local tasks");
- initString("lang.en.time", "Time");
- initString("lang.en.time.lamport", "Lamport time");
- initString("lang.en.time.vector", "Vector time");
- initString("lang.en.timed.global", "Global events");
- initString("lang.en.timed.local", "Local events");
- initString("lang.en.type", "Type");
- initString("lang.en.value", "Value");
- initString("lang.en.variable", "Variable");
- initString("lang.en.variables", "Variables");
- initString("lang.en.variables.global", "Global variables");
- initString("lang.en.window.close", "Close window");
- initString("lang.en.window.new", "New window");
-
- /* Protocol names */
- initString("lang.en.events.implementations.VSProcessCrashEvent", "Process Crash Event");
- initString("lang.en.events.implementations.VSProcessCrashEvent.short", "Process Crash");
- initString("lang.en.events.implementations.VSProcessRecoverEvent", "Process Recover Event");
- initString("lang.en.events.implementations.VSProcessRecoverEvent.short", "Process Recover");
- initString("lang.en.protocols.implementations.VSBasicMulticastProtocol", "Basic Multicast Protocol");
- initString("lang.en.protocols.implementations.VSBasicMulticastProtocol.short", "Basic Multicast");
- initString("lang.en.protocols.implementations.VSBerkelyTimeProtocol", "Berkley algorithm for internal sync.");
- initString("lang.en.protocols.implementations.VSBerkelyTimeProtocol.short", "Berkley Protocol");
- initString("lang.en.protocols.implementations.VSBroadcastProtocol", "Broadcast Protocol");
- initString("lang.en.protocols.implementations.VSBroadcastProtocol.short", "Broadcast");
- initString("lang.en.protocols.implementations.VSDummyProtocol", "Example/Dummy Protocol");
- initString("lang.en.protocols.implementations.VSDummyProtocol.short", "Example/Dummy");
- initString("lang.en.protocols.implementations.VSExternalTimeSyncProtocol", "Christians method for external sync.");
- initString("lang.en.protocols.implementations.VSExternalTimeSyncProtocol.short", "Christians");
- initString("lang.en.protocols.implementations.VSInternalTimeSyncProtocol", "Internal Synchronization Protocol");
- initString("lang.en.protocols.implementations.VSInternalTimeSyncProtocol.short", "Internal sync.");
- initString("lang.en.protocols.implementations.VSOnePhaseCommitProtocol", "One-Phase Commit Protocol");
- initString("lang.en.protocols.implementations.VSOnePhaseCommitProtocol.short", "1-Phase Commit");
- initString("lang.en.protocols.implementations.VSPingPongProtocol", "Ping-Pong Protocol");
- initString("lang.en.protocols.implementations.VSPingPongProtocol.short", "Ping-Pong");
- initString("lang.en.protocols.implementations.VSReliableMulticastProtocol", "Reliable Multicast Protocol");
- initString("lang.en.protocols.implementations.VSReliableMulticastProtocol.short", "Reliable Multicast");
- initString("lang.en.protocols.implementations.VSTwoPhaseCommitProtocol", "Two-Phase Commit");
- initString("lang.en.protocols.implementations.VSTwoPhaseCommitProtocol.short", "2-Phase Commit");
- }
-
- /**
- * Fill with default integers.
- */
- public void fillDefaultIntegers() {
- /* Simulator prefs */
- initInteger("sim.process.num", 3, "Number of processes", 1, 6);
- initInteger("message.prob.outage", 0, "Message lost prob.", 0, 100, "%");
- initInteger("process.prob.crash", 0, "Process crash prob.", 0, 100, "%");
- initInteger("sim.seconds", 15, "Simulation duration", 5, 120, "s");
-
- /* Internal prefs */
- initInteger("keyevent.about", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.cancel", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.close", KeyEvent.VK_C, null, 0, 100);
- initInteger("keyevent.default", KeyEvent.VK_F, null, 0, 100);
- initInteger("keyevent.edit", KeyEvent.VK_E, null, 0, 100);
- initInteger("keyevent.file", KeyEvent.VK_D, null, 0, 100);
- initInteger("keyevent.new", KeyEvent.VK_N, null, 0, 100);
- initInteger("keyevent.actualize", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.takeover", KeyEvent.VK_B, null, 0, 100);
- initInteger("keyevent.ok", KeyEvent.VK_O, null, 0, 100);
- initInteger("keyevent.open", KeyEvent.VK_O, null, 0, 100);
- initInteger("keyevent.pause", KeyEvent.VK_P, null, 0, 100);
- initInteger("keyevent.prefs", KeyEvent.VK_P, null, 0, 100);
- initInteger("keyevent.prefs.ext", KeyEvent.VK_E, null, 0, 100);
- initInteger("keyevent.quit", KeyEvent.VK_B, null, 0, 100);
- initInteger("keyevent.replay", KeyEvent.VK_W, null, 0, 100);
- initInteger("keyevent.reset", KeyEvent.VK_R, null, 0, 100);
- initInteger("keyevent.save", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.saveas", KeyEvent.VK_V, null, 0, 100);
- initInteger("keyevent.simulator", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.start", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.stop", KeyEvent.VK_P, null, 0, 100);
-
- initInteger("div.window.prefs.xsize", 400, "Configuration window X-Axis", 550, 3200, "px");
- initInteger("div.window.prefs.ysize", 400, "Configuration window Y-Axis", 640, 2400, "px");
- initInteger("div.window.logsize", 300, "Log window Y-Axis", 100, 1000, "px");
- initInteger("div.window.splitsize", 320, "Toolbar X-Axis", 100, 1000, "px");
- initInteger("div.window.xsize", 1024, "Main window X-Axis", 750, 3200, "px");
- initInteger("div.window.ysize", 768, "Main window Y-Axis", 600, 2400, "px");
- }
-
- /**
- * Fill with default floats.
- */
- public void fillDefaultFloats() {
- /* Simulator prefs */
- initFloat("process.clock.variance", 0, "Clock variance");
- initFloat("sim.clock.speed", 0.5f, "Simulation play speed");
- }
-
- /**
- * Fill default longs.
- */
- public void fillDefaultLongs() {
- /* Simulator prefs */
- initLong("message.sendingtime.min", 500, "Max transmission time", "ms");
- initLong("message.sendingtime.max", 2000, "Min transmission time", "ms");
- }
-
- /**
- * Fill with default colors.
- */
- public void fillDefaultColors() {
- /* Internal prefs */
- initColor("col.background", new Color(0xFF, 0xFF, 0xFF));
- initColor("col.process.default", new Color(0x00, 0x00, 0x00));
- initColor("col.process.running", new Color(0x0D, 0xD8, 0x09));
- initColor("col.process.crashed", new Color(0xff, 0x00, 0x00));
- initColor("col.process.highlight", new Color(0xff, 0xA5, 0x00));
- initColor("col.process.line", new Color(0x00, 0x00, 0x00));
- initColor("col.process.secondline", new Color(0xAA, 0xAA, 0xAA));
- initColor("col.process.sepline", new Color(0xff, 0x00, 0x00));
- initColor("col.process.stopped", new Color(0x00, 0x00, 0x00));
- initColor("col.message.arrived", new Color(0x00, 0x85, 0xD2));
- initColor("col.message.sending", new Color(0x0D, 0xD8, 0x09));
- initColor("col.message.lost", new Color(0xFF, 0x00, 0x00));
- }
-
- /**
- * Fill with default booleans.
- */
- public void fillDefaultBooleans() {
- initBoolean("sim.mode.expert", false, "Expert mode");
- initBoolean("sim.message.own.recv", false, "Processes receive own messages");
- initBoolean("sim.message.prob.mean", true, "Use mean value of message lost prob.");
- initBoolean("sim.message.sendingtime.mean", true, "Use mean value of transmission times");
- initBoolean("sim.messages.relevant", true, "Only show relevant messages");
- initBoolean("sim.periodic", false, "Repeat simulation periodically");
- initBoolean("sim.update.lamporttime.all", false, "Lamport timestamps affect all events");
- initBoolean("sim.update.vectortime.all", false, "Vector timestamps affect all events");
- }
-}
diff --git a/sources/prefs/VSDefaultPrefsDE.java b/sources/prefs/VSDefaultPrefsDE.java
deleted file mode 100644
index 9f65153..0000000
--- a/sources/prefs/VSDefaultPrefsDE.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package prefs;
-
-import java.awt.Color;
-import java.awt.event.KeyEvent;
-
-/**
- * The class VSDefaultPrefsDE, makes sure that the simulator has its default
- * configuration values.
- *
- * @author Paul C. Buetow
- */
-public class VSDefaultPrefsDE extends VSSerializablePrefs {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /**
- * Inits a prefs object with default values.
- *
- * @return the lang.process.removeprefs
- */
- public static VSPrefs init() {
- VSDefaultPrefsDE prefs = new VSDefaultPrefsDE();
- prefs.fillWithDefaults();
- return prefs;
- }
-
- /**
- * Fill everything with ts defaults.
- */
- public void fillWithDefaults() {
- super.clear();
- addWithDefaults();
- }
-
- /**
- * Adds default values if not existent.
- */
- public void addWithDefaults() {
- fillDefaultBooleans();
- fillDefaultColors();
- fillDefaultFloats();
- fillDefaultIntegers();
- fillDefaultLongs();
- fillDefaultStrings();
- }
-
- /**
- * Fill with default strings.
- */
- public void fillDefaultStrings() {
- initString("lang.de.about", "About");
- initString("lang.de.about.info", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulator verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann als 1. Prüfer sowie Betreuer und Prof. Dr. rer. nat. Fassbender als 2. Prüfer erstellt. Bei Fehlern bitte eine kurze Mail mit Fehlerbeschreibung an vs@paul.buetow.org schicken!");
- initString("lang.de.activate", "aktivieren");
- initString("lang.de.activated", "aktiviert");
- initString("lang.de.actualize", "Aktualisieren");
- initString("lang.de.all", "Alle");
- initString("lang.de.antialiasing", "Anti-Aliasing");
- initString("lang.de.cancel", "Abbrechen");
- initString("lang.de.client", "Client");
- initString("lang.de.clientrequest.start", "Clientanfrage starten");
- initString("lang.de.close", "Schliessen");
- initString("lang.de.colorchooser", "Farbauswahl");
- initString("lang.de.colorchooser2", "Bitte Farbe auswählen");
- initString("lang.de.copy", "Kopieren");
- initString("lang.de.crashed", "Abgestürzt");
- initString("lang.de.dat", "Simulation (.dat)");
- initString("lang.de.deactivate", "deaktivieren");
- initString("lang.de.deactivated", "deaktiviert");
- initString("lang.de.default", "Defaults");
- initString("lang.de.edit", "Editieren");
- initString("lang.de.editor", "Editor");
- initString("lang.de.event", "Ereignis");
- initString("lang.de.event.add.global", "Globales Ereignis einfügen");
- initString("lang.de.event.add.local", "Lokales Ereignis einfügen");
- initString("lang.de.event.add.time", "bei");
- initString("lang.de.events", "Ereignisse");
- initString("lang.de.events.process", "Prozessereignisse");
- initString("lang.de.file", "Datei");
- initString("lang.de.filter", "Filter");
- initString("lang.de.loging.active", "Logging");
- initString("lang.de.loging.clear", "Loggs löschen");
- initString("lang.de.message", "Nachricht");
- initString("lang.de.message.recv", "Nachricht erhalten");
- initString("lang.de.message.sent", "Nachricht versendet");
- initString("lang.de.mode.expert", "Expertenmodus");
- initString("lang.de.name", "VS-Simulator 1.0");
- initString("lang.de.ok", "OK");
- initString("lang.de.open", "Öffnen");
- initString("lang.de.pause", "Pausieren");
- initString("lang.de.prefs", "Einstellungen");
- initString("lang.de.prefs.color", "Farbeinstellungen");
- initString("lang.de.prefs.diverse", "Diverse Einstellungen");
- initString("lang.de.prefs.ext", "Erweiterte Einstellungen");
- initString("lang.de.prefs.message", "Nachrichteneinstellungen");
- initString("lang.de.prefs.message.defaults", "Nachrichteneinstellungen für neue Prozesse");
- initString("lang.de.prefs.more", "Mehr Einstellungen");
- initString("lang.de.prefs.process", "Prozesseinstellungen");
- initString("lang.de.prefs.process", "Prozessstandardeinstellungen");
- initString("lang.de.prefs.process.defaults", "Einstellungen für neue Prozesse");
- initString("lang.de.prefs.process.ext", "Erweiterte Prozesseinstellungen");
- initString("lang.de.prefs.protocols", "Protokolleinstellungen");
- initString("lang.de.prefs.simulator", "Simulationseinstellungen");
- initString("lang.de.process", "Prozess");
- initString("lang.de.process.add.new", "Neuen Prozess hinzufügen");
- initString("lang.de.process.crash", "Prozess abstürzen");
- initString("lang.de.process.edit", "Prozess editieren");
- initString("lang.de.process.id", "PID");
- initString("lang.de.process.new", "Neuer Prozess");
- initString("lang.de.process.not.selected", "Kein Prozess ausgewählt");
- initString("lang.de.process.recover", "Prozess wiederbeleben");
- initString("lang.de.process.remove", "Prozess entfernen");
- initString("lang.de.process.selected", "Aktuell ausgewählter Prozess");
- initString("lang.de.process.time.local", "Lokale Zeit");
- initString("lang.de.processes.all", "Alle Prozesse");
- initString("lang.de.protocol", "Protokoll");
- initString("lang.de.protocol.client", "Clientseite");
- initString("lang.de.protocol.editor", "Protokolleditor");
- initString("lang.de.protocol.server", "Serverseite");
- initString("lang.de.protocol.tasks.activation", "Client-/Serverprotokoll Aktivierung");
- initString("lang.de.protocol.tasks.client", "Client Task-Manager (Clientanfragen)");
- initString("lang.de.protocols", "Protokolle");
- initString("lang.de.quit", "Beenden");
- initString("lang.de.recovered", "Wiederbelebt");
- initString("lang.de.remove", "Entfernen");
- initString("lang.de.replay", "Wiederholen");
- initString("lang.de.reset", "Reset");
- initString("lang.de.save", "Speichern");
- initString("lang.de.saveas", "Speichern unter");
- initString("lang.de.server", "Server");
- initString("lang.de.serverrequest.start", "Serveranfrage starten");
- initString("lang.de.simulator", "Simulator");
- initString("lang.de.simulator.close", "Simulation schliessen");
- initString("lang.de.simulator.finished", "Simulation beendet");
- initString("lang.de.simulator.new", "Neue Simulation");
- initString("lang.de.simulator.paused", "Simulation pausiert");
- initString("lang.de.simulator.resetted", "Simulation zurückgesetzt");
- initString("lang.de.simulator.started", "Simulation gestartet");
- initString("lang.de.start", "Starten");
- initString("lang.de.stop", "Stoppen");
- initString("lang.de.takeover", "Übernehmen");
- initString("lang.de.task", "Aufgabe");
- initString("lang.de.task.manager", "Ereigniseditor");
- initString("lang.de.tasks.fullfilled", "Abgelaufene Aufgaben");
- initString("lang.de.tasks.global", "Globale Aufgaben");
- initString("lang.de.tasks.local", "Lokale Aufgaben");
- initString("lang.de.time", "Zeit");
- initString("lang.de.time.lamport", "Lamportzeit");
- initString("lang.de.time.vector", "Vektorzeit");
- initString("lang.de.timed.global", "Globale Ereignisse");
- initString("lang.de.timed.local", "Lokale Ereignisse");
- initString("lang.de.type", "Typ");
- initString("lang.de.value", "Wert");
- initString("lang.de.variable", "Variable");
- initString("lang.de.variables", "Variablen");
- initString("lang.de.variables.global", "Globale Variablen");
- initString("lang.de.window.close", "Fenster schliessen");
- initString("lang.de.window.new", "Neues Fenster");
- }
-
- /**
- * Fill with default integers.
- */
- public void fillDefaultIntegers() {
- /* Simulator prefs */
- initInteger("sim.process.num", 3, "Anzahl der Prozesse", 1, 6);
- initInteger("message.prob.outage", 0, "Nachrichtenverlustw'keit", 0, 100, "%");
- initInteger("process.prob.crash", 0, "Prozessausfallw'keit", 0, 100, "%");
- initInteger("sim.seconds", 15, "Dauer der Simulation", 5, 120, "s");
-
- /* Internal prefs */
- initInteger("keyevent.about", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.cancel", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.close", KeyEvent.VK_C, null, 0, 100);
- initInteger("keyevent.default", KeyEvent.VK_F, null, 0, 100);
- initInteger("keyevent.edit", KeyEvent.VK_E, null, 0, 100);
- initInteger("keyevent.file", KeyEvent.VK_D, null, 0, 100);
- initInteger("keyevent.new", KeyEvent.VK_N, null, 0, 100);
- initInteger("keyevent.actualize", KeyEvent.VK_A, null, 0, 100);
- initInteger("keyevent.takeover", KeyEvent.VK_B, null, 0, 100);
- initInteger("keyevent.ok", KeyEvent.VK_O, null, 0, 100);
- initInteger("keyevent.open", KeyEvent.VK_O, null, 0, 100);
- initInteger("keyevent.pause", KeyEvent.VK_P, null, 0, 100);
- initInteger("keyevent.prefs", KeyEvent.VK_P, null, 0, 100);
- initInteger("keyevent.prefs.ext", KeyEvent.VK_E, null, 0, 100);
- initInteger("keyevent.quit", KeyEvent.VK_B, null, 0, 100);
- initInteger("keyevent.replay", KeyEvent.VK_W, null, 0, 100);
- initInteger("keyevent.reset", KeyEvent.VK_R, null, 0, 100);
- initInteger("keyevent.save", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.saveas", KeyEvent.VK_V, null, 0, 100);
- initInteger("keyevent.simulator", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.start", KeyEvent.VK_S, null, 0, 100);
- initInteger("keyevent.stop", KeyEvent.VK_P, null, 0, 100);
-
- initInteger("div.window.prefs.xsize", 400, "Einstellungsfenster X-Achse", 550, 3200, "px");
- initInteger("div.window.prefs.ysize", 400, "Einstellungsfenster Y-Achse", 640, 2400, "px");
- initInteger("div.window.logsize", 300, "Loggfenster Y-Achse", 100, 1000, "px");
- initInteger("div.window.splitsize", 320, "Toolbar X-Achse", 100, 1000, "px");
- initInteger("div.window.xsize", 1024, "Hauptfenster X-Achse", 750, 3200, "px");
- initInteger("div.window.ysize", 768, "Hauptfenster Y-Achse", 600, 2400, "px");
- }
-
- /**
- * Fill with default floats.
- */
- public void fillDefaultFloats() {
- /* Simulator prefs */
- initFloat("process.clock.variance", 0, "Uhrabweichung");
- initFloat("sim.clock.speed", 0.5f, "Abspielgeschwindigkeit der Simulation");
- }
-
- /**
- * Fill default longs.
- */
- public void fillDefaultLongs() {
- /* Simulator prefs */
- initLong("message.sendingtime.min", 500, "Minimale Übertragungszeit", "ms");
- initLong("message.sendingtime.max", 2000, "Maximale Übertragungszeit", "ms");
- }
-
- /**
- * Fill with default colors.
- */
- public void fillDefaultColors() {
- /* Internal prefs */
- initColor("col.background", new Color(0xFF, 0xFF, 0xFF));
- initColor("col.process.default", new Color(0x00, 0x00, 0x00));
- initColor("col.process.running", new Color(0x0D, 0xD8, 0x09));
- initColor("col.process.crashed", new Color(0xff, 0x00, 0x00));
- initColor("col.process.highlight", new Color(0xff, 0xA5, 0x00));
- initColor("col.process.line", new Color(0x00, 0x00, 0x00));
- initColor("col.process.secondline", new Color(0xAA, 0xAA, 0xAA));
- initColor("col.process.sepline", new Color(0xff, 0x00, 0x00));
- initColor("col.process.stopped", new Color(0x00, 0x00, 0x00));
- initColor("col.message.arrived", new Color(0x00, 0x85, 0xD2));
- initColor("col.message.sending", new Color(0x0D, 0xD8, 0x09));
- initColor("col.message.lost", new Color(0xFF, 0x00, 0x00));
- }
-
- /**
- * Fill with default booleans.
- */
- public void fillDefaultBooleans() {
- initBoolean("sim.mode.expert", false, "Expertenmodus aktivieren");
- initBoolean("sim.message.own.recv", false, "Prozesse empfangen eigene Nachrichten");
- initBoolean("sim.message.prob.mean", true, "Mittelwerte der Nachrichtverlustw'k. bilden");
- initBoolean("sim.message.sendingtime.mean", true, "Mittelwerte der Übertragungszeiten bilden");
- initBoolean("sim.messages.relevant", true, "Nur relevante Nachrichten anzeigen");
- initBoolean("sim.periodic", false, "Simulation periodisch wiederholen");
- initBoolean("sim.update.lamporttime.all", false, "Lamportzeiten betreffen alle Ereignisse");
- initBoolean("sim.update.vectortime.all", false, "Vektorzeiten betreffen alle Ereignisse");
- }
-}
diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java
deleted file mode 100644
index 31e1f22..0000000
--- a/sources/prefs/VSPrefs.java
+++ /dev/null
@@ -1,1210 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package prefs;
-
-import java.awt.Color;
-import java.io.*;
-import java.util.*;
-
-import serialize.*;
-
-/**
- * The class VSPrefs, this class is for dynamic data storage. It can hold
- * various different types such as Boolean, Floats, Integers, Strings, Colors.
- *
- * @author Paul C. Buetow
- */
-public class VSPrefs {
- /** Check if we want to overwrite description strings */
- //private boolean useDefaultStrings = false;
-
- /** The Constant BOOLEAN_PREFIX. */
- public static final String BOOLEAN_PREFIX = "Boolean: ";
-
- /** The Constant COLOR_PREFIX. */
- public static final String COLOR_PREFIX = "Color: ";
-
- /** The Constant FLOAT_PREFIX. */
- public static final String FLOAT_PREFIX = "Float: ";
-
- /** The Constant INTEGER_PREFIX. */
- public static final String INTEGER_PREFIX = "Integer: ";
-
- /** The Constant VECTOR_PREFIX. */
- public static final String VECTOR_PREFIX = "Vector: ";
-
- /** The Constant LONG_PREFIX. */
- public static final String LONG_PREFIX = "Long: ";
-
- /** The Constant STRING_PREFIX. */
- public static final String STRING_PREFIX = "String: ";
-
- /** The color prefs. */
- private HashMap<String,Color> colorPrefs;
-
- /** The float prefs. */
- private HashMap<String,Float> floatPrefs;
-
- /** The integer prefs. */
- private HashMap<String,Integer> integerPrefs;
-
- /** The integer vector prefs. */
- private HashMap<String,Vector<Integer>> vectorPrefs;
-
- /** The long prefs. */
- private HashMap<String,Long> longPrefs;
-
- /** The setting restriction prefs. */
- private HashMap<String,VSPrefsRestriction> restrictions;
-
- /** The description prefs. */
- private HashMap<String,String> descriptionPrefs;
-
- /** The string prefs. */
- private HashMap<String,String> stringPrefs;
-
- /** The boolean prefs. */
- private HashMap<String,Boolean> booleanPrefs;
-
- /** The object prefs. */
- private HashMap<String,Object> objectPrefs;
-
- /** The units. */
- private HashMap<String,String> units;
-
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 4L;
-
- /** The id counter. */
- private static int idCounter;
-
- /** The id. */
- protected int id;
-
- /**
- * Instantiates a new lang.process.removeprefs.
- */
- public VSPrefs() {
- colorPrefs = new HashMap<String,Color>();
- descriptionPrefs = new HashMap<String,String>();
- floatPrefs = new HashMap<String,Float>();
- integerPrefs = new HashMap<String,Integer>();
- vectorPrefs = new HashMap<String,Vector<Integer>>();
- longPrefs = new HashMap<String,Long>();
- restrictions = new HashMap<String,VSPrefsRestriction>();
- stringPrefs = new HashMap<String,String>();
- booleanPrefs = new HashMap<String,Boolean>();
- objectPrefs = new HashMap<String,Object>();
- units = new HashMap<String,String>();
- id = ++idCounter;
- }
-
- /**
- * Clear.
- */
- protected synchronized void clear() {
- colorPrefs.clear();
- floatPrefs.clear();
- integerPrefs.clear();
- vectorPrefs.clear();
- longPrefs.clear();
- stringPrefs.clear();
- booleanPrefs.clear();
- objectPrefs.clear();
- descriptionPrefs.clear();
- restrictions.clear();
- }
-
- /* Unit methods */
-
- /**
- * Gets the unit.
- *
- * @param fullKey the full key
- *
- * @return the unit
- */
- public synchronized String getUnit(String fullKey) {
- return units.get(fullKey);
- }
-
- /**
- * Sets the unit.
- *
- * @param key the key
- * @param unit the unit
- */
- public synchronized void initUnit(String key, String unit) {
- if (unit == null /*|| units.containsKey(key)*/)
- return;
- units.put(key, unit);
- }
-
- /* Description methods */
- /**
- * Sets the description if unset.
- *
- * @param key the key
- * @param descr the descr
- */
- public synchronized void initDescription(String key, String descr) {
- if (descr == null /*|| descriptionPrefs.containsKey(key)*/)