diff options
| author | Paul Buetow <paul@buetow.org> | 2008-08-07 07:32:29 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-08-07 07:32:29 +0000 |
| commit | f33c1714f67627848983bc2f9d179bde63da3d80 (patch) | |
| tree | 0fda416822e20c9895f7430eab68ba54220ba6bd /sources | |
| parent | 5f388cca7c19d44a3928f4cfe7244faabeb2faff (diff) | |
written a lot
Diffstat (limited to 'sources')
| -rw-r--r-- | sources/core/VSAbstractProcess.java | 11 | ||||
| -rw-r--r-- | sources/core/VSInternalProcess.java | 10 | ||||
| -rw-r--r-- | sources/core/VSMessageStub.java | 6 | ||||
| -rw-r--r-- | sources/events/VSAbstractEvent.java | 7 | ||||
| -rw-r--r-- | sources/events/internal/VSProtocolEvent.java | 5 | ||||
| -rw-r--r-- | sources/prefs/VSDefaultPrefs.java | 30 | ||||
| -rw-r--r-- | sources/prefs/editors/VSAbstractEditor.java | 2 | ||||
| -rw-r--r-- | sources/protocols/VSAbstractProtocol.java | 28 | ||||
| -rw-r--r-- | sources/utils/VSAbout.java | 2 |
9 files changed, 67 insertions, 34 deletions
diff --git a/sources/core/VSAbstractProcess.java b/sources/core/VSAbstractProcess.java index c526f3f..4c500ea 100644 --- a/sources/core/VSAbstractProcess.java +++ b/sources/core/VSAbstractProcess.java @@ -732,8 +732,19 @@ public abstract class VSAbstractProcess extends VSPrefs currentColor = newColor; } + /* (non-Javadoc) + * @see core.VSInternalMessage#updateFromPrefs() + */ protected abstract void updateFromPrefs_(); + + /* (non-Javadoc) + * @see core.VSInternalMessage#createRandomCrashTask() + */ protected abstract void createRandomCrashTask_(); + + /* (non-Javadoc) + * @see core.VSInternalMessage#getProtocolObjekt(java.util.String) + */ protected abstract VSAbstractProtocol getProtocolObject_( String protocolClassname); } diff --git a/sources/core/VSInternalProcess.java b/sources/core/VSInternalProcess.java index e88bb76..df70cc8 100644 --- a/sources/core/VSInternalProcess.java +++ b/sources/core/VSInternalProcess.java @@ -434,15 +434,23 @@ public class VSInternalProcess extends VSAbstractProcess { this.localTime = 0; } - + /* (non-Javadoc) + * @see core.VSInternalMessage#updateFromPrefs() + */ protected void updateFromPrefs_() { updateFromPrefs(); } + /* (non-Javadoc) + * @see core.VSInternalMessage#createRandomCrashTask() + */ protected void createRandomCrashTask_() { createRandomCrashTask(); } + /* (non-Javadoc) + * @see core.VSInternalMessage#getProtocolObjekt(java.util.String) + */ protected VSAbstractProtocol getProtocolObject_(String protocolClassname) { return getProtocolObject(protocolClassname); } diff --git a/sources/core/VSMessageStub.java b/sources/core/VSMessageStub.java index ac70e0b..eaa8929 100644 --- a/sources/core/VSMessageStub.java +++ b/sources/core/VSMessageStub.java @@ -44,13 +44,15 @@ public class VSMessageStub { /** * The constructor of the message stub. Creates a new message stub object. * - * @message the message + * @param message the message */ public VSMessageStub(VSMessage message) { this.message = message; } - + /* (non-Javadoc) + * @see core.VSMessage#init(VSInternalProcess, java.util.String, boolean) + */ public void init(VSInternalProcess process, String protocolClassname, boolean isServerMessage) { message.init(process, protocolClassname, isServerMessage); diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java index d2c1352..4714b96 100644 --- a/sources/events/VSAbstractEvent.java +++ b/sources/events/VSAbstractEvent.java @@ -25,6 +25,7 @@ package events; import java.io.*; +import core.VSAbstractProcess; import core.VSInternalProcess; import exceptions.*; import prefs.VSPrefs; @@ -46,7 +47,7 @@ abstract public class VSAbstractEvent extends VSPrefs { public VSPrefs prefs; /** The process. */ - public VSInternalProcess process; + public VSAbstractProcess process; /** The event shortname. */ private String eventShortname; @@ -64,7 +65,7 @@ abstract public class VSAbstractEvent extends VSPrefs { throws VSEventNotCopyableException { if (theProcess == null) - theProcess = process; + theProcess = (VSInternalProcess) process; if (!(this instanceof VSCopyableEvent)) throw new VSEventNotCopyableException( @@ -166,7 +167,7 @@ abstract public class VSAbstractEvent extends VSPrefs { * * @return the process */ - public VSInternalProcess getProcess() { + public VSAbstractProcess getProcess() { return process; } diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index 1ccb700..76caff0 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -25,9 +25,11 @@ package events.internal; import java.io.*; +import core.VSInternalProcess; import events.*; import protocols.VSAbstractProtocol; import serialize.VSSerialize; +import simulator.VSSimulatorCanvas; /** * The class VSProtocolEvent, this event is used if a protocol (server or @@ -122,8 +124,9 @@ public class VSProtocolEvent extends VSAbstractInternalEvent * @see events.VSAbstractEvent#onStart() */ public void onStart() { + VSInternalProcess internalProcess = (VSInternalProcess) process; VSAbstractProtocol protocol = - process.getProtocolObject(protocolClassname); + internalProcess.getProtocolObject(protocolClassname); if (isClientProtocol) protocol.isClient(isProtocolActivation); diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java index 3865947..bfbcd1d 100644 --- a/sources/prefs/VSDefaultPrefs.java +++ b/sources/prefs/VSDefaultPrefs.java @@ -73,7 +73,7 @@ public class VSDefaultPrefs extends VSPrefs { */ public void fillDefaultStrings() { initString("lang.about", "About"); - initString("lang.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. Dieses Programm stellt noch keinesfalls eine fertige Version dar, da es sich noch in Entwicklung befindet und die Diplomarbeit erst mitte August abgeschlossen sein wird! Bei Fehlern bitte eine kurze Mail mitsamt Fehlerbeschreibung an paul@buetow.org schicken! Dieser Simulator wird später außerdem unter einer open source Linzenz (wahrscheinlich der GNU General Public License) freigegeben!"); + initString("lang.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. Dieses Programm stellt noch keinesfalls eine fertige Version dar, da es sich noch in Entwicklung befindet und die Diplomarbeit erst mitte August abgeschlossen sein wird! Bei Fehlern bitte eine kurze Mail mitsamt Fehlerbeschreibung an paul@buetow.org schicken! Dieser Simulator wird später außerdem unter einer open source Linzenz (wahrscheinlich der GNU General Public License) freigegeben!"); initString("lang.activate", "aktivieren"); initString("lang.activated", "aktiviert"); initString("lang.actualize", "Aktualisieren"); @@ -82,24 +82,23 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.cancel", "Abbrechen"); initString("lang.client", "Client"); initString("lang.clientrequest.start", "Clientanfrage starten"); - initString("lang.dat", "Simulation (.dat)"); - initString("lang.serverrequest.start", "Serveranfrage starten"); initString("lang.close", "Schliessen"); initString("lang.colorchooser", "Farbauswahl"); initString("lang.colorchooser2", "Bitte Farbe auswählen"); + initString("lang.copy", "Kopieren"); initString("lang.crashed", "Abgestürzt"); + initString("lang.dat", "Simulation (.dat)"); initString("lang.deactivate", "deaktivieren"); initString("lang.deactivated", "deaktiviert"); initString("lang.default", "Defaults"); initString("lang.edit", "Editieren"); initString("lang.editor", "Editor"); initString("lang.event", "Ereignis"); - initString("lang.event.add.time", "bei"); - initString("lang.event.add.local", "Lokales Ereignis einfügen"); initString("lang.event.add.global", "Globales Ereignis einfügen"); + initString("lang.event.add.local", "Lokales Ereignis einfügen"); + initString("lang.event.add.time", "bei"); initString("lang.events", "Ereignisse"); initString("lang.events.process", "Prozessereignisse"); - //initString("lang.events.protocol", "Protokollereignisse"); initString("lang.file", "Datei"); initString("lang.filter", "Filter"); initString("lang.logging.active", "Logging"); @@ -109,7 +108,7 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.message.sent", "Nachricht versendet"); initString("lang.mode.expert", "Expertenmodus"); initString("lang.name", "VS-Simulator"); - //initString("lang.name", "VS-Simulator v0.3-dev-III Joe Dalton"); + //initString("lang.name", "VS-Simulator v0.4-dev Red Bull"); initString("lang.ok", "OK"); initString("lang.open", "Öffnen"); initString("lang.pause", "Pausieren"); @@ -117,25 +116,25 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.prefs.color", "Farbeinstellungen"); initString("lang.prefs.diverse", "Diverse Einstellungen"); initString("lang.prefs.ext", "Erweiterte Einstellungen"); - initString("lang.prefs.info!", "Prozessvariablen können für jeden Prozess einzelnd eingestellt werden. Die hier gezeigen Prozessvariablen sind lediglich die globalen Defaultwerte, die für neue Prozesse verwendet werden!"); initString("lang.prefs.message", "Nachrichteneinstellungen"); initString("lang.prefs.message.defaults", "Nachrichteneinstellungen für neue Prozesse"); - initString("lang.prefs.process.defaults", "Einstellungen für neue Prozesse"); initString("lang.prefs.more", "Mehr Einstellungen"); initString("lang.prefs.process", "Prozesseinstellungen"); initString("lang.prefs.process", "Prozessstandardeinstellungen"); + initString("lang.prefs.process.defaults", "Einstellungen für neue Prozesse"); initString("lang.prefs.process.ext", "Erweiterte Prozesseinstellungen"); - initString("lang.prefs.process.info!", "Änderungen werden erst nach Betätigen des \"Übernehmen\" Knopfes übernommen!"); initString("lang.prefs.protocols", "Protokolleinstellungen"); - initString("lang.prefs.simulator", "Simulatorseinstellungen"); + initString("lang.prefs.simulator", "Simulationseinstellungen"); initString("lang.process", "Prozess"); initString("lang.process.add.new", "Neuen Prozess hinzufügen"); initString("lang.process.crash", "Prozess abstürzen"); - initString("lang.process.remove", "Prozess entfernen"); initString("lang.process.edit", "Prozess editieren"); initString("lang.process.id", "PID"); initString("lang.process.new", "Neuer Prozess"); + initString("lang.process.not.selected", "Kein Prozess ausgewählt"); initString("lang.process.recover", "Prozess wiederbeleben"); + initString("lang.process.remove", "Prozess entfernen"); + initString("lang.process.selected", "Aktuell ausgewählter Prozess"); initString("lang.process.time.local", "Lokale Zeit"); initString("lang.processes.all", "Alle Prozesse"); initString("lang.protocol", "Protokoll"); @@ -147,14 +146,13 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.protocols", "Protokolle"); initString("lang.quit", "Beenden"); initString("lang.recovered", "Wiederbelebt"); - initString("lang.copy", "Kopieren"); initString("lang.remove", "Entfernen"); initString("lang.replay", "Wiederholen"); - //initString("lang.requests", "Anfragen"); initString("lang.reset", "Reset"); initString("lang.save", "Speichern"); initString("lang.saveas", "Speichern unter"); initString("lang.server", "Server"); + initString("lang.serverrequest.start", "Serveranfrage starten"); initString("lang.simulator", "Simulator"); initString("lang.simulator.close", "Simulation schliessen"); initString("lang.simulator.finished", "Simulation beendet"); @@ -173,8 +171,6 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.time", "Zeit"); initString("lang.time.lamport", "Lamportzeit"); initString("lang.time.vector", "Vektorzeit"); - initString("lang.process.selected", "Aktuell ausgewählter Prozess"); - initString("lang.process.not.selected", "Kein Prozess ausgewählt"); initString("lang.timed.global", "Globale Ereignisse"); initString("lang.timed.local", "Lokale Ereignisse"); initString("lang.type", "Typ"); @@ -224,7 +220,7 @@ public class VSDefaultPrefs extends VSPrefs { initInteger("div.window.prefs.ysize", 400, "Einstellungsfenster Y-Achse", 640, 2400, "px"); initInteger("div.window.loggsize", 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", 800, 3200, "px"); + initInteger("div.window.xsize", 1024, "Hauptfenster X-Achse", 750, 3200, "px"); initInteger("div.window.ysize", 768, "Hauptfenster Y-Achse", 600, 2400, "px"); } diff --git a/sources/prefs/editors/VSAbstractEditor.java b/sources/prefs/editors/VSAbstractEditor.java index 6640a07..e793a3c 100644 --- a/sources/prefs/editors/VSAbstractEditor.java +++ b/sources/prefs/editors/VSAbstractEditor.java @@ -249,7 +249,7 @@ public abstract class VSAbstractEditor implements ActionListener { boolean expertMode = prefs.getBoolean("sim.mode.expert"); for (String elem : set) { - if (!elem.startsWith("lang.") && !elem.startsWith("keyevent")) { + if (!elem.startsWith("lang.") && !elem.startsWith("keyevent.")) { if (expertMode) filtered.add(elem); else if (!elem.startsWith("col.") && (!elem.startsWith("div."))) diff --git a/sources/protocols/VSAbstractProtocol.java b/sources/protocols/VSAbstractProtocol.java index dfa87a5..603bb1d 100644 --- a/sources/protocols/VSAbstractProtocol.java +++ b/sources/protocols/VSAbstractProtocol.java @@ -30,6 +30,7 @@ import core.*; import events.*; import events.internal.*; import serialize.*; +import simulator.VSSimulatorCanvas; import utils.*; /** @@ -95,13 +96,16 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { process.increaseVectorTime(); VSMessageStub stub = new VSMessageStub(message); + VSInternalProcess internalProcess = (VSInternalProcess) process; if (currentContextIsServer) - stub.init(process, getClassname(), VSMessage.IS_SERVER_MESSAGE); + stub.init(internalProcess, getClassname(), + VSMessage.IS_SERVER_MESSAGE); else - stub.init(process, getClassname(), VSMessage.IS_CLIENT_MESSAGE); + stub.init(internalProcess, getClassname(), + VSMessage.IS_CLIENT_MESSAGE); - process.sendMessage(message); + internalProcess.sendMessage(message); } /** @@ -299,27 +303,34 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { * @param time The process' local time to run the schedule at. */ public final void scheduleAt(long time) { + VSInternalProcess internalProcess = (VSInternalProcess) process; VSAbstractEvent scheduleEvent = new VSProtocolScheduleEvent(this, currentContextIsServer); VSTask scheduleTask = - new VSTask(time, process, scheduleEvent, VSTask.LOCAL); + new VSTask(time, internalProcess, scheduleEvent, VSTask.LOCAL); + if (currentContextIsServer) serverSchedules.add(scheduleTask); else clientSchedules.add(scheduleTask); - process.getSimulatorCanvas().getTaskManager().addTask(scheduleTask); + + VSSimulatorCanvas canvas = internalProcess.getSimulatorCanvas(); + canvas.getTaskManager().addTask(scheduleTask); } /** * Removes all schedules of the protocol (server or client) */ public final void removeSchedules() { + VSInternalProcess internalProcess = (VSInternalProcess) process; + if (currentContextIsServer) { - process.getSimulatorCanvas(). + internalProcess.getSimulatorCanvas(). getTaskManager().removeAllTasks(serverSchedules); serverSchedules.clear(); + } else { - process.getSimulatorCanvas(). + internalProcess.getSimulatorCanvas(). getTaskManager().removeAllTasks(clientSchedules); clientSchedules.clear(); } @@ -388,7 +399,8 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { if (process == null) return 0; - return process.getSimulatorCanvas().getNumProcesses(); + VSInternalProcess internalProcess = (VSInternalProcess) process; + return internalProcess.getSimulatorCanvas().getNumProcesses(); } /* (non-Javadoc) diff --git a/sources/utils/VSAbout.java b/sources/utils/VSAbout.java index 3548d7e..fed9eb8 100644 --- a/sources/utils/VSAbout.java +++ b/sources/utils/VSAbout.java @@ -70,7 +70,7 @@ public class VSAbout extends VSFrame { Container contentPane = getContentPane(); VSInfoArea infoArea = new VSInfoArea( - prefs.getString("lang.about.info!")); + prefs.getString("lang.about.info")); JPanel buttonPane = createButtonPanel(); JScrollPane scrollPane = new JScrollPane(infoArea); |
