Thread: [Mathlib-commitlog] SF.net SVN: mathlib:[580] JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI .ja
Status: Beta
Brought to you by:
st_mueller
From: <st_...@us...> - 2008-12-29 21:00:55
|
Revision: 580 http://mathlib.svn.sourceforge.net/mathlib/?rev=580&view=rev Author: st_mueller Date: 2008-12-29 21:00:45 +0000 (Mon, 29 Dec 2008) Log Message: ----------- added more bugfixing and code cleanup Modified Paths: -------------- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java =================================================================== --- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2008-12-29 20:58:12 UTC (rev 579) +++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2008-12-29 21:00:45 UTC (rev 580) @@ -37,17 +37,17 @@ /**Temporary store for function code*/ String functionCode; - + /**Construct the applet*/ public JMathLibGUI() { - container = this; - runningStandalone = false; + container = this; } /**Initialize the applet*/ public void init() { + container.setSize(700,400); layout = new BorderLayout(); @@ -58,26 +58,25 @@ container.add("Center", answer); - interpreter = new Interpreter(runningStandalone, this); + interpreter = new Interpreter(false, this); interpreter.setOutputPanel(answer); interpreter.executeExpression("startup"); - // check if there is an initial command to send to the interpreter - String startWithS = getParameter("startup"); - if (startWithS!=null) - interpreter.executeExpression(startWithS); - // get parameter for background color (e.g. ff00cc) try { Color color = new Color(Integer.parseInt(this.getParameter("bgcolor"),16)); - if (color!=null) answer.setBackground(color);} + if (color!=null) + answer.setBackground(color); + } catch (NumberFormatException e){ } // get parameter for foreground color (e.g. ffddff) try { Color color = new Color(Integer.parseInt(this.getParameter("fgcolor"),16)); - if (color!=null) answer.setForeground(color);} + if (color!=null) + answer.setForeground(color); + } catch (NumberFormatException e){ } } @@ -88,48 +87,17 @@ answer.displayPrompt(); answer.requestFocus(); - } + // check if there is an initial command to send to the interpreter + String startWithS = getParameter("startup"); + if (startWithS!=null) + interpreter.executeExpression(startWithS); - /**Main method - allow the class to be used as an applicatoin*/ - public static void main(String[] args) - { - final JMathLibGUI applet = new JMathLibGUI(); + answer.displayPrompt(); + answer.requestFocus(); - Frame frame = new Frame(); - frame.setTitle("JMathLib"); + } - // add image to window - Toolkit tk = Toolkit.getDefaultToolkit(); - Image icon = tk.getImage("MathLib/GUI/smalllogo.gif"); - if (icon != null) - frame.setIconImage(icon); - - - //create an anomynous inner class to handle window closing - frame.addWindowListener(new WindowAdapter() - { - public void windowClosing(WindowEvent e) - { - applet.close(); - } - }); - - applet.runningStandalone = true; - applet.container = frame; - applet.init(); - - //Get the size of the screen - Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); - - //position the frame in the centre of the screen - frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2); - - frame.setVisible(true); - - //start the applet - applet.start(); - } - + /**Interpret the last command line entered*/ public void interpretLine(String line) { @@ -141,8 +109,8 @@ /**Function called when the gui is being close*/ public void close() { - interpreter.save(); + //interpreter.save(); - System.exit(0); + //System.exit(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 16:46:19
|
Revision: 834 http://mathlib.svn.sourceforge.net/mathlib/?rev=834&view=rev Author: st_mueller Date: 2009-02-08 16:46:13 +0000 (Sun, 08 Feb 2009) Log Message: ----------- removed applet-parameter from Interpreter-constructor Modified Paths: -------------- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java =================================================================== --- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-02-08 16:45:39 UTC (rev 833) +++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-02-08 16:46:13 UTC (rev 834) @@ -58,7 +58,7 @@ container.add("Center", answer); - interpreter = new Interpreter(false, this); + interpreter = new Interpreter(false); interpreter.setOutputPanel(answer); interpreter.executeExpression("startup"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <st_...@us...> - 2009-03-01 12:16:20
|
Revision: 891 http://mathlib.svn.sourceforge.net/mathlib/?rev=891&view=rev Author: st_mueller Date: 2009-03-01 12:16:10 +0000 (Sun, 01 Mar 2009) Log Message: ----------- code cleanup Modified Paths: -------------- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java =================================================================== --- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-02-26 16:44:03 UTC (rev 890) +++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-03-01 12:16:10 UTC (rev 891) @@ -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.ui.applet; import jmathlib.core.interpreter.Interpreter; @@ -9,11 +17,11 @@ import java.awt.event.*; import java.applet.*; -/**Rudimentary interface used to test the program*/ +/**applet version of JMathLib*/ public class JMathLibGUI extends Applet implements RemoteAccesible, JMathLibOutput { /**Flag storing whether the program is running as an application or an applet*/ - boolean runningStandalone; + //boolean runningStandalone; /**The area used for user input and where the answers are displayed*/ Console answer; @@ -25,10 +33,10 @@ Container container; /**string used for defining user functions*/ - String function; + //String function; /**Flag storing whether each line input should be executed straight away*/ - boolean interactiveMode = true; + //boolean interactiveMode = true; /**Layout manager used for the components*/ BorderLayout layout; @@ -37,24 +45,27 @@ WindowListener handler; /**Temporary store for function code*/ - String functionCode; + //String functionCode; - /**Construct the applet*/ + /** + * Constructor of the applet + */ public JMathLibGUI() { container = this; } - /**Initialize the applet*/ + /** + * Initialize the applet + */ public void init() { - + container.setSize(700,400); layout = new BorderLayout(); container.setLayout(layout); - //answer = new Console((MathLib.Interfaces.RemoteAccesible)this); answer = new Console(this); container.add("Center", answer); @@ -80,7 +91,7 @@ } catch (NumberFormatException e){ } - } + } // end init /** * display text @@ -99,7 +110,9 @@ } - /**start the applet*/ + /** + * start the applet + */ public void start() { answer.displayPrompt(); @@ -116,7 +129,9 @@ } - /**Interpret the last command line entered*/ + /** + * Interpret the last command line entered + */ public void interpretLine(String line) { String answerString = interpreter.executeExpression(line); @@ -124,11 +139,11 @@ answer.displayPrompt(); } - /**Function called when the gui is being close*/ + /** + * Function called when the GUI is being close + */ public void close() { - //interpreter.save(); - - //System.exit(0); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <st_...@us...> - 2009-03-01 13:11:24
|
Revision: 894 http://mathlib.svn.sourceforge.net/mathlib/?rev=894&view=rev Author: st_mueller Date: 2009-03-01 13:11:14 +0000 (Sun, 01 Mar 2009) Log Message: ----------- renamed RemoteAccesible.java to RemoteAccessible.java Modified Paths: -------------- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java =================================================================== --- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-03-01 13:10:38 UTC (rev 893) +++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2009-03-01 13:11:14 UTC (rev 894) @@ -9,7 +9,7 @@ package jmathlib.ui.applet; import jmathlib.core.interpreter.Interpreter; -import jmathlib.core.interfaces.RemoteAccesible; +import jmathlib.core.interfaces.RemoteAccessible; import jmathlib.core.interfaces.JMathLibOutput; import jmathlib.ui.common.Console; @@ -18,7 +18,7 @@ import java.applet.*; /**applet version of JMathLib*/ -public class JMathLibGUI extends Applet implements RemoteAccesible, JMathLibOutput +public class JMathLibGUI extends Applet implements RemoteAccessible, JMathLibOutput { /**Flag storing whether the program is running as an application or an applet*/ //boolean runningStandalone; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |