[Mathlib-commitlog] SF.net SVN: mathlib:[796] JMathLib/trunk/src/jmathlib/toolbox/jmathlib/ system
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-30 19:02:35
|
Revision: 796
http://mathlib.svn.sourceforge.net/mathlib/?rev=796&view=rev
Author: st_mueller
Date: 2009-01-30 19:02:16 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
changed handling of preferences/properties
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java
Removed Paths:
-------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setglobalproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setlocalproperty.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -25,7 +25,7 @@
String updateSiteS = "http://www.jmathlib.de/checkForUpdates/";
boolean silentB = false;
- s = globals.getInterpreter().prefs.getLocalProperty("update.site.primary");
+ s = globals.getProperty("update.site.primary");
if (s != null)
updateSiteS = s;
@@ -52,13 +52,13 @@
globals.getInterpreter().displayText("Checking for Updates at "+updateSiteS);
- String[] lastUpdateS = globals.getInterpreter().prefs.getLocalProperty("update.date.last").split("/");
+ String[] lastUpdateS = globals.getProperty("update.date.last").split("/");
int year = Integer.parseInt(lastUpdateS[0]);
int month = Integer.parseInt(lastUpdateS[1])-1;
int day = Integer.parseInt(lastUpdateS[2]);
//getInterpreter().displayText("check:"+year+"/"+month+"/"+day);
- int intervall = Integer.parseInt(globals.getInterpreter().prefs.getLocalProperty("update.intervall"));
+ int intervall = Integer.parseInt(globals.getProperty("update.intervall"));
GregorianCalendar calFile = new GregorianCalendar(year,month,day);
GregorianCalendar calCur = new GregorianCalendar();
@@ -142,7 +142,7 @@
System.out.println("checkForUpdates: Properties error");
}
- String[] localVersionS = globals.getInterpreter().prefs.getLocalProperty("jmathlib.version").replace("/",".").split("\\.");
+ String[] localVersionS = globals.getProperty("jmathlib.version").replace("/",".").split("\\.");
String[] webVersionS = props.getProperty("jmathlib.version").replace("/",".").split("\\.");
// build version number of local version
@@ -172,12 +172,12 @@
{
// set marker for next startup
- globals.getInterpreter().prefs.setLocalProperty("update.newversionavailable","yes");
+ globals.setProperty("update.newversionavailable","yes");
s = props.getProperty("update.newversionavailable.message01");
if (s!=null)
{
- globals.getInterpreter().prefs.setLocalProperty("update.newversionavailable.message01", s);
+ globals.setProperty("update.newversionavailable.message01", s);
globals.getInterpreter().displayText(s);
}
else
@@ -187,7 +187,7 @@
s = props.getProperty("update.newversionavailable.message02");
if (s!=null)
{
- globals.getInterpreter().prefs.setLocalProperty("update.newversionavailable.message02", s);
+ globals.setProperty("update.newversionavailable.message02", s);
globals.getInterpreter().displayText(s);
}
}
@@ -219,23 +219,23 @@
String checkedDate = Integer.toString(cal.get(Calendar.YEAR)) + "/"
+ Integer.toString(cal.get(Calendar.MONTH)+1) + "/"
+ Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
- globals.getInterpreter().prefs.setLocalProperty("update.date.last", checkedDate);
+ globals.setProperty("update.date.last", checkedDate);
// update link to primary update-site
s= props.getProperty("update.site.primary");
if (s!=null)
- globals.getInterpreter().prefs.setLocalProperty("update.site.primary",s);
+ globals.setProperty("update.site.primary",s);
// update link to backup update-site
s= props.getProperty("update.site.backup");
if (s!=null)
- globals.getInterpreter().prefs.setLocalProperty("update.site.backup",s);
+ globals.setProperty("update.site.backup",s);
// update message of the day
s= props.getProperty("message.of.the.day");
if (s!=null)
- globals.getInterpreter().prefs.setLocalProperty("message.of.the.day",s);
+ globals.setProperty("message.of.the.day",s);
}
Deleted: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -1,52 +0,0 @@
-package jmathlib.toolbox.jmathlib.system;
-
-import jmathlib.core.functions.ExternalFunction;
-import jmathlib.core.interpreter.GlobalValues;
-import jmathlib.core.tokens.Token;
-import jmathlib.core.tokens.CharToken;
-import jmathlib.core.tokens.OperandToken;
-
-/**External function to get a enviroment variable*/
-public class getglobalproperty extends ExternalFunction
-{
- /**Returns an enviroment variable
- @param operand[0] = the name of the variable
- @param operand[1] = a default value (optional)
- @return the enviroment value*/
- public OperandToken evaluate(Token[] operands, GlobalValues globals)
- {
- OperandToken result = null;
-
- if (getNArgIn(operands)!=1)
- throwMathLibException("getglobalproperty: number of arguments != 1");
-
-
- if (!(operands[0] instanceof CharToken))
- throwMathLibException("getglobalproperty: number of arguments != 1");
-
- String name = operands[0].toString();
- String defaultVal = "";
-
-
- String property = globals.getInterpreter().prefs.getGlobalProperty(name);
-
- result = new CharToken(property);
-
- return result;
- }
-}
-
-/*
-@GROUP
-system
-@SYNTAX
-GETENV(variablename)
-@DOC
-Returns the value of the enviromental variable variablename.
-@NOTES
-@EXAMPLES
-getlocal("HOME")= "/home/user"
-@SEE
-getenv, getglobalproperty, setlocalproperty, setglobalproperty
-*/
-
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -0,0 +1,52 @@
+package jmathlib.toolbox.jmathlib.system;
+
+import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+import jmathlib.core.tokens.Token;
+import jmathlib.core.tokens.CharToken;
+import jmathlib.core.tokens.OperandToken;
+
+/**External function to get a enviroment variable*/
+public class getjmathlibproperty extends ExternalFunction
+{
+ /**Returns an enviroment variable
+ @param operand[0] = the name of the variable
+ @param operand[1] = a default value (optional)
+ @return the enviroment value*/
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
+ {
+ OperandToken result = null;
+
+ if (getNArgIn(operands)!=1)
+ throwMathLibException("getjmathlibproperty: number of arguments != 1");
+
+
+ if (!(operands[0] instanceof CharToken))
+ throwMathLibException("getjmathlibproperty: number of arguments != 1");
+
+ String name = operands[0].toString();
+ String defaultVal = "";
+
+
+ String property = globals.getProperty(name);
+
+ result = new CharToken(property);
+
+ return result;
+ }
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+getjmathlibproperty(variablename)
+@DOC
+Returns the value of the enviromental variable variablename.
+@NOTES
+@EXAMPLES
+getlocal("HOME")= "/home/user"
+@SEE
+getenv, setjmathlibproperty
+*/
+
Deleted: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -1,52 +0,0 @@
-package jmathlib.toolbox.jmathlib.system;
-
-import jmathlib.core.functions.ExternalFunction;
-import jmathlib.core.interpreter.GlobalValues;
-import jmathlib.core.tokens.Token;
-import jmathlib.core.tokens.CharToken;
-import jmathlib.core.tokens.OperandToken;
-
-/**External function to get a enviroment variable*/
-public class getlocalproperty extends ExternalFunction
-{
- /**Returns an enviroment variable
- @param operand[0] = the name of the variable
- @param operand[1] = a default value (optional)
- @return the enviroment value*/
- public OperandToken evaluate(Token[] operands, GlobalValues globals)
- {
- OperandToken result = null;
-
- if (getNArgIn(operands)!=1)
- throwMathLibException("getlocalproperty: number of arguments != 1");
-
-
- if (!(operands[0] instanceof CharToken))
- throwMathLibException("getlocalproperty: number of arguments != 1");
-
- String name = operands[0].toString();
- String defaultVal = "";
-
-
- String property = globals.getInterpreter().prefs.getLocalProperty(name);
-
- result = new CharToken(property);
-
- return result;
- }
-}
-
-/*
-@GROUP
-system
-@SYNTAX
-GETENV(variablename)
-@DOC
-Returns the value of the enviromental variable variablename.
-@NOTES
-@EXAMPLES
-getlocal("HOME")= "/home/user"
-@SEE
-getenv, getglobalproperty, setlocalproperty, setglobalproperty
-*/
-
Deleted: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setglobalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setglobalproperty.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setglobalproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -1,51 +0,0 @@
-package jmathlib.toolbox.jmathlib.system;
-
-import jmathlib.core.functions.ExternalFunction;
-import jmathlib.core.interpreter.GlobalValues;
-import jmathlib.core.tokens.Token;
-import jmathlib.core.tokens.CharToken;
-import jmathlib.core.tokens.OperandToken;
-
-/**External function to get a enviroment variable*/
-public class setglobalproperty extends ExternalFunction
-{
- /**Returns an enviroment variable
- @param operand[0] = the name of the variable
- @param operand[1] = a default value (optional)
- @return the enviroment value*/
- public OperandToken evaluate(Token[] operands, GlobalValues globals)
- {
- OperandToken result = null;
-
- if (getNArgIn(operands)!=2)
- throwMathLibException("setglobalproperty: number of arguments != 2");
-
-
- if ( (!(operands[0] instanceof CharToken)) &&
- (!(operands[1] instanceof CharToken)) )
- throwMathLibException("setglobalproperty: arguments must be strings");
-
- String name = operands[0].toString();
- String prop = operands[1].toString();
-
- globals.getInterpreter().prefs.setGlobalProperty(name, prop);
-
-
- return result;
- }
-}
-
-/*
-@GROUP
-system
-@SYNTAX
-setglobalproperty(property name, value)
-@DOC
-Returns the value of the enviromental variable variablename.
-@NOTES
-@EXAMPLES
-GETENV("HOME")= "/home/user"
-@SEE
-setlocalproperty, getlocalproperty, getglobalproperty
-*/
-
Copied: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java (from rev 713, JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setglobalproperty.java)
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -0,0 +1,51 @@
+package jmathlib.toolbox.jmathlib.system;
+
+import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+import jmathlib.core.tokens.Token;
+import jmathlib.core.tokens.CharToken;
+import jmathlib.core.tokens.OperandToken;
+
+/**External function to get a enviroment variable*/
+public class setjmathlibproperty extends ExternalFunction
+{
+ /**Returns an enviroment variable
+ @param operand[0] = the name of the variable
+ @param operand[1] = a default value (optional)
+ @return the enviroment value*/
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
+ {
+ OperandToken result = null;
+
+ if (getNArgIn(operands)!=2)
+ throwMathLibException("setjmathlibproperty: number of arguments != 2");
+
+
+ if ( (!(operands[0] instanceof CharToken)) &&
+ (!(operands[1] instanceof CharToken)) )
+ throwMathLibException("setjmathlibproperty: arguments must be strings");
+
+ String name = operands[0].toString();
+ String prop = operands[1].toString();
+
+ globals.setProperty(name, prop);
+
+
+ return result;
+ }
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+setjmathlibproperty(property name, value)
+@DOC
+Returns the value of the enviromental variable variablename.
+@NOTES
+@EXAMPLES
+GETENV("HOME")= "/home/user"
+@SEE
+getjmathlibproperty, getenv
+*/
+
Deleted: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setlocalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setlocalproperty.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setlocalproperty.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -1,51 +0,0 @@
-package jmathlib.toolbox.jmathlib.system;
-
-import jmathlib.core.functions.ExternalFunction;
-import jmathlib.core.interpreter.GlobalValues;
-import jmathlib.core.tokens.Token;
-import jmathlib.core.tokens.CharToken;
-import jmathlib.core.tokens.OperandToken;
-
-/**External function to get a enviroment variable*/
-public class setlocalproperty extends ExternalFunction
-{
- /**Returns an enviroment variable
- @param operand[0] = the name of the variable
- @param operand[1] = a default value (optional)
- @return the enviroment value*/
- public OperandToken evaluate(Token[] operands, GlobalValues globals)
- {
- OperandToken result = null;
-
- if (getNArgIn(operands)!=2)
- throwMathLibException("setlocalproperty: number of arguments != 2");
-
-
- if ( (!(operands[0] instanceof CharToken)) &&
- (!(operands[1] instanceof CharToken)) )
- throwMathLibException("setlocalproperty: arguments must be strings");
-
- String name = operands[0].toString();
- String prop = operands[1].toString();
-
- globals.getInterpreter().prefs.setLocalProperty(name, prop);
-
-
- return result;
- }
-}
-
-/*
-@GROUP
-system
-@SYNTAX
-setlocalproperty(property name, value)
-@DOC
-Returns the value of the enviromental variable variablename.
-@NOTES
-@EXAMPLES
-GETENV("HOME")= "/home/user"
-@SEE
-setglobalproperty
-*/
-
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -20,11 +20,11 @@
globals.getInterpreter().displayText("UPDATING JMathLib\n");
// get update site of jmathlib
- String updateSiteS = globals.getInterpreter().prefs.getLocalProperty("update.site.primary");
+ String updateSiteS = globals.getProperty("update.site.primary");
globals.getInterpreter().displayText("update site: "+updateSiteS);
// get local version of jmathlib
- String localVersionS = globals.getInterpreter().prefs.getLocalProperty("jmathlib.version");
+ String localVersionS = globals.getProperty("jmathlib.version");
localVersionS = localVersionS.replaceAll("/", ".");
globals.getInterpreter().displayText("current version: "+localVersionS);
@@ -175,7 +175,7 @@
String propS = s.substring(5).trim();
globals.getInterpreter().displayText("new property: >"+propS+"<");
String[] p = propS.split("=");
- globals.getInterpreter().prefs.setLocalProperty(p[0],p[1]);
+ globals.setProperty(p[0],p[1]);
}
else
{
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -14,19 +14,19 @@
globals.getInterpreter().displayText("Version information for JMathLib");
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.version");
+ s = globals.getProperty("jmathlib.version");
globals.getInterpreter().displayText("version: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.date");
+ s = globals.getProperty("jmathlib.release.date");
globals.getInterpreter().displayText("release date: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.name");
+ s = globals.getProperty("jmathlib.release.name");
globals.getInterpreter().displayText("release name: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.description");
+ s = globals.getProperty("jmathlib.release.description");
globals.getInterpreter().displayText("release description: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.copyright");
+ s = globals.getProperty("jmathlib.copyright");
globals.getInterpreter().displayText(s);
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java 2009-01-30 18:59:26 UTC (rev 795)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java 2009-01-30 19:02:16 UTC (rev 796)
@@ -14,19 +14,19 @@
globals.getInterpreter().displayText("Version information for JMathLib");
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.version");
+ s = globals.getProperty("jmathlib.version");
globals.getInterpreter().displayText("version: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.date");
+ s = globals.getProperty("jmathlib.release.date");
globals.getInterpreter().displayText("release date: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.name");
+ s = globals.getProperty("jmathlib.release.name");
globals.getInterpreter().displayText("release name: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.release.description");
+ s = globals.getProperty("jmathlib.release.description");
globals.getInterpreter().displayText("release description: "+s);
- s = globals.getInterpreter().prefs.getLocalProperty("jmathlib.copyright");
+ s = globals.getProperty("jmathlib.copyright");
globals.getInterpreter().displayText(s);
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|