summaryrefslogtreecommitdiff
path: root/sources/events/VSRegisteredEvents.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2009-01-17 14:29:28 +0000
committerPaul Buetow <paul@buetow.org>2009-01-17 14:29:28 +0000
commitff0c70b54edbbe3436583d6491d4a56d96302de5 (patch)
tree2b63fc15e30d953e043018fc0c0aa2be54af94f1 /sources/events/VSRegisteredEvents.java
parentb5e0d976418e3373b3d518a1ca01fc542a2fe602 (diff)
added initial multiple langua support.
Diffstat (limited to 'sources/events/VSRegisteredEvents.java')
-rw-r--r--sources/events/VSRegisteredEvents.java85
1 files changed, 58 insertions, 27 deletions
diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java
index 37f11f4..9d022d9 100644
--- a/sources/events/VSRegisteredEvents.java
+++ b/sources/events/VSRegisteredEvents.java
@@ -71,7 +71,7 @@ public final class VSRegisteredEvents {
new HashMap<String,Boolean>();
/** The prefs. */
- //private static VSPrefs prefs;
+ private static VSPrefs prefs;
/**
* Registers available events.
@@ -79,32 +79,50 @@ public final class VSRegisteredEvents {
* @param prefs_ the prefs_
*/
public static void init(VSPrefs prefs_) {
- //prefs = prefs_;
-
- registerEvent("events.implementations.VSProcessCrashEvent",
- "Prozessabsturz");
- registerEvent("events.implementations.VSProcessRecoverEvent",
- "Prozesswiederbelebung");
- registerEvent("protocols.implementations.VSBasicMulticastProtocol",
- "Basic Multicast", "Basic Multicast");
- registerEvent("protocols.implementations.VSBerkelyTimeProtocol",
- "Berkeley Algorithmus zur internen Sync.", "Berkeley");
- registerEvent("protocols.implementations.VSBroadcastProtocol",
- "Broadcast");
- registerEvent("protocols.implementations.VSDummyProtocol",
- "Beispiel/Dummy");
- registerEvent("protocols.implementations.VSExternalTimeSyncProtocol",
- "Christians Methode zur externen Sync.", "Christians");
- registerEvent("protocols.implementations.VSInternalTimeSyncProtocol",
- "Interne Synchronisation", "Interne Sync.");
- registerEvent("protocols.implementations.VSOnePhaseCommitProtocol",
- "Ein-Phasen Commit", "1-Phasen Commit");
- registerEvent("protocols.implementations.VSPingPongProtocol",
- "Ping Pong");
- registerEvent("protocols.implementations.VSReliableMulticastProtocol",
- "Reliable Multicast", "Reliable Multicast");
- registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol",
- "Zwei-Phasen Commit", "2-Phasen Commit");
+ prefs = prefs_;
+
+ /*
+ registerEvent("events.implementations.VSProcessCrashEvent",
+ "Prozessabsturz");
+ registerEvent("events.implementations.VSProcessRecoverEvent",
+ "Prozesswiederbelebung");
+ registerEvent("protocols.implementations.VSBasicMulticastProtocol",
+ "Basic Multicast", "Basic Multicast");
+ registerEvent("protocols.implementations.VSBerkelyTimeProtocol",
+ "Berkeley Algorithmus zur internen Sync.", "Berkeley");
+ registerEvent("protocols.implementations.VSBroadcastProtocol",
+ "Broadcast");
+ registerEvent("protocols.implementations.VSDummyProtocol",
+ "Beispiel/Dummy");
+ registerEvent("protocols.implementations.VSExternalTimeSyncProtocol",
+ "Christians Methode zur externen Sync.", "Christians");
+ registerEvent("protocols.implementations.VSInternalTimeSyncProtocol",
+ "Interne Synchronisation", "Interne Sync.");
+ registerEvent("protocols.implementations.VSOnePhaseCommitProtocol",
+ "Ein-Phasen Commit", "1-Phasen Commit");
+ registerEvent("protocols.implementations.VSPingPongProtocol",
+ "Ping Pong");
+ registerEvent("protocols.implementations.VSReliableMulticastProtocol",
+ "Reliable Multicast", "Reliable Multicast");
+ registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol",
+ "Zwei-Phasen Commit", "2-Phasen Commit");
+ */
+
+ /* Using the NEW way. The old way above (specifying protocol names
+ in this file still works as well */
+
+ registerEvent("events.implementations.VSProcessCrashEvent");
+ registerEvent("events.implementations.VSProcessRecoverEvent");
+ registerEvent("protocols.implementations.VSBasicMulticastProtocol");
+ registerEvent("protocols.implementations.VSBerkelyTimeProtocol");
+ registerEvent("protocols.implementations.VSBroadcastProtocol");
+ registerEvent("protocols.implementations.VSDummyProtocol");
+ registerEvent("protocols.implementations.VSExternalTimeSyncProtocol");
+ registerEvent("protocols.implementations.VSInternalTimeSyncProtocol");
+ registerEvent("protocols.implementations.VSOnePhaseCommitProtocol");
+ registerEvent("protocols.implementations.VSPingPongProtocol");
+ registerEvent("protocols.implementations.VSReliableMulticastProtocol");
+ registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol");
/* Make dummy objects of each protocol, to see if they contain VSPrefs
values to edit */
@@ -349,6 +367,19 @@ public final class VSRegisteredEvents {
}
/**
+ * Registers an event. Use the language settings of VSPrefs.
+ *
+ * @param eventClassname the event classname
+ */
+ private static void registerEvent(String eventClassname) {
+ String eventName =
+ prefs.getString("lang.en." + eventClassname);
+ String eventShortname =
+ prefs.getString("lang.en." + eventClassname + ".short");
+ registerEvent(eventClassname, eventName, eventShortname);
+ }
+
+ /**
* Registers an event.
*
* @param eventClassname the event classname