[Mathlib-commitlog] SF.net SVN: mathlib:[699] JMathLib/trunk/src/jmathlib/toolbox/jmathlib/ graphic
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-20 20:18:51
|
Revision: 699
http://mathlib.svn.sourceforge.net/mathlib/?rev=699&view=rev
Author: st_mueller
Date: 2009-01-20 20:18:47 +0000 (Tue, 20 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/cla.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/clf.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/close.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/figure.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gca.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gcf.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/grid.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/hold.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/cla.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/cla.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/cla.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,30 +3,31 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class cla extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) >1)
throwMathLibException("cla: number of arguments <=1");
// get figure number
- double n = getGraphicsManager().getCurrentFigureNumber();
+ double n = globals.getGraphicsManager().getCurrentFigureNumber();
// in case n>1 there is no current figure, -> create one
if (n<1)
{
// create figure
- getGraphicsManager().createNewFigure();
+ globals.getGraphicsManager().createNewFigure();
// get figure number again (should be at least "1")
- n = getGraphicsManager().getCurrentFigureNumber();
+ n = globals.getGraphicsManager().getCurrentFigureNumber();
}
- getGraphicsManager().getCurrentFigure().getCurrentAxes().clearAxes();
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().clearAxes();
return null;
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/clf.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/clf.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/clf.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -1,32 +1,32 @@
package jmathlib.toolbox.jmathlib.graphics;
import jmathlib.core.tokens.*;
-import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class clf extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) >1)
throwMathLibException("clf: number of arguments <=1");
// get figure number
- double n = getGraphicsManager().getCurrentFigureNumber();
+ double n = globals.getGraphicsManager().getCurrentFigureNumber();
// in case n>1 there is no current figure, -> create one
if (n<1)
{
// create figure
- getGraphicsManager().createNewFigure();
+ globals.getGraphicsManager().createNewFigure();
// get figure number again (should be at least "1")
- n = getGraphicsManager().getCurrentFigureNumber();
+ n = globals.getGraphicsManager().getCurrentFigureNumber();
}
- getGraphicsManager().getCurrentFigure().clearFigure();
+ globals.getGraphicsManager().getCurrentFigure().clearFigure();
return null;
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/close.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/close.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/close.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,12 +3,13 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for closing figures*/
public class close extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//ErrorLogger.debugLine("figure evaluate");
@@ -16,8 +17,8 @@
if (operands==null)
{
- int i = getGraphicsManager().getCurrentFigureNumber();
- getGraphicsManager().removeFigure(i);
+ int i = globals.getGraphicsManager().getCurrentFigureNumber();
+ globals.getGraphicsManager().removeFigure(i);
}
else
@@ -30,10 +31,10 @@
int i = (int)(((DoubleNumberToken)operands[0]).getReValues()[0][0]);
- getGraphicsManager().removeFigure(i);
+ globals.getGraphicsManager().removeFigure(i);
}
- getGraphicsManager().getCurrentFigure().repaint();
+ globals.getGraphicsManager().getCurrentFigure().repaint();
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/figure.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/figure.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/figure.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,12 +3,13 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**An external function for 2 dimensional plots*/
public class figure extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//ErrorLogger.debugLine("figure evaluate");
@@ -16,14 +17,14 @@
if (operands==null)
{
// figure called with no arguments
- getGraphicsManager().createNewFigure();
+ globals.getGraphicsManager().createNewFigure();
}
else
{
if (getNArgIn(operands) == 0)
- getGraphicsManager().createNewFigure();
+ globals.getGraphicsManager().createNewFigure();
if (getNArgIn(operands) != 1)
throwMathLibException("figure: number of arguments != 1");
@@ -33,10 +34,10 @@
int figureNumber = (int)(((DoubleNumberToken)operands[0]).getReValues()[0][0]);
- getGraphicsManager().createNewFigure(figureNumber);
+ globals.getGraphicsManager().createNewFigure(figureNumber);
}
- getGraphicsManager().getCurrentFigure().repaint();
+ globals.getGraphicsManager().getCurrentFigure().repaint();
return null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gca.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gca.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gca.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,18 +3,19 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class gca extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 0)
throwMathLibException("gca: number of arguments != 0");
// get handle to axes
- double n = getGraphicsManager().getCurrentFigure().getCurrentAxes().getHandle();
+ double n = globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().getHandle();
return new DoubleNumberToken(n);
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gcf.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gcf.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/gcf.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,18 +3,19 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
public class gcf extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if (getNArgIn(operands) != 0)
throwMathLibException("gcf: number of arguments != 0");
// get figure number
- double n = getGraphicsManager().getCurrentFigure().getHandle();
+ double n = globals.getGraphicsManager().getCurrentFigure().getHandle();
return new DoubleNumberToken(n);
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/grid.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/grid.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/grid.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,12 +3,13 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**Add a grid to the current axes*/
public class grid extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//ErrorLogger.debugLine("grid evaluate");
@@ -41,11 +42,11 @@
}
// switch grid on/off
- getGraphicsManager().getCurrentFigure().getCurrentAxes().set("XGrid",new Boolean(value));
- getGraphicsManager().getCurrentFigure().getCurrentAxes().set("YGrid",new Boolean(value));
- getGraphicsManager().getCurrentFigure().getCurrentAxes().set("ZGrid",new Boolean(value));
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().set("XGrid",new Boolean(value));
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().set("YGrid",new Boolean(value));
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().set("ZGrid",new Boolean(value));
- getGraphicsManager().getCurrentFigure().repaint();
+ globals.getGraphicsManager().getCurrentFigure().repaint();
return null;
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/hold.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/hold.java 2009-01-20 20:17:23 UTC (rev 698)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/graphics/hold.java 2009-01-20 20:18:47 UTC (rev 699)
@@ -3,13 +3,14 @@
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
/**Holds the current axes. All subsequent uses of plot will accumulate in
this axes */
public class hold extends ExternalFunction
{
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
//ErrorLogger.debugLine("hold evaluate");
@@ -42,9 +43,9 @@
// switch hold on/off
if (value)
- getGraphicsManager().getCurrentFigure().getCurrentAxes().set("NextPlot","add");
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().set("NextPlot","add");
else
- getGraphicsManager().getCurrentFigure().getCurrentAxes().set("NextPlot","replace");
+ globals.getGraphicsManager().getCurrentFigure().getCurrentAxes().set("NextPlot","replace");
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|