mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 3)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(150) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(233) |
Feb
(86) |
Mar
(32) |
Apr
(26) |
May
(73) |
Jun
(45) |
Jul
(23) |
Aug
(23) |
Sep
(5) |
Oct
(80) |
Nov
(11) |
Dec
(11) |
| 2008 |
Jan
|
Feb
|
Mar
(13) |
Apr
(3) |
May
(7) |
Jun
(30) |
Jul
(12) |
Aug
(12) |
Sep
|
Oct
|
Nov
(78) |
Dec
(78) |
| 2009 |
Jan
(214) |
Feb
(79) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <st_...@us...> - 2009-02-21 17:49:26
|
Revision: 860
http://mathlib.svn.sourceforge.net/mathlib/?rev=860&view=rev
Author: st_mueller
Date: 2009-02-21 17:49:12 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
renamed MathLibOutput into JMathLibOutput and added a new method: setStatusText in order to show some status message in the GUI
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-21 17:48:39 UTC (rev 859)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-21 17:49:12 UTC (rev 860)
@@ -16,9 +16,6 @@
import java.net.*;
import java.util.*;
-// OPEN: Also send current information about toolboxes and
-// installed version to server
-
/**An external function for checking for updates over the network*/
public class checkforupdates extends ExternalFunction
{
@@ -32,14 +29,22 @@
String s = "";
String lineFile = "";
- String updateSiteS = "http://www.jmathlib.de/updates/";
boolean silentB = false;
+ // check the information of the primary update site
+ String updateSiteS = "http://www.jmathlib.de/updates/";
s = globals.getProperty("update.site.primary");
+
+ // if update-site information is not available try the secondary site
+ if (s==null)
+ s = globals.getProperty("update.site.secondary");
+
+ // if primary update site or secondary site information is available
+ // take it
if (s != null)
updateSiteS = s;
-
-
+
+ // check the arguments
if (getNArgIn(operands) == 1)
{
if ((operands[0] instanceof CharToken))
@@ -52,43 +57,39 @@
}
else
{
+ // argument is maybe a different update site URL
updateSiteS = st;
globals.getInterpreter().displayText("New Update Site "+updateSiteS);
}
}
}
+ // inform the user about checking the update site
if (!silentB)
globals.getInterpreter().displayText("Checking for Updates at "+updateSiteS);
-
+ // check the last date when an update has been performed
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);
+ // read the interval between updates
int intervall = Integer.parseInt(globals.getProperty("update.intervall"));
+ // get the current date
GregorianCalendar calFile = new GregorianCalendar(year,month,day);
GregorianCalendar calCur = new GregorianCalendar();
- //getInterpreter().displayText("check: "+calCur.toString());
-
- //getInterpreter().displayText("check: "+calFile.toString());
-
+ // add update-interval to the current date
calFile.add(Calendar.DATE,intervall);
- //getInterpreter().displayText("check: "+calFile.toString());
-
- //getInterpreter().displayText("calFile "+calFile);
- //getInterpreter().displayText("calCur "+calCur);
-
-
if (silentB)
{
- if (calCur.after(calFile))
+ // if silent-mode is active only check for updates when update intervall has been reached
+ if (calCur.after(calFile) )
{
checkForUpdatesThread ch = new checkForUpdatesThread(updateSiteS, silentB);
}
@@ -99,8 +100,9 @@
}
return null;
- }
+ } // end evaluate
+
// create separate thread for checking the update site, because this may take
// some time
public class checkForUpdatesThread extends Thread
@@ -234,11 +236,17 @@
checkForUpdates(site)
checkForUpdates("-silent")
@DOC
+This functions checks via network if the current
+installation of JMathLib is up to date.
+
+This functions is also called during startup of JMathLib's GUI.
@EXAMPLE
+checkforupdates()
@NOTES
This functions checks via network if the current
installation of JMathLib is up to date.
This functions is also called during startup of JMathLib's GUI.
@SEE
+update
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-21 17:48:39 UTC (rev 859)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-21 17:49:12 UTC (rev 860)
@@ -8,6 +8,8 @@
*/
package jmathlib.toolbox.jmathlib.system;
+import java.awt.FileDialog;
+import java.awt.Frame;
import java.io.*;
import java.net.*;
import java.util.Properties;
@@ -73,17 +75,20 @@
// reaction on the response from the update server
if (updateActionS.equals("VERSION_UNKNOWN"))
{
+ // the server does not recognize the local version of JMathLib
globals.getInterpreter().displayText("Your version of JMathLib is not known by the update server.");
return null;
}
else if (updateVersionS.equals("NO_UPDATE_AVAILABLE") ||
updateActionS.equals("NO_ACTION") )
{
+ // there is no update available on the server
globals.getInterpreter().displayText("No update available right now.");
return null;
}
else if (updateActionS.equals("FULL_DOWNLOAD_REQUIRED"))
{
+ // the updates requires to do a full download of a new version of JMathLib
globals.getInterpreter().displayText("\n");
globals.getInterpreter().displayText("Full download required in order to update!");
globals.getInterpreter().displayText("Please visit www.jmathlib.de for details.");
@@ -96,30 +101,45 @@
if ((urlS==null) || (fileS==null))
return null;
-
- // put a message box here
+ // open a file dialog to choose the download directory and download filename
+ Frame f = new Frame();
+ FileDialog theFileDialog = new FileDialog(f, "Save to ...", FileDialog.SAVE);
+ theFileDialog.setFile(fileS);
+ theFileDialog.setVisible(true);
+ String downloadDirS = theFileDialog.getDirectory();
+ fileS = theFileDialog.getFile();
+ if (downloadDirS==null)
+ throwMathLibException("download directory error");
+
+ if (fileS==null)
+ throwMathLibException("download file error");
+
+ globals.getInterpreter().setStatusText("You selected "+downloadDirS+" as download directory.");
+
// open URL to file on update server
try
{
- globals.getInterpreter().displayText("Downloading ...");
+ globals.getInterpreter().displayText("Downloading ... (please wait some minutes)");
URL fileURL = new URL(urlS);
InputStream in = fileURL.openStream();
- // open file on local disc
- File file = new File(globals.getWorkingDirectory(),fileS);
+ // open file on local disc and download the new version of JMathLib
+ File file = new File(downloadDirS, fileS);
OutputStream out = new FileOutputStream(file);
byte[] cbuf = new byte[4096];
int len = -1;
-
+ int x = 0;
while ((len = in.read(cbuf)) != -1)
{
out.write(cbuf,0,len);
+ x+= len;
+ globals.getInterpreter().setStatusText("downloaded "+new Integer(x).toString()+" bytes");
}
in.close();
out.close();
- globals.getInterpreter().displayText("Downloading done.");
+ globals.getInterpreter().setStatusText("Downloading done.");
}
catch (Exception e)
{
@@ -132,7 +152,7 @@
try
{
globals.getInterpreter().displayText("Running installer ...");
- Runtime.getRuntime().exec(fileS);
+ Runtime.getRuntime().exec(downloadDirS+fileS);
globals.getInterpreter().displayText("Please exit JMathLib");
}
catch(IOException exception)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-21 17:48:52
|
Revision: 859
http://mathlib.svn.sourceforge.net/mathlib/?rev=859&view=rev
Author: st_mueller
Date: 2009-02-21 17:48:39 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
renamed MathLibOutput into JMathLibOutput and added a new method: setStatusText in order to show some status message in the GUI
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/plugins/PluginsManager.java
Modified: JMathLib/trunk/src/jmathlib/plugins/PluginsManager.java
===================================================================
--- JMathLib/trunk/src/jmathlib/plugins/PluginsManager.java 2009-02-21 17:48:09 UTC (rev 858)
+++ JMathLib/trunk/src/jmathlib/plugins/PluginsManager.java 2009-02-21 17:48:39 UTC (rev 859)
@@ -1,7 +1,7 @@
package jmathlib.plugins;
import jmathlib.core.interpreter.*;
-import jmathlib.core.interfaces.MathLibOutput;
+import jmathlib.core.interfaces.JMathLibOutput;
@@ -16,7 +16,7 @@
VariableList globals;
- MathLibOutput outputPanel;
+ JMathLibOutput outputPanel;
public PluginsManager()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-21 17:48:23
|
Revision: 858
http://mathlib.svn.sourceforge.net/mathlib/?rev=858&view=rev
Author: st_mueller
Date: 2009-02-21 17:48:09 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
renamed MathLibOutput into JMathLibOutput and added a new method: setStatusText in order to show some status message in the GUI
Removed Paths:
-------------
JMathLib/trunk/src/jmathlib/core/interfaces/MathLibOutput.java
Deleted: JMathLib/trunk/src/jmathlib/core/interfaces/MathLibOutput.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interfaces/MathLibOutput.java 2009-02-21 17:47:53 UTC (rev 857)
+++ JMathLib/trunk/src/jmathlib/core/interfaces/MathLibOutput.java 2009-02-21 17:48:09 UTC (rev 858)
@@ -1,6 +0,0 @@
-package jmathlib.core.interfaces;
-
-public interface MathLibOutput
-{
- public void displayText(String text);
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-21 17:48:02
|
Revision: 857
http://mathlib.svn.sourceforge.net/mathlib/?rev=857&view=rev
Author: st_mueller
Date: 2009-02-21 17:47:53 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
renamed MathLibOutput into JMathLibOutput and added a new method: setStatusText in order to show some status message in the GUI
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/core/interfaces/JMathLibOutput.java
Copied: JMathLib/trunk/src/jmathlib/core/interfaces/JMathLibOutput.java (from rev 826, JMathLib/trunk/src/jmathlib/core/interfaces/MathLibOutput.java)
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interfaces/JMathLibOutput.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/core/interfaces/JMathLibOutput.java 2009-02-21 17:47:53 UTC (rev 857)
@@ -0,0 +1,8 @@
+package jmathlib.core.interfaces;
+
+public interface JMathLibOutput
+{
+ public void displayText(String text);
+
+ public void setStatusText(String text);
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-21 17:05:39
|
Revision: 856
http://mathlib.svn.sourceforge.net/mathlib/?rev=856&view=rev
Author: st_mueller
Date: 2009-02-21 17:05:29 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
renamed MathLibOutput into JMathLibOutput and added a new method: setStatusText in order to show some status message in the GUI
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java
JMathLib/trunk/src/jmathlib/ui/awt/Console.java
JMathLib/trunk/src/jmathlib/ui/awt/GUI.java
JMathLib/trunk/src/jmathlib/ui/common/Console.java
JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
JMathLib/trunk/src/jmathlib/ui/swing/Console.java
JMathLib/trunk/src/jmathlib/ui/swing/KeyHandler.java
JMathLib/trunk/src/jmathlib/ui/swing/SwingGUI.java
JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -2,6 +2,7 @@
import jmathlib.core.interpreter.Interpreter;
import jmathlib.core.interfaces.RemoteAccesible;
+import jmathlib.core.interfaces.JMathLibOutput;
import jmathlib.ui.common.Console;
import java.awt.*;
@@ -9,7 +10,7 @@
import java.applet.*;
/**Rudimentary interface used to test the program*/
-public class JMathLibGUI extends Applet implements RemoteAccesible
+public class JMathLibGUI extends Applet implements RemoteAccesible, JMathLibOutput
{
/**Flag storing whether the program is running as an application or an applet*/
boolean runningStandalone;
@@ -60,7 +61,7 @@
interpreter = new Interpreter(false);
- interpreter.setOutputPanel(answer);
+ interpreter.setOutputPanel(this);
interpreter.executeExpression("startup");
// get parameter for background color (e.g. ff00cc)
@@ -80,7 +81,24 @@
catch (NumberFormatException e){ }
}
+
+ /**
+ * display text
+ */
+ public void displayText(String text)
+ {
+ answer.displayText(text);
+ }
+
+ /**
+ * display status message
+ */
+ public void setStatusText(String status)
+ {
+
+ }
+
/**start the applet*/
public void start()
{
Modified: JMathLib/trunk/src/jmathlib/ui/awt/Console.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/awt/Console.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/awt/Console.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -1,15 +1,16 @@
package jmathlib.ui.awt;
-import jmathlib.core.interfaces.MathLibOutput;
import jmathlib.core.interfaces.RemoteAccesible;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
-/**Class implementing a console style window
-It needs the ConsoleKeyHandler class to work*/
-public class Console extends TextArea implements MathLibOutput
+/**
+ * Class implementing a console style window
+ * It needs the ConsoleKeyHandler class to work
+ */
+public class Console extends TextArea
{
int commandNo;
Modified: JMathLib/trunk/src/jmathlib/ui/awt/GUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/awt/GUI.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/awt/GUI.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -3,6 +3,7 @@
import jmathlib.core.interfaces.RemoteAccesible;
import jmathlib.core.interpreter.ErrorLogger;
import jmathlib.core.interpreter.Interpreter;
+import jmathlib.core.interfaces.JMathLibOutput;
import java.awt.*;
import java.awt.event.*;
@@ -21,37 +22,40 @@
* </ul>
* </p>
*/
-public class GUI extends Frame implements WindowListener, ActionListener, RemoteAccesible, ClipboardOwner
+public class GUI extends Frame implements JMathLibOutput, WindowListener, ActionListener, RemoteAccesible, ClipboardOwner
{
- /*The menubar container.*/
- private MenuBar mainMenuBar;
- private Menu fileMenu;
- private Menu editMenu;
- private Menu windowMenu;
- private Menu helpMenu;
- private MenuItem separator1;
- private MenuItem separator2;
- private MenuItem newFileMenuItem;
- private MenuItem openFileMenuItem;
- private MenuItem saveFileMenuItem;
- private MenuItem saveAsFileMenuItem;
- private MenuItem checkForUpdatesMenuItem;
- private MenuItem exitFileMenuItem;
- private MenuItem cutEditMenuItem;
- private MenuItem copyEditMenuItem;
- private MenuItem pasteEditMenuItem;
- private MenuItem consoleWindowMenuItem;
- private MenuItem plotWindowMenuItem;
- private MenuItem aboutHelpMenuItem;
+ /*The menubar container.*/
+ private MenuBar mainMenuBar;
+ private Menu fileMenu;
+ private Menu editMenu;
+ private Menu windowMenu;
+ private Menu helpMenu;
+ private MenuItem separator1;
+ private MenuItem separator2;
+ private MenuItem newFileMenuItem;
+ private MenuItem openFileMenuItem;
+ private MenuItem saveFileMenuItem;
+ private MenuItem saveAsFileMenuItem;
+ private MenuItem checkForUpdatesMenuItem;
+ private MenuItem exitFileMenuItem;
+ private MenuItem cutEditMenuItem;
+ private MenuItem copyEditMenuItem;
+ private MenuItem pasteEditMenuItem;
+ private MenuItem consoleWindowMenuItem;
+ private MenuItem plotWindowMenuItem;
+ private MenuItem aboutHelpMenuItem;
- /**Constant with the application title.*/
- private final String TITLE="JMathLib GUI";
+ /** status message in frame */
+ private Label statusLabel;
+
+ /**Constant with the application title.*/
+ private final String TITLE="JMathLib GUI";
- /**The area used for user input and where the answers are displayed*/
- private Console answer;
+ /**The area used for user input and where the answers are displayed*/
+ private Console answer;
- /**The interpreter*/
- private Interpreter interpreter;
+ /**The interpreter*/
+ private Interpreter interpreter;
/**Reacts to the user menu and update (if necessary) the interface.*/
public void actionPerformed(ActionEvent e)
@@ -207,7 +211,7 @@
// Let's resize the window...
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
if (width == -1)
- width = (d.width*70)/100;
+ width = (d.width*50)/100;
if (height == -1)
height = (d.height*50)/100;
@@ -232,6 +236,7 @@
this.setVisible(false);
this.setLayout(new BorderLayout());
this.setBackground(new Color(214,211,206));
+
//Get the size of the screen
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
//position the frame in the centre of the screen
@@ -256,14 +261,26 @@
InitMenuBar(this);
this.setTitle(TITLE + " [2/4] Initializing console window");
- InitConsole();
+ answer = new Console(this);
+ this.add(answer, BorderLayout.CENTER);
+ answer.displayPrompt();
+ // Sometimes I get an unfocused console, so I request it manually.
+ answer.requestFocus();
+
+ statusLabel = new Label("JMathLib");
+ this.add(statusLabel, BorderLayout.SOUTH);
+
+
+ this.validate();
+
this.setTitle(TITLE + " [3/4] Initializing interpreter");
interpreter = new Interpreter(true);
- interpreter.setOutputPanel(answer);
+ interpreter.setOutputPanel(this); //answer);
+ //interpreter.regStatus(statusLabel);
- this.setTitle(TITLE + " - [4/4] running startup script");
+ this.setTitle(TITLE + " [4/4] running startup script");
interpreter.executeExpression("startup;");
//interpreter.executeExpression("messageoftheday");
answer.displayPrompt();
@@ -289,17 +306,8 @@
} // end GUI
- /**The main console initializer.*/
- private void InitConsole()
- {
- answer = new Console(this);
- this.add(answer);
- this.validate();
- answer.displayPrompt();
- // Sometimes I get an unfocused console, so I request it manually.
- answer.requestFocus();
- }
+
/**The menu initializer.*/
private void InitMenuBar(ActionListener listener)
{
@@ -389,9 +397,28 @@
answer.displayText(answerString);
answer.displayPrompt();
}
+
+
+ /**
+ * displays the output of an evaluation
+ * @param text to display
+ */
+ public void displayText(String text)
+ {
+ answer.displayText(text);
+ }
+
+ /**
+ * displays the current status message at the bottom of the frame
+ * @param status message
+ */
+ public void setStatusText(String status)
+ {
+ statusLabel.setText(status);
+ }
/**
- *
+ * main method
* @param args
*/
public static void main (String[] args)
Modified: JMathLib/trunk/src/jmathlib/ui/common/Console.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/common/Console.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/common/Console.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -1,6 +1,5 @@
package jmathlib.ui.common;
-import jmathlib.core.interfaces.MathLibOutput;
import jmathlib.core.interfaces.RemoteAccesible;
import java.awt.*;
@@ -9,7 +8,7 @@
/**Class implementing a console style window
It needs the ConsoleKeyHandler class to work*/
-public class Console extends TextArea implements MathLibOutput
+public class Console extends TextArea
{
int commandNo;
Modified: JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -12,11 +12,11 @@
import javax.servlet.*;
import javax.servlet.http.*;
-import jmathlib.core.interfaces.MathLibOutput;
+import jmathlib.core.interfaces.JMathLibOutput;
import jmathlib.core.interpreter.*;
/** a basic servlet showing the usage of JMathLib */
-public class JMathLibServlet extends HttpServlet implements MathLibOutput {
+public class JMathLibServlet extends HttpServlet implements JMathLibOutput {
private String dispText ="";
@@ -78,6 +78,15 @@
{
dispText += text;
}
+
+ /**
+ * this method ist used to display status messages
+ * @param status message
+ */
+ public void setStatusText(String status)
+ {
+
+ }
}
Modified: JMathLib/trunk/src/jmathlib/ui/swing/Console.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/Console.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/swing/Console.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -1,6 +1,5 @@
package jmathlib.ui.swing;
-import jmathlib.core.interfaces.MathLibOutput;
import javax.swing.*;
import javax.swing.text.*;
@@ -8,7 +7,7 @@
/**
* Main input text area class.
*/
-public class Console extends JTextArea implements MathLibOutput
+public class Console extends JTextArea
{
public static Console runningReference = null;
Modified: JMathLib/trunk/src/jmathlib/ui/swing/KeyHandler.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/KeyHandler.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/swing/KeyHandler.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -4,6 +4,7 @@
import javax.swing.text.*;
import java.util.*;
import jmathlib.core.interpreter.Interpreter;
+import jmathlib.core.interfaces.JMathLibOutput;
@@ -17,7 +18,7 @@
* See GN0004 for more information.</td></table></p>
* @version 3.1.1
*/
-public class KeyHandler implements KeyListener
+public class KeyHandler implements KeyListener, JMathLibOutput
{
public static KeyHandler runningReference = null;
@@ -26,6 +27,7 @@
// The interpreter
Interpreter interpreter = new Interpreter(true);
+ Console con = null;
/**
@@ -34,14 +36,25 @@
* Initializes the interpreter.
* @param con Where the interpreter will place its output.
*/
- public KeyHandler(Console con)
+ public KeyHandler(Console _con)
{
+ con = _con;
if (runningReference == null)
{
runningReference = this;
}
- interpreter.setOutputPanel(con);
+ interpreter.setOutputPanel(this);
}
+
+ public void displayText(String text)
+ {
+ con.displayText(text);
+ }
+
+ public void setStatusText(String status)
+ {
+
+ }
Modified: JMathLib/trunk/src/jmathlib/ui/swing/SwingGUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/swing/SwingGUI.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/swing/SwingGUI.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -5,6 +5,7 @@
import javax.swing.*;
import java.io.*;
import java.util.*;
+import jmathlib.core.interfaces.JMathLibOutput;
@@ -21,7 +22,8 @@
* </table>
* @version 2.0
*/
-public class SwingGUI extends JFrame {
+public class SwingGUI extends JFrame
+{
final String appTitle = "JMathLib SwingGUI";
Modified: JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/text/TextUI.java 2009-02-20 19:49:48 UTC (rev 855)
+++ JMathLib/trunk/src/jmathlib/ui/text/TextUI.java 2009-02-21 17:05:29 UTC (rev 856)
@@ -6,7 +6,7 @@
import java.io.*;
-public class TextUI implements RemoteAccesible, MathLibOutput
+public class TextUI implements RemoteAccesible, JMathLibOutput
{
/**store whether executing lines or entering a function def*/
private boolean interactiveMode;
@@ -111,6 +111,15 @@
System.out.println(text);
}
+ /**
+ * display status
+ * @param status message
+ */
+ public void setStatusText(String status)
+ {
+
+ }
+
public void displayPrompt()
{
System.out.print("> ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-20 19:50:08
|
Revision: 855
http://mathlib.svn.sourceforge.net/mathlib/?rev=855&view=rev
Author: st_mueller
Date: 2009-02-20 19:49:48 +0000 (Fri, 20 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2009-02-20 19:48:44 UTC (rev 854)
+++ JMathLib/trunk/ChangeLog.txt 2009-02-20 19:49:48 UTC (rev 855)
@@ -9,6 +9,10 @@
---- HISTORY ------------------------------------------------------------------
2009/02/xx stefan:
+2009/02/20 stefan: added a new function jmathlibcreateuniqueid
+ to create a unique ID for the current installation. The
+ ID will be save in the standard properties.
+
2009/02/15 stefan: added a new update manager: changes made
to update.java and checkforupdates.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-20 19:48:53
|
Revision: 854
http://mathlib.svn.sourceforge.net/mathlib/?rev=854&view=rev
Author: st_mueller
Date: 2009-02-20 19:48:44 +0000 (Fri, 20 Feb 2009)
Log Message:
-----------
added new function
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/jmathlibcreateuniqueid.java
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/jmathlibcreateuniqueid.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/jmathlibcreateuniqueid.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/jmathlibcreateuniqueid.java 2009-02-20 19:48:44 UTC (rev 854)
@@ -0,0 +1,51 @@
+package jmathlib.toolbox.jmathlib.system;
+
+import java.util.Date;
+import java.util.Random;
+
+import jmathlib.core.tokens.Token;
+import jmathlib.core.tokens.OperandToken;
+import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
+
+
+public class jmathlibcreateuniqueid extends ExternalFunction
+{
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
+ {
+
+ //throwMathLibException("jmathlibcreateuniqueid");
+
+
+ String uniqueIDS = globals.getProperty("jmathlib.id.unique");
+
+ if (uniqueIDS==null)
+ {
+
+ Date d = new Date();
+ double start = (double)d.getTime();
+ String startS = new Double(start).toString();
+
+ String randS = new Double(Math.random()).toString();
+
+ //System.out.println("RANDOM "+startS +" "+randS);
+
+ globals.setProperty("jmathlib.id.unique", startS+randS);
+ }
+
+ return null;
+ }
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+jmathlibcreateuniqueid
+@DOC
+create a unique id for jmathlib
+@NOTES
+@EXAMPLES
+@SEE
+update, checkforupdates
+*/
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-18 19:28:40
|
Revision: 853
http://mathlib.svn.sourceforge.net/mathlib/?rev=853&view=rev
Author: st_mueller
Date: 2009-02-18 19:28:34 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
added standard comment
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/debug.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/disp.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/error.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/foreach.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getdebug.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/debug.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/debug.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/debug.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/disp.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/disp.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/disp.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/error.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/error.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/error.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/foreach.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/foreach.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/foreach.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getdebug.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getdebug.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getdebug.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
@@ -2,4 +10,2 @@
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
-import jmathlib.core.interpreter.Errors;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getjmathlibproperty.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java 2009-02-18 19:25:47 UTC (rev 852)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java 2009-02-18 19:28:34 UTC (rev 853)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-18 19:25:55
|
Revision: 852
http://mathlib.svn.sourceforge.net/mathlib/?rev=852&view=rev
Author: st_mueller
Date: 2009-02-18 19:25:47 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
added standard comment
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargchk.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargoutchk.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/newline.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/path.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/print_usage.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/printstacktrace.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/quit.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rehash.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rmpath.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setdebug.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/usage.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/warning.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargchk.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargchk.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargchk.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargoutchk.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargoutchk.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/nargoutchk.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/newline.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/newline.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/newline.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
@@ -33,18 +41,15 @@
@GROUP
system
@SYNTAX
-NEWLINE(lines)
+newline(lines)
@DOC
Displays number of blank lines equal to the first parameter.
@NOTES
@EXAMPLES
NEWLINE(1)
-
NEWLINE(2)
-
-
@SEE
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/path.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/path.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/path.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.FunctionLoader;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/print_usage.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/print_usage.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/print_usage.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/printstacktrace.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/printstacktrace.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/printstacktrace.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
@@ -29,7 +37,7 @@
@GROUP
system
@SYNTAX
-PrintStackTrace(message)
+printstacktrace(message)
@DOC
Displays message and the current execution stack trace.
@NOTES
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/quit.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/quit.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/quit.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author: st...@he...
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rehash.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rehash.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rehash.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rmpath.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rmpath.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/rmpath.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.FunctionLoader;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setdebug.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setdebug.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setdebug.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/setjmathlibproperty.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/usage.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/usage.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/usage.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/ver.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/version.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/warning.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/warning.java 2009-02-16 06:35:26 UTC (rev 851)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/warning.java 2009-02-18 19:25:47 UTC (rev 852)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.Token;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-16 06:35:33
|
Revision: 851
http://mathlib.svn.sourceforge.net/mathlib/?rev=851&view=rev
Author: st_mueller
Date: 2009-02-16 06:35:26 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
added standard comment
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-15 10:21:58 UTC (rev 850)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-16 06:35:26 UTC (rev 851)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author: st...@he...
+ * (c) 2008-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-15 10:21:58 UTC (rev 850)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-16 06:35:26 UTC (rev 851)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author: st...@he...
+ * (c) 2008-2009
+ */
package jmathlib.toolbox.jmathlib.system;
import java.io.*;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-15 10:22:03
|
Revision: 850
http://mathlib.svn.sourceforge.net/mathlib/?rev=850&view=rev
Author: st_mueller
Date: 2009-02-15 10:21:58 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2009-02-15 10:20:32 UTC (rev 849)
+++ JMathLib/trunk/ChangeLog.txt 2009-02-15 10:21:58 UTC (rev 850)
@@ -9,6 +9,9 @@
---- HISTORY ------------------------------------------------------------------
2009/02/xx stefan:
+2009/02/15 stefan: added a new update manager: changes made
+ to update.java and checkforupdates.java
+
2009/02/10 stefan: added libs/servlet-api.jar in order to create a servlet
for tomcat
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-15 10:20:35
|
Revision: 849
http://mathlib.svn.sourceforge.net/mathlib/?rev=849&view=rev
Author: st_mueller
Date: 2009-02-15 10:20:32 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
new update manager
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-15 05:12:08 UTC (rev 848)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/checkforupdates.java 2009-02-15 10:20:32 UTC (rev 849)
@@ -3,6 +3,7 @@
import jmathlib.core.tokens.*;
import jmathlib.core.functions.ExternalFunction;
import jmathlib.core.interpreter.GlobalValues;
+import jmathlib.core.interpreter.ErrorLogger;
import java.net.*;
import java.util.*;
@@ -18,11 +19,12 @@
public OperandToken evaluate(Token[] operands, GlobalValues _globals)
{
+ // copy pointer to globals
globals = _globals;
String s = "";
String lineFile = "";
- String updateSiteS = "http://www.jmathlib.de/checkForUpdates/";
+ String updateSiteS = "http://www.jmathlib.de/updates/";
boolean silentB = false;
s = globals.getProperty("update.site.primary");
@@ -42,8 +44,8 @@
}
else
{
- updateSiteS = s;
- globals.getInterpreter().displayText("Update Site "+updateSiteS);
+ updateSiteS = st;
+ globals.getInterpreter().displayText("New Update Site "+updateSiteS);
}
}
}
@@ -75,10 +77,6 @@
//getInterpreter().displayText("calCur "+calCur);
- //if (calCur.after(calFile))
- // getInterpreter().displayText("AFTER: TRUE" );
- //else
- // getInterpreter().displayText("AFTER: FALSE" );
if (silentB)
{
@@ -115,16 +113,24 @@
System.out.println("checkForUpdates: constructor");
}
+ /**
+ * separate thread which checks the update site
+ * It is a thread in order to cause no time delay for the user.
+ */
public synchronized void run()
{
String s;
+
// open URL
URL url = null;
try
{
- url = new URL(updateSiteS);
+ // get local version of jmathlib
+ String localVersionS = globals.getProperty("jmathlib.version").replaceAll("/", ".");
+
+ url = new URL(updateSiteS+"?jmathlib_version="+localVersionS+"&command=check");
}
catch (Exception e)
{
@@ -142,77 +148,50 @@
System.out.println("checkForUpdates: Properties error");
}
- String[] localVersionS = globals.getProperty("jmathlib.version").replace("/",".").split("\\.");
- String[] webVersionS = props.getProperty("jmathlib.version").replace("/",".").split("\\.");
+ String localVersionS = globals.getProperty("jmathlib.version");
+ String updateVersionS = props.getProperty("update.toversion");
+ String updateActionS = props.getProperty("update.action");
- // build version number of local version
- // e.g. 2.6.7 -> 20607
- int localVersion =0;
-
- if (localVersionS.length==3)
- {
- localVersion += Integer.parseInt(localVersionS[0]) * 100 * 100;
- localVersion += Integer.parseInt(localVersionS[1]) * 100;
- localVersion += Integer.parseInt(localVersionS[2]);
- }
-
- // build version number of web version
- // e.g. 2.6.7 -> 20607
- int webVersion=0;
-
- if (webVersionS.length==3)
+ // evaluate the response from the web server
+ if (updateActionS.equals("INCREMENTAL_DOWNLOAD"))
{
- webVersion += Integer.parseInt(webVersionS[0]) * 100 * 100;
- webVersion += Integer.parseInt(webVersionS[1]) * 100;
- webVersion += Integer.parseInt(webVersionS[2]);
- }
-
- // check version number of web version against local version
- if (webVersion > localVersion)
- {
-
- // set marker for next startup
- globals.setProperty("update.newversionavailable","yes");
- s = props.getProperty("update.newversionavailable.message01");
- if (s!=null)
+ if (!silentB)
{
- globals.setProperty("update.newversionavailable.message01", s);
- globals.getInterpreter().displayText(s);
+ globals.getInterpreter().displayText("A full download ist required");
+ globals.getInterpreter().displayText("A new version "+ updateVersionS +" is available");
+ globals.getInterpreter().displayText("\n Just type update at the prompt.");
}
- else
- globals.getInterpreter().displayText("There is a new version of JMathLib available");
-
- s = props.getProperty("update.newversionavailable.message02");
- if (s!=null)
+ }
+ else if (updateActionS.equals("FULL_DOWNLOAD_REQUIRED"))
+ {
+ if (!silentB)
{
- globals.setProperty("update.newversionavailable.message02", s);
- globals.getInterpreter().displayText(s);
+ globals.getInterpreter().displayText("A full download ist required");
+ globals.getInterpreter().displayText("A new version "+ updateVersionS +" is available");
+ globals.getInterpreter().displayText("Go to www.jmathlib.de and download the latest version");
}
}
- else if (webVersion < localVersion)
+ else if (updateActionS.equals("NO_ACTION"))
{
- globals.getInterpreter().displayText("Funny! The version of JMathLib on the web is older than your local version");
+ if (!silentB)
+ globals.getInterpreter().displayText("The local version of JMathLib is up to date");
+
}
- else
+ else if (updateActionS.equals("VERSION_UNKNOWN"))
{
if (!silentB)
- {
- globals.getInterpreter().displayText("The local version of JMathLib is up to date");
+ globals.getInterpreter().displayText("The local version of JMathLib ist not recognized by the server");
- s=props.getProperty("update.uptodate.message01");
- if (s!=null)
- globals.getInterpreter().displayText(s);
-
- s=props.getProperty("update.uptodate.message02");
- if (s!=null)
- globals.getInterpreter().displayText(s);
- }
}
+ else
+ {
+ // wrong or unknown or empty "action"-command
+ globals.getInterpreter().displayText("check for updates encountered an error.");
+ }
-
- debugLine("checkForUpdates: web:" +webVersion +" local:"+ localVersion);
+ debugLine("checkForUpdates: web:" + updateVersionS +" local:"+ localVersionS);
// set current date for property "update.date.last"
Calendar cal = Calendar.getInstance();
@@ -222,21 +201,18 @@
globals.setProperty("update.date.last", checkedDate);
- // update link to primary update-site
- s= props.getProperty("update.site.primary");
- if (s!=null)
- globals.setProperty("update.site.primary",s);
+
+ // copy properties from webserver to global properties
+ Enumeration propnames = props.propertyNames();
+ while (propnames.hasMoreElements())
+ {
+ String propName = (String)propnames.nextElement();
+ String propValue = (String)props.getProperty(propName);
+ ErrorLogger.debugLine("Property: "+propName+" = "+propValue);
+ globals.setProperty(propName, propValue);
+ }
- // update link to backup update-site
- s= props.getProperty("update.site.backup");
- if (s!=null)
- globals.setProperty("update.site.backup",s);
- // update message of the day
- s= props.getProperty("message.of.the.day");
- if (s!=null)
- globals.setProperty("message.of.the.day",s);
-
}
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-15 05:12:08 UTC (rev 848)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/update.java 2009-02-15 10:20:32 UTC (rev 849)
@@ -25,7 +25,6 @@
// get local version of jmathlib
String localVersionS = globals.getProperty("jmathlib.version");
- localVersionS = localVersionS.replaceAll("/", ".");
globals.getInterpreter().displayText("current version: "+localVersionS);
@@ -33,12 +32,11 @@
globals.getInterpreter().displayText("Checking to which version an update is possible");
- // url of the update site including the request for the version
- // to update to
+ // url of the update site including the request for the version to update to
URL url = null;
try
{
- url = new URL(updateSiteS+"updates/?jmathlib_version="+localVersionS);
+ url = new URL(updateSiteS+"?jmathlib_version="+localVersionS+"&command=update");
}
catch (Exception e)
{
@@ -58,148 +56,217 @@
successB = false;
}
-
+
// Check return properties for "update-to-version"
// Update site could send a lot of properties
String updateVersionS = props.getProperty("update.toversion");
- if (updateVersionS.equals("no_update_available"))
+ String updateActionS = props.getProperty("update.action");
+
+ // reaction on the response from the update server
+ if (updateActionS.equals("VERSION_UNKNOWN"))
{
+ globals.getInterpreter().displayText("Your version of JMathLib is not known by the update server.");
+ return null;
+ }
+ else if (updateVersionS.equals("NO_UPDATE_AVAILABLE") ||
+ updateActionS.equals("NO_ACTION") )
+ {
globals.getInterpreter().displayText("No update available right now.");
return null;
}
-
- if (updateVersionS.equals("full_download_required"))
+ else if (updateActionS.equals("FULL_DOWNLOAD_REQUIRED"))
{
globals.getInterpreter().displayText("\n");
globals.getInterpreter().displayText("Full download required in order to update!");
globals.getInterpreter().displayText("Please visit www.jmathlib.de for details.");
globals.getInterpreter().displayText("\n");
+ String urlS = props.getProperty("update.full_file_url");
+ String fileS = props.getProperty("update.file_name");
+ globals.getInterpreter().displayText("url: "+urlS);
+ globals.getInterpreter().displayText("file: "+fileS);
+
+ if ((urlS==null) || (fileS==null))
+ return null;
+
+
+ // put a message box here
+
+ // open URL to file on update server
+ try
+ {
+ globals.getInterpreter().displayText("Downloading ...");
+ URL fileURL = new URL(urlS);
+ InputStream in = fileURL.openStream();
+
+ // open file on local disc
+ File file = new File(globals.getWorkingDirectory(),fileS);
+ OutputStream out = new FileOutputStream(file);
+ byte[] cbuf = new byte[4096];
+ int len = -1;
+
+ while ((len = in.read(cbuf)) != -1)
+ {
+ out.write(cbuf,0,len);
+ }
+
+ in.close();
+ out.close();
+ globals.getInterpreter().displayText("Downloading done.");
+ }
+ catch (Exception e)
+ {
+ successB = false;
+ globals.getInterpreter().displayText("update: problem downloading "+fileS);
+ }
+
+
+ // run the downloaded file
+ try
+ {
+ globals.getInterpreter().displayText("Running installer ...");
+ Runtime.getRuntime().exec(fileS);
+ globals.getInterpreter().displayText("Please exit JMathLib");
+ }
+ catch(IOException exception)
+ {
+ throwMathLibException("SystemCommand");
+ }
+
+
return null;
}
+ else if (updateActionS.equals("INCREMENTAL_DOWNLOAD"))
+ {
- globals.getInterpreter().displayText("updating to version >"+updateVersionS+"< \n");
+ globals.getInterpreter().displayText("updating to version >"+updateVersionS+"< \n");
- // download new files from server
- updateSiteS += "updates/jmathlib_" + updateVersionS + "/";
- try
- {
- url = new URL(updateSiteS);
- }
- catch (Exception e)
- {
- throwMathLibException("update: malformed url");
- successB = false;
- }
-
- BufferedReader inR = null;
- try
- {
- inR = new BufferedReader(new InputStreamReader(url.openStream()));
- String s = null;
-
- // read next line from server
- while ((s = inR.readLine()) != null )
+ // download new files from server
+ updateSiteS += "jmathlib_" + updateVersionS + "/";
+ try
{
- //getInterpreter().displayText("update "+s);
+ url = new URL(updateSiteS);
+ }
+ catch (Exception e)
+ {
+ throwMathLibException("update: malformed url");
+ successB = false;
+ }
+
+ try
+ {
+ BufferedReader inR = new BufferedReader(new InputStreamReader(url.openStream()));
+ String s = null;
- if (s.startsWith("file"))
+ // read next line from server
+ while ((s = inR.readLine()) != null )
{
- // read a file from the server and place it on the local disc
- String fileS = s.substring(5).trim();
- globals.getInterpreter().displayText("new file: >"+fileS+"<");
+ //getInterpreter().displayText("update "+s);
- // open URL to file on update server
- try
+ if (s.startsWith("file"))
{
- URL fileURL = new URL(updateSiteS+fileS);
- InputStream in = fileURL.openStream();
-
- // open file on local disc
- File file = new File(globals.getWorkingDirectory(),fileS);
- OutputStream out = new FileOutputStream(file);
-
- byte[] cbuf = new byte[4096];
- int len;
- while ((len = in.read(cbuf)) != -1)
+ // read a file from the server and place it on the local disc
+ String fileS = s.substring(5).trim();
+ globals.getInterpreter().displayText("new file: >"+fileS+"<");
+
+ // open URL to file on update server
+ try
{
- out.write(cbuf,0,len);
+ URL fileURL = new URL(updateSiteS+fileS);
+ InputStream in = fileURL.openStream();
+
+ // open file on local disc
+ File file = new File(globals.getWorkingDirectory(),fileS);
+ OutputStream out = new FileOutputStream(file);
+ byte[] cbuf = new byte[4096];
+ int len = -1;
+
+ while ((len = in.read(cbuf)) != -1)
+ {
+ out.write(cbuf,0,len);
+ }
+
+ in.close();
+ out.close();
}
+ catch (Exception e)
+ {
+ successB = false;
+ globals.getInterpreter().displayText("update: problem downloading "+fileS);
+ }
- in.close();
- out.close();
}
- catch (Exception e)
+ else if (s.startsWith("dir"))
{
- successB = false;
- globals.getInterpreter().displayText("update: problem downloading "+fileS);
+ // create a directory on the local disc
+ String dirS = s.substring(4).trim();
+ globals.getInterpreter().displayText("new directory: >"+dirS+"<");
+ try
+ {
+ File file = new File(globals.getWorkingDirectory(),dirS);
+ file.mkdir();
+ }
+ catch (Exception e)
+ {
+ successB = false;
+ globals.getInterpreter().displayText("update: problem creating directory "+dirS);
+ }
+
}
-
- }
- else if (s.startsWith("dir"))
- {
- // create a directory on the local disc
- String dirS = s.substring(4).trim();
- globals.getInterpreter().displayText("new directory: >"+dirS+"<");
- try
+ else if (s.startsWith("del"))
{
- File file = new File(globals.getWorkingDirectory(),dirS);
- file.mkdir();
+ // delete a file/directory on the local disc
+ String delS = s.substring(4).trim();
+ globals.getInterpreter().displayText("delete file/dir: >"+delS+"<");
+ try
+ {
+ File file = new File(globals.getWorkingDirectory(),delS);
+ file.delete();
+ }
+ catch (Exception e)
+ {
+ successB = false;
+ globals.getInterpreter().displayText("update: problem deleting "+delS);
+ }
}
- catch (Exception e)
+ else if (s.startsWith("prop"))
{
- successB = false;
- globals.getInterpreter().displayText("update: problem creating directory "+dirS);
+ // delete a file/directory on the local disc
+ String propS = s.substring(5).trim();
+ globals.getInterpreter().displayText("new property: >"+propS+"<");
+ String[] p = propS.split("=");
+ globals.setProperty(p[0],p[1]);
}
-
- }
- else if (s.startsWith("del"))
- {
- // delete a file/directory on the local disc
- String delS = s.substring(4).trim();
- globals.getInterpreter().displayText("delete file/dir: >"+delS+"<");
- try
+ else
{
- File file = new File(globals.getWorkingDirectory(),delS);
- file.delete();
+ // empty line or unknown command or comment
}
- catch (Exception e)
- {
- successB = false;
- globals.getInterpreter().displayText("update: problem deleting "+delS);
- }
+
+ // in case something went wrong terminate
+ if (!successB)
+ break;
+
}
- else if (s.startsWith("prop"))
- {
- // delete a file/directory on the local disc
- String propS = s.substring(5).trim();
- globals.getInterpreter().displayText("new property: >"+propS+"<");
- String[] p = propS.split("=");
- globals.setProperty(p[0],p[1]);
- }
- else
- {
- // empty line or unknown command or comment
- }
-
- // in case something went wrong terminate
- if (!successB)
- break;
-
+
}
+ catch (Exception e)
+ {
+ throwMathLibException("update: open or reading stream");
+ }
+
+
+ }
+ else
+ {
+ throwMathLibException("update: unknown action");
+ }
- }
- catch (Exception e)
- {
- throwMathLibException("update: open or reading stream");
- }
-
-
// notifiy user
if (!successB)
globals.getInterpreter().displayText("\n Update was not successful. Repeat again later on or inform the admin.");
- return null;
+ return null;
+
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-15 05:12:15
|
Revision: 848
http://mathlib.svn.sourceforge.net/mathlib/?rev=848&view=rev
Author: st_mueller
Date: 2009-02-15 05:12:08 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
bugfix
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-02-12 21:16:48 UTC (rev 847)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-02-15 05:12:08 UTC (rev 848)
@@ -22,7 +22,7 @@
{
String text = "";
- ResourceBundle bundle = ResourceBundle.getBundle("jmathLib.resourcebundles.ErrorBundle");
+ ResourceBundle bundle = ResourceBundle.getBundle("jmathlib.resourcebundles.ErrorBundle");
text = bundle.getString(Integer.toString(errorCode));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-12 21:16:53
|
Revision: 847
http://mathlib.svn.sourceforge.net/mathlib/?rev=847&view=rev
Author: st_mueller
Date: 2009-02-12 21:16:48 +0000 (Thu, 12 Feb 2009)
Log Message:
-----------
added some comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/ExternalFunction.java
JMathLib/trunk/src/jmathlib/core/functions/ExternalFunctionClassLoader.java
JMathLib/trunk/src/jmathlib/core/functions/FileFunctionLoader.java
JMathLib/trunk/src/jmathlib/core/functions/Function.java
JMathLib/trunk/src/jmathlib/core/functions/FunctionLoader.java
JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
JMathLib/trunk/src/jmathlib/core/functions/FunctionParser.java
JMathLib/trunk/src/jmathlib/core/functions/FunctionPathBroker.java
JMathLib/trunk/src/jmathlib/core/functions/InternalFunction.java
JMathLib/trunk/src/jmathlib/core/functions/MFileLoader.java
JMathLib/trunk/src/jmathlib/core/functions/ReflectionFunctionCall.java
JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/ExternalFunction.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/ExternalFunction.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/ExternalFunction.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
/**Base class for all external function classes*/
Modified: JMathLib/trunk/src/jmathlib/core/functions/ExternalFunctionClassLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/ExternalFunctionClassLoader.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/ExternalFunctionClassLoader.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import java.io.IOException;
Modified: JMathLib/trunk/src/jmathlib/core/functions/FileFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FileFunctionLoader.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/FileFunctionLoader.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import java.io.File;
Modified: JMathLib/trunk/src/jmathlib/core/functions/Function.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/Function.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/Function.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionLoader.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionLoader.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import java.util.*;
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.tokens.FunctionToken;
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionParser.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionParser.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionParser.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionPathBroker.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionPathBroker.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionPathBroker.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import java.util.ArrayList;
Modified: JMathLib/trunk/src/jmathlib/core/functions/InternalFunction.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/InternalFunction.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/InternalFunction.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.GlobalValues;
Modified: JMathLib/trunk/src/jmathlib/core/functions/MFileLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/MFileLoader.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/MFileLoader.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/core/functions/ReflectionFunctionCall.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/ReflectionFunctionCall.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/ReflectionFunctionCall.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
//import MathLib.Tokens.FunctionToken;
Modified: JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/UserFunction.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.*;
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-12 21:13:59 UTC (rev 846)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-12 21:16:48 UTC (rev 847)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.functions;
import jmathlib.core.interpreter.*;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-12 21:14:03
|
Revision: 846
http://mathlib.svn.sourceforge.net/mathlib/?rev=846&view=rev
Author: st_mueller
Date: 2009-02-12 21:13:59 +0000 (Thu, 12 Feb 2009)
Log Message:
-----------
added some comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-02-12 21:13:15 UTC (rev 845)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Errors.java 2009-02-12 21:13:59 UTC (rev 846)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.interpreter;
import java.util.*;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-12 21:13:19
|
Revision: 845
http://mathlib.svn.sourceforge.net/mathlib/?rev=845&view=rev
Author: st_mueller
Date: 2009-02-12 21:13:15 +0000 (Thu, 12 Feb 2009)
Log Message:
-----------
added some comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java
JMathLib/trunk/src/jmathlib/core/interpreter/VariableList.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-02-12 21:12:38 UTC (rev 844)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-02-12 21:13:15 UTC (rev 845)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.interpreter;
import java.io.*;
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java 2009-02-12 21:12:38 UTC (rev 844)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/Variable.java 2009-02-12 21:13:15 UTC (rev 845)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.interpreter;
import jmathlib.core.tokens.*;
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/VariableList.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/VariableList.java 2009-02-12 21:12:38 UTC (rev 844)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/VariableList.java 2009-02-12 21:13:15 UTC (rev 845)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.interpreter;
import jmathlib.core.tokens.*;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-12 21:12:46
|
Revision: 844
http://mathlib.svn.sourceforge.net/mathlib/?rev=844&view=rev
Author: st_mueller
Date: 2009-02-12 21:12:38 +0000 (Thu, 12 Feb 2009)
Log Message:
-----------
added some comments
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int16NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int32NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int64NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int8NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/SingleNumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt16NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt32NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt64NumberToken.java
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt8NumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int16NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int16NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int16NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int32NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int32NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int32NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int64NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int64NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int64NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int8NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int8NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/Int8NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/SingleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/SingleNumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/SingleNumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.tokens.NumberToken;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt16NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt16NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt16NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt32NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt32NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt32NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt64NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt64NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt64NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.tokens.NumberToken;
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt8NumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt8NumberToken.java 2009-02-11 22:45:39 UTC (rev 843)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/UInt8NumberToken.java 2009-02-12 21:12:38 UTC (rev 844)
@@ -1,3 +1,11 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2005-2009
+ */
package jmathlib.core.tokens.numbertokens;
import jmathlib.core.interpreter.ErrorLogger;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-11 22:45:46
|
Revision: 843
http://mathlib.svn.sourceforge.net/mathlib/?rev=843&view=rev
Author: st_mueller
Date: 2009-02-11 22:45:39 +0000 (Wed, 11 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
Modified: JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java 2009-02-10 20:40:16 UTC (rev 842)
+++ JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java 2009-02-11 22:45:39 UTC (rev 843)
@@ -15,11 +15,7 @@
import jmathlib.core.interfaces.MathLibOutput;
import jmathlib.core.interpreter.*;
-/**
- *
- * @author stefan
- *
- */
+/** a basic servlet showing the usage of JMathLib */
public class JMathLibServlet extends HttpServlet implements MathLibOutput {
private String dispText ="";
@@ -47,18 +43,7 @@
// tree and not have any harmful side effects.
- //URL url = HelloWorldExample.class.getResourceAsStream("webFunctionsList.dat");
- InputStream in = JMathLibServlet.class.getResourceAsStream("webFunctionsList.dat");
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
-
- // read each line of the functions list
- String line = null;
- while ((line = br.readLine()) != null)
- {
- System.out.println("read =" + line);
- }
-
-
+ // open instance of JMathLib
Interpreter jml = new Interpreter(false);
jml.setOutputPanel(this);
@@ -70,10 +55,7 @@
jml.executeExpression("dir");
- //String c =
- //ClassLoader.getSystemResourceAsStream(name)
-
String s = jml.getString("a");
out.println("<pre>"+s+"</pre>");
@@ -89,6 +71,7 @@
}
/**
+ * catch text from jmathlib for later display
* @param text
*/
public void displayText(String text)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-10 20:40:19
|
Revision: 842
http://mathlib.svn.sourceforge.net/mathlib/?rev=842&view=rev
Author: st_mueller
Date: 2009-02-10 20:40:16 +0000 (Tue, 10 Feb 2009)
Log Message:
-----------
first servlet
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/ui/servlet/
JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
Added: JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/ui/servlet/JMathLibServlet.java 2009-02-10 20:40:16 UTC (rev 842)
@@ -0,0 +1,101 @@
+/*
+ * This file is part or JMathLib
+ *
+ * Check it out at http://www.jmathlib.de
+ *
+ * Author:
+ * (c) 2009 st...@he...
+ */
+package jmathlib.ui.servlet;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import jmathlib.core.interfaces.MathLibOutput;
+import jmathlib.core.interpreter.*;
+
+/**
+ *
+ * @author stefan
+ *
+ */
+public class JMathLibServlet extends HttpServlet implements MathLibOutput {
+
+ private String dispText ="";
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = "JMathLib as a servlet";
+
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // note that all links are created to be relative. this
+ // ensures that we can move the web application that this
+ // servlet belongs to to a different place in the url
+ // tree and not have any harmful side effects.
+
+
+ //URL url = HelloWorldExample.class.getResourceAsStream("webFunctionsList.dat");
+ InputStream in = JMathLibServlet.class.getResourceAsStream("webFunctionsList.dat");
+ BufferedReader br = new BufferedReader(new InputStreamReader(in));
+
+ // read each line of the functions list
+ String line = null;
+ while ((line = br.readLine()) != null)
+ {
+ System.out.println("read =" + line);
+ }
+
+
+ Interpreter jml = new Interpreter(false);
+ jml.setOutputPanel(this);
+
+ ErrorLogger.setDebug(true);
+
+ jml.executeExpression("a='helloyou'");
+
+ jml.executeExpression("aa=class(a)");
+
+ jml.executeExpression("dir");
+
+ //String c =
+
+ //ClassLoader.getSystemResourceAsStream(name)
+
+ String s = jml.getString("a");
+ out.println("<pre>"+s+"</pre>");
+
+ String ss = jml.getString("aa");
+ out.println("<pre>"+ss+"</pre>");
+
+ out.println("<pre>"+dispText+"</pre>");
+ dispText="";
+
+ out.println("<h1>" + title + "</h1>");
+ out.println("</body>");
+ out.println("</html>");
+ }
+
+ /**
+ * @param text
+ */
+ public void displayText(String text)
+ {
+ dispText += text;
+ }
+}
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-10 20:24:51
|
Revision: 841
http://mathlib.svn.sourceforge.net/mathlib/?rev=841&view=rev
Author: st_mueller
Date: 2009-02-10 20:24:43 +0000 (Tue, 10 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2009-02-10 20:19:03 UTC (rev 840)
+++ JMathLib/trunk/ChangeLog.txt 2009-02-10 20:24:43 UTC (rev 841)
@@ -9,6 +9,9 @@
---- HISTORY ------------------------------------------------------------------
2009/02/xx stefan:
+2009/02/10 stefan: added libs/servlet-api.jar in order to create a servlet
+ for tomcat
+
2009/02/08 stefan: removed the applet-parameter from Interpreter(..) and
various other classes. Also changed class/file-loading
in applet (!standalone) mode
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-10 20:19:09
|
Revision: 840
http://mathlib.svn.sourceforge.net/mathlib/?rev=840&view=rev
Author: st_mueller
Date: 2009-02-10 20:19:03 +0000 (Tue, 10 Feb 2009)
Log Message:
-----------
servlet api for Tomcat
Added Paths:
-----------
JMathLib/trunk/libs/servlet-api.jar
Added: JMathLib/trunk/libs/servlet-api.jar
===================================================================
(Binary files differ)
Property changes on: JMathLib/trunk/libs/servlet-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-08 17:58:07
|
Revision: 839
http://mathlib.svn.sourceforge.net/mathlib/?rev=839&view=rev
Author: st_mueller
Date: 2009-02-08 17:58:05 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
removed applet-parameter from Interpreter-constructor
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-02-08 17:51:01 UTC (rev 838)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2009-02-08 17:58:05 UTC (rev 839)
@@ -12,11 +12,12 @@
/**Class for storing and managing the functions being used*/
public class FunctionManager {
- class SystemFileFunctionLoader extends FileFunctionLoader {
- SystemFileFunctionLoader(File _functionDir, boolean _traverseChildren) {
- super(_functionDir, _traverseChildren, true);
+ class SystemFileFunctionLoader extends FileFunctionLoader {
+ SystemFileFunctionLoader(File _functionDir, boolean _traverseChildren) {
+ super(_functionDir, _traverseChildren, true);
+ }
}
- }
+
// indicates if FunctionManager is running in an application or an applet
private boolean runningStandalone;
@@ -26,20 +27,12 @@
// flag for caching of p files
boolean pFileCachingEnabledB = false;
- /*pointer to applet structure. Value is only unequal null if MathLib runs
- inside a web-browser */
- Applet applet = null;
-
- // loader for m files via the web
- WebFunctionLoader webFunctionLoader;
-
/**Creates the function manager and defines any internal functions
if this is an application then it creates a class loader to load external functions
@param runningStandalone = true if the program is running as an application*/
- public FunctionManager(boolean _runningStandalone, Applet _applet) {
+ public FunctionManager(boolean _runningStandalone) { //, Applet _applet) {
runningStandalone = _runningStandalone;
- applet = _applet;
if (runningStandalone) {
//Add the predefined (system) function loader for the current directory.
@@ -68,8 +61,10 @@
}
}
} else {
- System.out.println("web:"+applet);
- functionLoaders.add(new WebFunctionLoader(applet.getCodeBase(), ""));
+ System.out.println("web:"); //+applet);
+ //functionLoaders.add(new WebFunctionLoader(applet.getCodeBase(), ""));
+ //functionLoaders.add(new WebFunctionLoader(null, ""));
+ functionLoaders.add(new WebFunctionLoader());
}
}
@@ -189,36 +184,63 @@
}
}
- /** return whether of not caching of p-files is enabled of not
- *
+ /**
+ * return whether of not caching of p-files is enabled of not
* @return status of caching p-files
*/
public boolean getPFileCaching() {
return pFileCachingEnabledB;
}
+ /**
+ *
+ * @return
+ */
public int getFunctionLoaderCount() {
return functionLoaders.size();
}
+ /**
+ *
+ * @param index
+ * @return
+ */
public FunctionLoader getFunctionLoader(int index) {
return (FunctionLoader) functionLoaders.elementAt(index);
}
+ /**
+ *
+ * @param loader
+ * @return
+ */
public boolean removeFunctionLoader(FunctionLoader loader) {
if (loader.isSystemLoader())
throw new IllegalArgumentException("Cannot remove a System Function Loader");
return functionLoaders.remove(loader);
}
+ /**
+ *
+ * @param loader
+ * @return
+ */
public boolean addFunctionLoader(FunctionLoader loader) {
return functionLoaders.add(loader);
}
+ /**
+ *
+ * @param index
+ * @param loader
+ */
public void addFunctionLoaderAt(int index, FunctionLoader loader) {
functionLoaders.add(index, loader);
}
+ /**
+ *
+ */
public void clearCustomFunctionLoaders() {
Iterator itr = functionLoaders.iterator();
while (itr.hasNext()) {
@@ -228,6 +250,10 @@
}
}
+ /**
+ *
+ * @param path
+ */
public void setWorkingDirectory(File path) {
if (runningStandalone) {
FileFunctionLoader l = (FileFunctionLoader) functionLoaders.get(0);
@@ -235,6 +261,10 @@
}
}
+ /**
+ *
+ * @return
+ */
public File getWorkingDirectory() {
if (runningStandalone) {
FileFunctionLoader l = (FileFunctionLoader) functionLoaders.get(0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-08 17:51:11
|
Revision: 838
http://mathlib.svn.sourceforge.net/mathlib/?rev=838&view=rev
Author: st_mueller
Date: 2009-02-08 17:51:01 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2009-02-08 17:47:57 UTC (rev 837)
+++ JMathLib/trunk/ChangeLog.txt 2009-02-08 17:51:01 UTC (rev 838)
@@ -9,6 +9,21 @@
---- HISTORY ------------------------------------------------------------------
2009/02/xx stefan:
+2009/02/08 stefan: removed the applet-parameter from Interpreter(..) and
+ various other classes. Also changed class/file-loading
+ in applet (!standalone) mode
+
+2009/02/02 stefan: added support for a++ and 5++
+2009/02/02 stefan: added support for a-- and 5--
+2009/02/02 stefan: added support for a+=5 -> a=a+5
+2009/02/02 stefan: added support for a-=5 -> a=a-5
+2009/02/02 stefan: added support for a*=5 -> a=a*5
+2009/02/02 stefan: added support for a/=5 -> a=a/5
+
+2009/02/01 stefan: added a directory for temporary file /tmp
+ changed the doc-build in order to facilitate the /tmp
+ directory.
+
2009/02/01 stefan: Added "cut","paste","copy" to AWT GUI.
Added "ctrl-x","ctrl-v","ctrl-c" to AWT GUI.
2009/02/01 stefan: Added a directory for temporary file /tmp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-08 17:48:07
|
Revision: 837
http://mathlib.svn.sourceforge.net/mathlib/?rev=837&view=rev
Author: st_mueller
Date: 2009-02-08 17:47:57 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
removed applet-parameter from Interpreter-constructor
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-08 17:11:10 UTC (rev 836)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-08 17:47:57 UTC (rev 837)
@@ -11,24 +11,25 @@
{
boolean pFileCachingEnabledB = false;
- private URL codeBase;
+
private String directory;
// paths to external function for applet usage
private Vector functionListV = new Vector(30);
-
/**Default constructor*/
- public WebFunctionLoader(URL _codeBase, String _directory)
+ public WebFunctionLoader()
{
- codeBase = _codeBase;
- directory = _directory;
try
{
- System.out.println("WebFunctionLoader: new url"+ codeBase.toString());
- URL url = new URL(codeBase, "webFunctionsList.dat");
- InputStream in = url.openStream();
+ //if (codeBase!=null)
+ // System.out.println("WebFunctionLoader: new url"+ codeBase.toString());
+ //URL url = new URL(codeBase, "webFunctionsList.dat");
+ //InputStream in = url.openStream();
+
+ // load list relative to the path of THIS class.
+ InputStream in = WebFunctionLoader.class.getResourceAsStream("../../../webFunctionsList.dat");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
// read each line of the functions list
@@ -51,10 +52,10 @@
*
* @return
*/
- public URL getCodeBase()
- {
- return codeBase;
- }
+ //public URL getCodeBase()
+ //{
+ // return codeBase;
+ //}
/**
*
@@ -146,12 +147,16 @@
// open file and read m-file line by line
try
{
- ErrorLogger.debugLine("WebFunctionLoader: "+codeBase+" "+directory+"/"+functionName+".m");
+ ErrorLogger.debugLine("WebFunctionLoader: "+directory+"/"+functionName+".m");
+ //ErrorLogger.debugLine("WebFunctionLoader: "+codeBase+" "+directory+"/"+functionName+".m");
//URL url = new URL(codeBase, directory+"/"+functionName+".m");
- URL url = new URL(codeBase, functionPath);
+ //URL url = new URL(codeBase, functionPath);
+ //InputStream in = url.openStream();
- InputStream in = url.openStream();
+ // load class or resource relative to the path of THIS class.
+ InputStream in = WebFunctionLoader.class.getResourceAsStream("../../../"+functionPath);
BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
+
String line;
while ((line = inReader.readLine()) != null)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-08 17:11:15
|
Revision: 836
http://mathlib.svn.sourceforge.net/mathlib/?rev=836&view=rev
Author: st_mueller
Date: 2009-02-08 17:11:10 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
speed up the code
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/ErrorLogger.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/ErrorLogger.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/ErrorLogger.java 2009-02-08 17:04:20 UTC (rev 835)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/ErrorLogger.java 2009-02-08 17:11:10 UTC (rev 836)
@@ -11,18 +11,20 @@
import java.io.*;
/**write error messages + debug information to a log file*/
-public class ErrorLogger extends RootObject
+public class ErrorLogger
{
- /**stores the size of indent for the next line*/
- private static int indentSize = 0;
+ /** indent string */
+ private static String indentS = "";
- /**flags wether text should be indented*/
- private static boolean displayIndent = false;
-
/**flag for logging mode of JMathLib*/
private static boolean debugB = false;
- /**@return the setting of the debug flag*/
+ /** handle to log file */
+ private static RandomAccessFile output = null;
+
+ /**
+ * @return the setting of the debug flag
+ */
public static boolean getDebug()
{
return debugB;
@@ -46,17 +48,22 @@
if(debugB)
{
- //if(displayIndent)
- // text = text + ";" + indentSize;
-
- for (int i=1; i<indentSize; i++) text= " "+text;
-
+ //for (int i=1; i<indentSize; i++) text= " "+text;
+ //text = new String( new byte[indentSize]) + text;
+ //text = indentS + text;
+
try
{
- RandomAccessFile output = new RandomAccessFile("JMathLib.log", "rw");
- output.seek(output.length());
- output.writeBytes(text + "\n");
- output.close();
+ // open log file only if it is not yet open
+ if (output == null)
+ {
+ System.out.println("ERROR LOGGER: OPENING FILE");
+ output = new RandomAccessFile("JMathLib.log", "rw");
+ output.seek(output.length());
+ }
+
+ //write log message
+ output.writeBytes(indentS + text + "\n");
}
catch(IOException error)
{
@@ -67,45 +74,70 @@
System.out.println("ERROR LOGGER: SecurityException");
}
- System.out.println(text);
+ // write log message to display
+ System.out.println(indentS + text);
}
}
+
+ /**
+ * Will release the file handle to the logfile
+ * @throws Throwable
+ */
+ public void finalize() throws Throwable
+ {
+ try
+ {
+ System.out.println("ERROR LOGGER FINALIZE");
+ output.close();
+ }
+ finally
+ {
+ super.finalize();
+ }
+ }
- /**display an integer to the standard output
- @param value = the number to display*/
+ /**
+ * display an integer to the standard output
+ * @param value = the number to display
+ */
public static void debugLine(int value)
{
debugLine(new Integer(value).toString());
}
- /**display a real value to the standard output
- @param value = the number to display*/
+ /**
+ * display a real value to the standard output
+ * @param value = the number to display
+ */
public static void debugLine(double value)
{
debugLine(new Double(value).toString());
}
- /**Increases the level of indent*/
+ /**
+ * Increases the level of indent
+ */
public static void increaseIndent()
{
- indentSize++;
+ indentS += " ";
}
- /**Decreases the level of indent*/
+ /**
+ * Decreases the level of indent
+ */
public static void decreaseIndent()
{
- if (indentSize>=0) indentSize--;
+ if (indentS.length()==0)
+ return;
+
+ indentS = indentS.substring(0, indentS.length()-1);
}
- /**Sets whether the indent value should be displayed
- @param _displayIndent = true if indent should be displayed*/
- public static void setDisplayIndent(boolean _displayIndent)
- {
- displayIndent = _displayIndent;
- }
-
- /**Prints the current execution stack trace, the list of functions that have been called up to the current one.
- @param message = The message to display before the stack trace*/
+ /**
+ * Prints the current execution stack trace, the list of
+ * functions that have been called up to the current one.
+ * @param message = The message to display before the stack trace
+ */
public static void displayStackTrace(String message)
{
new Exception(message).printStackTrace();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|