X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2FNexuizDemoRecorder%2Fmain%2Fsrc%2Fmain%2Fjava%2Fcom%2Fnexuiz%2Fdemorecorder%2Fapplication%2FNDRPreferences.java;h=84042f744266599f9d5a396169f2546b93c08c5d;hp=b599e4aea6923a88d9fc7d43b31cb9b37bb31d23;hb=d36387088cb9338aa4484a7e6e82bfe69defa1e2;hpb=e5832bf2ecac60a672a29c85cd8dec341a215e1c diff --git a/misc/tools/NexuizDemoRecorder/main/src/main/java/com/nexuiz/demorecorder/application/NDRPreferences.java b/misc/tools/NexuizDemoRecorder/main/src/main/java/com/nexuiz/demorecorder/application/NDRPreferences.java index b599e4ae..84042f74 100644 --- a/misc/tools/NexuizDemoRecorder/main/src/main/java/com/nexuiz/demorecorder/application/NDRPreferences.java +++ b/misc/tools/NexuizDemoRecorder/main/src/main/java/com/nexuiz/demorecorder/application/NDRPreferences.java @@ -1,66 +1,66 @@ -package com.nexuiz.demorecorder.application; - -import java.util.Properties; - -/** - * Class that stores the application and global plug-in preferences of the Nexuiz - * Demo Recorder application. Set and Get property methods have been modified to - * now supply a category. - */ -public class NDRPreferences extends Properties { - - private static final long serialVersionUID = 4363913054294979418L; - private static final String CONCATENATOR = "."; - /** - * Category that defines a setting to be a setting of the NDR application itself - * (and not of one of the plugins). - */ - public static final String MAIN_APPLICATION = "NDR"; - - /** - * Searches for the property with the specified key in this property list. - * If the key is not found in this property list, the default property list, - * and its defaults, recursively, are then checked. The method returns - * null if the property is not found. - * - * @param category the category of the setting - * @param key the property key. - * @return the value in this property list with the specified category+key value. - */ - public String getProperty(String category, String key) { - return getProperty(getConcatenatedKey(category, key)); - } - - /** - * Calls the Hashtable method put. Provided for - * parallelism with the getProperty method. Enforces use of - * strings for property keys and values. The value returned is the - * result of the Hashtable call to put. - * - * @param category the category of the setting - * @param key the key to be placed into this property list. - * @param value the value corresponding to key. - * @return the previous value of the specified key in this property - * list, or null if it did not have one. - */ - public void setProperty(String category, String key, String value) { - setProperty(getConcatenatedKey(category, key), value); - } - - /** - * Returns only the category of a key that is a concatenated string of category and key. - * @param concatenatedString - * @return - */ - public static String getCategory(String concatenatedString) { - return concatenatedString.substring(0, concatenatedString.indexOf(CONCATENATOR)); - } - - public static String getKey(String concatenatedString) { - return concatenatedString.substring(concatenatedString.indexOf(CONCATENATOR) + 1, concatenatedString.length()); - } - - public static String getConcatenatedKey(String category, String key) { - return category + CONCATENATOR + key; - } -} +package com.nexuiz.demorecorder.application; + +import java.util.Properties; + +/** + * Class that stores the application and global plug-in preferences of the Nexuiz + * Demo Recorder application. Set and Get property methods have been modified to + * now supply a category. + */ +public class NDRPreferences extends Properties { + + private static final long serialVersionUID = 4363913054294979418L; + private static final String CONCATENATOR = "."; + /** + * Category that defines a setting to be a setting of the NDR application itself + * (and not of one of the plugins). + */ + public static final String MAIN_APPLICATION = "NDR"; + + /** + * Searches for the property with the specified key in this property list. + * If the key is not found in this property list, the default property list, + * and its defaults, recursively, are then checked. The method returns + * null if the property is not found. + * + * @param category the category of the setting + * @param key the property key. + * @return the value in this property list with the specified category+key value. + */ + public String getProperty(String category, String key) { + return getProperty(getConcatenatedKey(category, key)); + } + + /** + * Calls the Hashtable method put. Provided for + * parallelism with the getProperty method. Enforces use of + * strings for property keys and values. The value returned is the + * result of the Hashtable call to put. + * + * @param category the category of the setting + * @param key the key to be placed into this property list. + * @param value the value corresponding to key. + * @return the previous value of the specified key in this property + * list, or null if it did not have one. + */ + public void setProperty(String category, String key, String value) { + setProperty(getConcatenatedKey(category, key), value); + } + + /** + * Returns only the category of a key that is a concatenated string of category and key. + * @param concatenatedString + * @return + */ + public static String getCategory(String concatenatedString) { + return concatenatedString.substring(0, concatenatedString.indexOf(CONCATENATOR)); + } + + public static String getKey(String concatenatedString) { + return concatenatedString.substring(concatenatedString.indexOf(CONCATENATOR) + 1, concatenatedString.length()); + } + + public static String getConcatenatedKey(String category, String key) { + return category + CONCATENATOR + key; + } +}