[Mathlib-commitlog] SF.net SVN: mathlib:[558] JMathLib/trunk/src/jmathlib/core/graphics/axes/ coreO
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2008-12-26 13:06:52
|
Revision: 558
http://mathlib.svn.sourceforge.net/mathlib/?rev=558&view=rev
Author: st_mueller
Date: 2008-12-26 13:06:40 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
fixed problem with plot3
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/graphics/axes/coreObjects/LineObject.java
Modified: JMathLib/trunk/src/jmathlib/core/graphics/axes/coreObjects/LineObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/graphics/axes/coreObjects/LineObject.java 2008-12-26 13:03:25 UTC (rev 557)
+++ JMathLib/trunk/src/jmathlib/core/graphics/axes/coreObjects/LineObject.java 2008-12-26 13:06:40 UTC (rev 558)
@@ -70,34 +70,42 @@
double[] y = _y;
// Find range of x-axis and y-axis
- findMinMax();
+ findMinMaxX();
+ findMinMaxY();
ColorP.update(color);
LineStyleP.update(lineStyle);
MarkerP.update(marker);
}
- private void findMinMax()
+ private void findMinMaxX()
{
double[] x = XDataP.getArray();
- double[] y = YDataP.getArray();
// Find range of x-axis and y-axis
xmin = x[0];
xmax = x[0];
- ymin = y[0];
- ymax = y[0];
- zmin = -0.5;
- zmax = 0.5;
for (int i=1; i<x.length; i++)
{
if (x[i] < xmin) xmin = x[i];
if (x[i] > xmax) xmax = x[i];
- if (y[i] < ymin) ymin = y[i];
- if (y[i] > ymax) ymax = y[i];
}
}
+ private void findMinMaxY()
+ {
+ double[] y = YDataP.getArray();
+
+ // Find range of x-axis and y-axis
+ ymin = y[0];
+ ymax = y[0];
+ for (int i=1; i<y.length; i++)
+ {
+ if (y[i] < ymin) ymin = y[i];
+ if (y[i] > ymax) ymax = y[i];
+ }
+ }
+
public void paint(Graphics g)
{
double[] x = XDataP.getArray();
@@ -220,10 +228,14 @@
{
ErrorLogger.debugLine("LineObject property changed: "+ p.getName());
- if (p == XDataP || p == YDataP)
- findMinMax();
-
- parent.repaint();
+ if (p == XDataP)
+ findMinMaxX();
+
+ if (p == YDataP)
+ findMinMaxY();
+
+ if (parent != null)
+ parent.repaint();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|