You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/07/06 23:47:15 UTC

svn commit: r674351 [8/11] - in /jakarta/jmeter/trunk/src: components/org/apache/jmeter/config/ components/org/apache/jmeter/control/ components/org/apache/jmeter/control/gui/ components/org/apache/jmeter/extractor/ components/org/apache/jmeter/extract...

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java?rev=674351&r1=674350&r2=674351&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java Sun Jul  6 14:47:12 2008
@@ -13,7 +13,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  */
 
 package org.apache.jmeter.visualizers;
@@ -67,366 +67,366 @@
  * good reason not to explore the question any further :)
  * <P>
  * Here is a little piece of code showing how to use this class :
- * 
+ *
  * <PRE> // ... float[] nodes = {3F, 2F, 4F, 1F, 2.5F, 5F, 3F}; Spline3 curve =
  * new Spline3(nodes); // ... public void paint(Graphics g) { int[] plot =
  * curve.getPlots(); for (int i = 1; i < n; i++) { g.drawLine(i - 1, plot[i -
  * 1], i, plot[i]); } } // ...
- * 
+ *
  * </PRE>
- * 
+ *
  * Have fun with it !<BR>
  * Any comments, feedback, bug reports or suggestions will be <a
  * href="mailto:norguet@bigfoot.com?subject=Spline3">appreciated</a>.
- * 
+ *
  * @author <a href="norguet@bigfoot.com">Jean-Pierre Norguet</a>
  * @version $Revison$ updated $Date$
  */
 public class Spline3 {
-	private static final Logger log = LoggingManager.getLoggerForClass();
+    private static final Logger log = LoggingManager.getLoggerForClass();
 
-	protected float[][] _coefficients;
+    protected float[][] _coefficients;
 
-	protected float[][] _A;
+    protected float[][] _A;
 
-	protected float[] _B;
+    protected float[] _B;
 
-	protected float[] _r;
-
-	protected float[] _rS;
-
-	protected int _m; // number of nodes
-
-	protected int _n; // number of non extreme nodes (_m-2)
-
-	final static protected float DEFAULT_PRECISION = (float) 1E-1;
-
-	final static protected int DEFAULT_MAX_ITERATIONS = 100;
-
-	protected float _minPrecision = DEFAULT_PRECISION;
-
-	protected int _maxIterations = DEFAULT_MAX_ITERATIONS;
-
-	/**
-	 * Creates a new Spline curve by calculating the coefficients of each part
-	 * of the curve, i.e. by resolving the equation system implied by the
-	 * interpolation condition on every interval.
-	 * 
-	 * @param r
-	 *            an array of float containing the vertical coordinates of the
-	 *            nodes to interpolate ; the vertical coordinates start at 0 and
-	 *            are equidistant with a step of 1.
-	 */
-	public Spline3(float[] r) {
-		int n = r.length;
-
-		// the number of nodes is defined by the length of r
-		this._m = n;
-		// grab the nodes
-		this._r = new float[n];
-		for (int i = 0; i < n; i++) {
-			_r[i] = r[i];
-		}
-		// the number of non extreme nodes is the number of intervals
-		// minus 1, i.e. the length of r minus 2
-		this._n = n - 2;
-		// computes interpolation coefficients
-		try {
-			long startTime = System.currentTimeMillis();
-
-			this.interpolation();
-			if (log.isDebugEnabled()) {
-				long endTime = System.currentTimeMillis();
-				long elapsedTime = endTime - startTime;
-
-				log.debug("New Spline curve interpolated in ");
-				log.debug(elapsedTime + " ms");
-			}
-		} catch (Exception e) {
-			log.error("Error when interpolating : ", e);
-		}
-
-	}
-
-	/**
-	 * Computes the coefficients of the Spline interpolated curve, on each
-	 * interval. The matrix system to resolve is <CODE>AX=B</CODE>
-	 */
-	protected void interpolation() {
-		// creation of the interpolation structure
-		_rS = new float[_m];
-		_B = new float[_n];
-		_A = new float[_n][_n];
-		_coefficients = new float[_n + 1][4];
-		// local variables
-		int i = 0, j = 0;
-
-		// initialize system structures (just to be safe)
-		for (i = 0; i < _n; i++) {
-			_B[i] = 0;
-			for (j = 0; j < _n; j++) {
-				_A[i][j] = 0;
-			}
-			for (j = 0; j < 4; j++) {
-				_coefficients[i][j] = 0;
-			}
-		}
-		for (i = 0; i < _n; i++) {
-			_rS[i] = 0;
-		}
-		// initialize the diagonal of the system matrix (A) to 4
-		for (i = 0; i < _n; i++) {
-			_A[i][i] = 4;
-		}
-		// initialize the two minor diagonals of A to 1
-		for (i = 1; i < _n; i++) {
-			_A[i][i - 1] = 1;
-			_A[i - 1][i] = 1;
-		}
-		// initialize B
-		for (i = 0; i < _n; i++) {
-			_B[i] = 6 * (_r[i + 2] - 2 * _r[i + 1] + _r[i]);
-		}
-		// Jacobi system resolving
-		this.jacobi(); // results are stored in _rS
-		// computes the coefficients (di, ci, bi, ai) from the results
-		for (i = 0; i < _n + 1; i++) {
-			// di (degree 0)
-			_coefficients[i][0] = _r[i];
-			// ci (degree 1)
-			_coefficients[i][1] = _r[i + 1] - _r[i] - (_rS[i + 1] + 2 * _rS[i]) / 6;
-			// bi (degree 2)
-			_coefficients[i][2] = _rS[i] / 2;
-			// ai (degree 3)
-			_coefficients[i][3] = (_rS[i + 1] - _rS[i]) / 6;
-		}
-	}
-
-	/**
-	 * Resolves the equation system by a Jacobi algorithm. The use of the slower
-	 * Jacobi algorithm instead of Gauss-Seidel is choosen here because Jacobi
-	 * is assured of to be convergent for this particular equation system, as
-	 * the system matrix has a strong diagonal.
-	 */
-	protected void jacobi() {
-		// local variables
-		int i = 0, j = 0, iterations = 0;
-		// intermediate arrays
-		float[] newX = new float[_n];
-		float[] oldX = new float[_n];
-
-		// Jacobi convergence test
-		if (!converge()) {
-			if (log.isDebugEnabled()) {
-				log.debug("Warning : equation system resolving is unstable");
-			}
-		}
-		// init newX and oldX arrays to 0
-		for (i = 0; i < _n; i++) {
-			newX[i] = 0;
-			oldX[i] = 0;
-		}
-		// main iteration
-		while ((this.precision(oldX, newX) > this._minPrecision) && (iterations < this._maxIterations)) {
-			for (i = 0; i < _n; i++) {
-				oldX[i] = newX[i];
-			}
-			for (i = 0; i < _n; i++) {
-				newX[i] = _B[i];
-				for (j = 0; j < i; j++) {
-					newX[i] = newX[i] - (_A[i][j] * oldX[j]);
-				}
-				for (j = i + 1; j < _n; j++) {
-					newX[i] = newX[i] - (_A[i][j] * oldX[j]);
-				}
-				newX[i] = newX[i] / _A[i][i];
-			}
-			iterations++;
-		}
-		if (this.precision(oldX, newX) < this._minPrecision) {
-			if (log.isDebugEnabled()) {
-				log.debug("Minimal precision (");
-				log.debug(this._minPrecision + ") reached after ");
-				log.debug(iterations + " iterations");
-			}
-		} else if (iterations > this._maxIterations) {
-			if (log.isDebugEnabled()) {
-				log.debug("Maximal number of iterations (");
-				log.debug(this._maxIterations + ") reached");
-				log.debug("Warning : precision is only ");
-				log.debug("" + this.precision(oldX, newX));
-				log.debug(", divergence is possible");
-			}
-		}
-		for (i = 0; i < _n; i++) {
-			_rS[i + 1] = newX[i];
-		}
-	}
-
-	/**
-	 * Test if the Jacobi resolution of the equation system converges. It's OK
-	 * if A has a strong diagonal.
-	 */
-	protected boolean converge() {
-		boolean converge = true;
-		int i = 0, j = 0;
-		float lineSum = 0F;
-
-		for (i = 0; i < _n; i++) {
-			if (converge) {
-				lineSum = 0;
-				for (j = 0; j < _n; j++) {
-					lineSum = lineSum + Math.abs(_A[i][j]);
-				}
-				lineSum = lineSum - Math.abs(_A[i][i]);
-				if (lineSum > Math.abs(_A[i][i])) {
-					converge = false;
-				}
-			}
-		}
-		return converge;
-	}
-
-	/**
-	 * Computes the current precision reached.
-	 */
-	protected float precision(float[] oldX, float[] newX) {
-		float N = 0F, D = 0F, erreur = 0F;
-		int i = 0;
-
-		for (i = 0; i < _n; i++) {
-			N = N + Math.abs(newX[i] - oldX[i]);
-			D = D + Math.abs(newX[i]);
-		}
-		if (D != 0F) {
-			erreur = N / D;
-		} else {
-			erreur = Float.MAX_VALUE;
-		}
-		return erreur;
-	}
-
-	/**
-	 * Computes a (vertical) Y-axis value of the global curve.
-	 * 
-	 * @param t
-	 *            abscissa
-	 * @return computed ordinate
-	 */
-	public float value(float t) {
-		int i = 0, splineNumber = 0;
-		float abscissa = 0F, result = 0F;
-
-		// verify t belongs to the curve (range [0, _m-1])
-		if ((t < 0) || (t > (_m - 1))) {
-			if (log.isDebugEnabled()) {
-				log.debug("Warning : abscissa " + t + " out of bounds [0, " + (_m - 1) + "]");
-			}
-			// silent error, consider the curve is constant outside its range
-			if (t < 0) {
-				t = 0;
-			} else {
-				t = _m - 1;
-			}
-		}
-		// seek the good interval for t and get the piece of curve on it
-		splineNumber = (int) Math.floor(t);
-		if (t == (_m - 1)) {
-			// the upper limit of the curve range belongs by definition
-			// to the last interval
-			splineNumber--;
-		}
-		// computes the value of the curve at the pecified abscissa
-		// and relative to the beginning of the right piece of Spline curve
-		abscissa = t - splineNumber;
-		// the polynomial calculation is done by the (fast) Euler method
-		for (i = 0; i < 4; i++) {
-			result = result * abscissa;
-			result = result + _coefficients[splineNumber][3 - i];
-		}
-		return result;
-	}
-
-	/**
-	 * Manual check of the curve at the interpolated points.
-	 */
-	public void debugCheck() {
-		int i = 0;
-
-		for (i = 0; i < _m; i++) {
-			log.info("Point " + i + " : ");
-			log.info(_r[i] + " =? " + value(i));
-		}
-	}
-
-	/**
-	 * Computes drawable plots from the curve for a given draw space. The values
-	 * returned are drawable vertically and from the <B>bottom</B> of a Panel.
-	 * 
-	 * @param width
-	 *            width within the plots have to be computed
-	 * @param height
-	 *            height within the plots are expected to be drawed
-	 * @return drawable plots within the limits defined, in an array of int (as
-	 *         many int as the value of the <CODE>width</CODE> parameter)
-	 */
-	public int[] getPlots(int width, int height) {
-		int[] plot = new int[width];
-		// computes auto-scaling and absolute plots
-		float[] y = new float[width];
-		float max = java.lang.Integer.MIN_VALUE;
-		float min = java.lang.Integer.MAX_VALUE;
-
-		for (int i = 0; i < width; i++) {
-			y[i] = value(((float) i) * (_m - 1) / width);
-			if (y[i] < min) {
-				min = y[i];
-			}
-
-			if (y[i] > max) {
-				max = y[i];
-			}
-		}
-		if (min < 0) {
-			min = 0; // shouldn't draw negative values
-		}
-		// computes relative auto-scaled plots to fit in the specified area
-		for (int i = 0; i < width; i++) {
-			plot[i] = Math.round(((y[i] - min) * (height - 1)) / (max - min));
-		}
-		return plot;
-	}
-
-	public void setPrecision(float precision) {
-		this._minPrecision = precision;
-	}
-
-	public float getPrecision() {
-		return this._minPrecision;
-	}
-
-	public void setToDefaultPrecision() {
-		this._minPrecision = DEFAULT_PRECISION;
-	}
-
-	public float getDefaultPrecision() {
-		return DEFAULT_PRECISION;
-	}
-
-	public void setMaxIterations(int iterations) {
-		this._maxIterations = iterations;
-	}
-
-	public int getMaxIterations() {
-		return this._maxIterations;
-	}
-
-	public void setToDefaultMaxIterations() {
-		this._maxIterations = DEFAULT_MAX_ITERATIONS;
-	}
-
-	public int getDefaultMaxIterations() {
-		return DEFAULT_MAX_ITERATIONS;
-	}
+    protected float[] _r;
+
+    protected float[] _rS;
+
+    protected int _m; // number of nodes
+
+    protected int _n; // number of non extreme nodes (_m-2)
+
+    final static protected float DEFAULT_PRECISION = (float) 1E-1;
+
+    final static protected int DEFAULT_MAX_ITERATIONS = 100;
+
+    protected float _minPrecision = DEFAULT_PRECISION;
+
+    protected int _maxIterations = DEFAULT_MAX_ITERATIONS;
+
+    /**
+     * Creates a new Spline curve by calculating the coefficients of each part
+     * of the curve, i.e. by resolving the equation system implied by the
+     * interpolation condition on every interval.
+     *
+     * @param r
+     *            an array of float containing the vertical coordinates of the
+     *            nodes to interpolate ; the vertical coordinates start at 0 and
+     *            are equidistant with a step of 1.
+     */
+    public Spline3(float[] r) {
+        int n = r.length;
+
+        // the number of nodes is defined by the length of r
+        this._m = n;
+        // grab the nodes
+        this._r = new float[n];
+        for (int i = 0; i < n; i++) {
+            _r[i] = r[i];
+        }
+        // the number of non extreme nodes is the number of intervals
+        // minus 1, i.e. the length of r minus 2
+        this._n = n - 2;
+        // computes interpolation coefficients
+        try {
+            long startTime = System.currentTimeMillis();
+
+            this.interpolation();
+            if (log.isDebugEnabled()) {
+                long endTime = System.currentTimeMillis();
+                long elapsedTime = endTime - startTime;
+
+                log.debug("New Spline curve interpolated in ");
+                log.debug(elapsedTime + " ms");
+            }
+        } catch (Exception e) {
+            log.error("Error when interpolating : ", e);
+        }
+
+    }
+
+    /**
+     * Computes the coefficients of the Spline interpolated curve, on each
+     * interval. The matrix system to resolve is <CODE>AX=B</CODE>
+     */
+    protected void interpolation() {
+        // creation of the interpolation structure
+        _rS = new float[_m];
+        _B = new float[_n];
+        _A = new float[_n][_n];
+        _coefficients = new float[_n + 1][4];
+        // local variables
+        int i = 0, j = 0;
+
+        // initialize system structures (just to be safe)
+        for (i = 0; i < _n; i++) {
+            _B[i] = 0;
+            for (j = 0; j < _n; j++) {
+                _A[i][j] = 0;
+            }
+            for (j = 0; j < 4; j++) {
+                _coefficients[i][j] = 0;
+            }
+        }
+        for (i = 0; i < _n; i++) {
+            _rS[i] = 0;
+        }
+        // initialize the diagonal of the system matrix (A) to 4
+        for (i = 0; i < _n; i++) {
+            _A[i][i] = 4;
+        }
+        // initialize the two minor diagonals of A to 1
+        for (i = 1; i < _n; i++) {
+            _A[i][i - 1] = 1;
+            _A[i - 1][i] = 1;
+        }
+        // initialize B
+        for (i = 0; i < _n; i++) {
+            _B[i] = 6 * (_r[i + 2] - 2 * _r[i + 1] + _r[i]);
+        }
+        // Jacobi system resolving
+        this.jacobi(); // results are stored in _rS
+        // computes the coefficients (di, ci, bi, ai) from the results
+        for (i = 0; i < _n + 1; i++) {
+            // di (degree 0)
+            _coefficients[i][0] = _r[i];
+            // ci (degree 1)
+            _coefficients[i][1] = _r[i + 1] - _r[i] - (_rS[i + 1] + 2 * _rS[i]) / 6;
+            // bi (degree 2)
+            _coefficients[i][2] = _rS[i] / 2;
+            // ai (degree 3)
+            _coefficients[i][3] = (_rS[i + 1] - _rS[i]) / 6;
+        }
+    }
+
+    /**
+     * Resolves the equation system by a Jacobi algorithm. The use of the slower
+     * Jacobi algorithm instead of Gauss-Seidel is choosen here because Jacobi
+     * is assured of to be convergent for this particular equation system, as
+     * the system matrix has a strong diagonal.
+     */
+    protected void jacobi() {
+        // local variables
+        int i = 0, j = 0, iterations = 0;
+        // intermediate arrays
+        float[] newX = new float[_n];
+        float[] oldX = new float[_n];
+
+        // Jacobi convergence test
+        if (!converge()) {
+            if (log.isDebugEnabled()) {
+                log.debug("Warning : equation system resolving is unstable");
+            }
+        }
+        // init newX and oldX arrays to 0
+        for (i = 0; i < _n; i++) {
+            newX[i] = 0;
+            oldX[i] = 0;
+        }
+        // main iteration
+        while ((this.precision(oldX, newX) > this._minPrecision) && (iterations < this._maxIterations)) {
+            for (i = 0; i < _n; i++) {
+                oldX[i] = newX[i];
+            }
+            for (i = 0; i < _n; i++) {
+                newX[i] = _B[i];
+                for (j = 0; j < i; j++) {
+                    newX[i] = newX[i] - (_A[i][j] * oldX[j]);
+                }
+                for (j = i + 1; j < _n; j++) {
+                    newX[i] = newX[i] - (_A[i][j] * oldX[j]);
+                }
+                newX[i] = newX[i] / _A[i][i];
+            }
+            iterations++;
+        }
+        if (this.precision(oldX, newX) < this._minPrecision) {
+            if (log.isDebugEnabled()) {
+                log.debug("Minimal precision (");
+                log.debug(this._minPrecision + ") reached after ");
+                log.debug(iterations + " iterations");
+            }
+        } else if (iterations > this._maxIterations) {
+            if (log.isDebugEnabled()) {
+                log.debug("Maximal number of iterations (");
+                log.debug(this._maxIterations + ") reached");
+                log.debug("Warning : precision is only ");
+                log.debug("" + this.precision(oldX, newX));
+                log.debug(", divergence is possible");
+            }
+        }
+        for (i = 0; i < _n; i++) {
+            _rS[i + 1] = newX[i];
+        }
+    }
+
+    /**
+     * Test if the Jacobi resolution of the equation system converges. It's OK
+     * if A has a strong diagonal.
+     */
+    protected boolean converge() {
+        boolean converge = true;
+        int i = 0, j = 0;
+        float lineSum = 0F;
+
+        for (i = 0; i < _n; i++) {
+            if (converge) {
+                lineSum = 0;
+                for (j = 0; j < _n; j++) {
+                    lineSum = lineSum + Math.abs(_A[i][j]);
+                }
+                lineSum = lineSum - Math.abs(_A[i][i]);
+                if (lineSum > Math.abs(_A[i][i])) {
+                    converge = false;
+                }
+            }
+        }
+        return converge;
+    }
+
+    /**
+     * Computes the current precision reached.
+     */
+    protected float precision(float[] oldX, float[] newX) {
+        float N = 0F, D = 0F, erreur = 0F;
+        int i = 0;
+
+        for (i = 0; i < _n; i++) {
+            N = N + Math.abs(newX[i] - oldX[i]);
+            D = D + Math.abs(newX[i]);
+        }
+        if (D != 0F) {
+            erreur = N / D;
+        } else {
+            erreur = Float.MAX_VALUE;
+        }
+        return erreur;
+    }
+
+    /**
+     * Computes a (vertical) Y-axis value of the global curve.
+     *
+     * @param t
+     *            abscissa
+     * @return computed ordinate
+     */
+    public float value(float t) {
+        int i = 0, splineNumber = 0;
+        float abscissa = 0F, result = 0F;
+
+        // verify t belongs to the curve (range [0, _m-1])
+        if ((t < 0) || (t > (_m - 1))) {
+            if (log.isDebugEnabled()) {
+                log.debug("Warning : abscissa " + t + " out of bounds [0, " + (_m - 1) + "]");
+            }
+            // silent error, consider the curve is constant outside its range
+            if (t < 0) {
+                t = 0;
+            } else {
+                t = _m - 1;
+            }
+        }
+        // seek the good interval for t and get the piece of curve on it
+        splineNumber = (int) Math.floor(t);
+        if (t == (_m - 1)) {
+            // the upper limit of the curve range belongs by definition
+            // to the last interval
+            splineNumber--;
+        }
+        // computes the value of the curve at the pecified abscissa
+        // and relative to the beginning of the right piece of Spline curve
+        abscissa = t - splineNumber;
+        // the polynomial calculation is done by the (fast) Euler method
+        for (i = 0; i < 4; i++) {
+            result = result * abscissa;
+            result = result + _coefficients[splineNumber][3 - i];
+        }
+        return result;
+    }
+
+    /**
+     * Manual check of the curve at the interpolated points.
+     */
+    public void debugCheck() {
+        int i = 0;
+
+        for (i = 0; i < _m; i++) {
+            log.info("Point " + i + " : ");
+            log.info(_r[i] + " =? " + value(i));
+        }
+    }
+
+    /**
+     * Computes drawable plots from the curve for a given draw space. The values
+     * returned are drawable vertically and from the <B>bottom</B> of a Panel.
+     *
+     * @param width
+     *            width within the plots have to be computed
+     * @param height
+     *            height within the plots are expected to be drawed
+     * @return drawable plots within the limits defined, in an array of int (as
+     *         many int as the value of the <CODE>width</CODE> parameter)
+     */
+    public int[] getPlots(int width, int height) {
+        int[] plot = new int[width];
+        // computes auto-scaling and absolute plots
+        float[] y = new float[width];
+        float max = java.lang.Integer.MIN_VALUE;
+        float min = java.lang.Integer.MAX_VALUE;
+
+        for (int i = 0; i < width; i++) {
+            y[i] = value(((float) i) * (_m - 1) / width);
+            if (y[i] < min) {
+                min = y[i];
+            }
+
+            if (y[i] > max) {
+                max = y[i];
+            }
+        }
+        if (min < 0) {
+            min = 0; // shouldn't draw negative values
+        }
+        // computes relative auto-scaled plots to fit in the specified area
+        for (int i = 0; i < width; i++) {
+            plot[i] = Math.round(((y[i] - min) * (height - 1)) / (max - min));
+        }
+        return plot;
+    }
+
+    public void setPrecision(float precision) {
+        this._minPrecision = precision;
+    }
+
+    public float getPrecision() {
+        return this._minPrecision;
+    }
+
+    public void setToDefaultPrecision() {
+        this._minPrecision = DEFAULT_PRECISION;
+    }
+
+    public float getDefaultPrecision() {
+        return DEFAULT_PRECISION;
+    }
+
+    public void setMaxIterations(int iterations) {
+        this._maxIterations = iterations;
+    }
+
+    public int getMaxIterations() {
+        return this._maxIterations;
+    }
+
+    public void setToDefaultMaxIterations() {
+        this._maxIterations = DEFAULT_MAX_ITERATIONS;
+    }
+
+    public int getDefaultMaxIterations() {
+        return DEFAULT_MAX_ITERATIONS;
+    }
 
 }

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineModel.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineModel.java?rev=674351&r1=674350&r2=674351&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineModel.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineModel.java Sun Jul  6 14:47:12 2008
@@ -13,7 +13,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  */
 
 package org.apache.jmeter.visualizers;
@@ -25,122 +25,122 @@
 import org.apache.jmeter.util.JMeterUtils;
 
 public class SplineModel implements Clearable {
-	public final int DEFAULT_NUMBER_OF_NODES = 10;
+    public final int DEFAULT_NUMBER_OF_NODES = 10;
 
-	public final int DEFAULT_REFRESH_PERIOD = 1;
+    public final int DEFAULT_REFRESH_PERIOD = 1;
 
-	protected final boolean SHOW_INCOMING_SAMPLES = true;
+    protected final boolean SHOW_INCOMING_SAMPLES = true;
 
-	protected int numberOfNodes = DEFAULT_NUMBER_OF_NODES;
+    protected int numberOfNodes = DEFAULT_NUMBER_OF_NODES;
 
-	protected int refreshPeriod = DEFAULT_REFRESH_PERIOD;
+    protected int refreshPeriod = DEFAULT_REFRESH_PERIOD;
 
-	/** Current Spline curve. */
-	protected Spline3 dataCurve = null;
+    /** Current Spline curve. */
+    protected Spline3 dataCurve = null;
 
-	SamplingStatCalculator samples;
+    SamplingStatCalculator samples;
 
-	private GraphListener listener;
+    private GraphListener listener;
 
-	private String name;
+    private String name;
 
-	public SplineModel() {
-		samples = new SamplingStatCalculator("Spline");
-	}
+    public SplineModel() {
+        samples = new SamplingStatCalculator("Spline");
+    }
 
-	public void setListener(GraphListener vis) {
-		listener = vis;
-	}
+    public void setListener(GraphListener vis) {
+        listener = vis;
+    }
 
-	public void setName(String newName) {
-		name = newName;
-	}
+    public void setName(String newName) {
+        name = newName;
+    }
 
-	public boolean isEditable() {
-		return true;
-	}
+    public boolean isEditable() {
+        return true;
+    }
 
-	public Spline3 getDataCurve() {
-		return dataCurve;
-	}
+    public Spline3 getDataCurve() {
+        return dataCurve;
+    }
 
-	public Class getGuiClass() {
-		return org.apache.jmeter.visualizers.SplineVisualizer.class;
-	}
+    public Class getGuiClass() {
+        return org.apache.jmeter.visualizers.SplineVisualizer.class;
+    }
 
-	public Collection getAddList() {
-		return null;
-	}
+    public Collection getAddList() {
+        return null;
+    }
 
-	public String getClassLabel() {
-		return JMeterUtils.getResString("spline_visualizer_title");// $NON-NLS-1$
-	}
+    public String getClassLabel() {
+        return JMeterUtils.getResString("spline_visualizer_title");// $NON-NLS-1$
+    }
 
-	public long getMinimum() {
-		return samples.getMin().longValue();
-	}
+    public long getMinimum() {
+        return samples.getMin().longValue();
+    }
 
-	public long getMaximum() {
-		return samples.getMax().longValue();
-	}
+    public long getMaximum() {
+        return samples.getMax().longValue();
+    }
 
-	public long getAverage() {
-		return (long) samples.getMean();
-	}
+    public long getAverage() {
+        return (long) samples.getMean();
+    }
 
-	public long getCurrent() {
-		return samples.getCurrentSample().getData();
-	}
+    public long getCurrent() {
+        return samples.getCurrentSample().getData();
+    }
 
-	public long getSample(int i) {
-		return samples.getSample(i).getData();
-	}
+    public long getSample(int i) {
+        return samples.getSample(i).getData();
+    }
 
-	public long getNumberOfCollectedSamples() {
-		return samples.getCount();
-	}
+    public long getNumberOfCollectedSamples() {
+        return samples.getCount();
+    }
 
-	public String getName() {
-		return name;
-	}
+    public String getName() {
+        return name;
+    }
 
-	public void uncompile() {
-		clearData();
-	}
+    public void uncompile() {
+        clearData();
+    }
 
-	public synchronized void clearData() {
-		// this.graph.clear();
-		samples.clear();
+    public synchronized void clearData() {
+        // this.graph.clear();
+        samples.clear();
 
-		this.dataCurve = null;
+        this.dataCurve = null;
 
-		if (listener != null) {
-			listener.updateGui();
-		}
-	}
+        if (listener != null) {
+            listener.updateGui();
+        }
+    }
 
-	public synchronized void add(SampleResult sampleResult) {
-		samples.addSample(sampleResult);
-		long n = samples.getCount();
+    public synchronized void add(SampleResult sampleResult) {
+        samples.addSample(sampleResult);
+        long n = samples.getCount();
 
-		if ((n % (numberOfNodes * refreshPeriod)) == 0) {
-			float[] floatNode = new float[numberOfNodes];
-			// NOTUSED: long[] longSample = getSamples();
-			// load each node
-			long loadFactor = n / numberOfNodes;
+        if ((n % (numberOfNodes * refreshPeriod)) == 0) {
+            float[] floatNode = new float[numberOfNodes];
+            // NOTUSED: long[] longSample = getSamples();
+            // load each node
+            long loadFactor = n / numberOfNodes;
 
-			for (int i = 0; i < numberOfNodes; i++) {
-				for (int j = 0; j < loadFactor; j++) {
-					floatNode[i] += samples.getSample((int) ((i * loadFactor) + j)).getData();
-				}
-				floatNode[i] = floatNode[i] / loadFactor;
-			}
-			// compute the new Spline curve
-			dataCurve = new Spline3(floatNode);
-			if (listener != null) {
-				listener.updateGui();
-			}
-		} else {// do nothing, wait for the next pile to complete
-		}
-	}
+            for (int i = 0; i < numberOfNodes; i++) {
+                for (int j = 0; j < loadFactor; j++) {
+                    floatNode[i] += samples.getSample((int) ((i * loadFactor) + j)).getData();
+                }
+                floatNode[i] = floatNode[i] / loadFactor;
+            }
+            // compute the new Spline curve
+            dataCurve = new Spline3(floatNode);
+            if (listener != null) {
+                listener.updateGui();
+            }
+        } else {// do nothing, wait for the next pile to complete
+        }
+    }
 }

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java?rev=674351&r1=674350&r2=674351&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java Sun Jul  6 14:47:12 2008
@@ -13,7 +13,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  */
 
 package org.apache.jmeter.visualizers;
@@ -42,288 +42,288 @@
  * This class implements a statistical analyser that takes samples to process a
  * Spline interpolated curve. Currently, it tries to look mostly like the
  * GraphVisualizer.
- * 
+ *
  */
 public class SplineVisualizer extends AbstractVisualizer implements ImageVisualizer, GraphListener, Clearable {
 
-	private static final String SUFFIX_MS = " ms";  //$NON-NLS-1$
+    private static final String SUFFIX_MS = " ms";  //$NON-NLS-1$
 
-	protected final Color BACKGROUND_COLOR = getBackground();
+    protected final Color BACKGROUND_COLOR = getBackground();
 
-	protected final Color MINIMUM_COLOR = new Color(0F, 0.5F, 0F);
+    protected final Color MINIMUM_COLOR = new Color(0F, 0.5F, 0F);
 
-	protected final Color MAXIMUM_COLOR = new Color(0.9F, 0F, 0F);
+    protected final Color MAXIMUM_COLOR = new Color(0.9F, 0F, 0F);
 
-	protected final Color AVERAGE_COLOR = new Color(0F, 0F, 0.75F);
+    protected final Color AVERAGE_COLOR = new Color(0F, 0F, 0.75F);
 
-	protected final Color INCOMING_COLOR = Color.black;
+    protected final Color INCOMING_COLOR = Color.black;
 
-	protected final int NUMBERS_TO_DISPLAY = 4;
+    protected final int NUMBERS_TO_DISPLAY = 4;
 
-	protected final boolean FILL_UP_WITH_ZEROS = false;
+    protected final boolean FILL_UP_WITH_ZEROS = false;
 
-	private transient SplineGraph graph = null;
+    private transient SplineGraph graph = null;
 
-	private JLabel minimumLabel = null;
+    private JLabel minimumLabel = null;
 
-	private JLabel maximumLabel = null;
+    private JLabel maximumLabel = null;
 
-	private JLabel averageLabel = null;
+    private JLabel averageLabel = null;
 
-	private JLabel incomingLabel = null;
+    private JLabel incomingLabel = null;
 
-	private JLabel minimumNumberLabel = null;
+    private JLabel minimumNumberLabel = null;
 
-	private JLabel maximumNumberLabel = null;
+    private JLabel maximumNumberLabel = null;
 
-	private JLabel averageNumberLabel = null;
+    private JLabel averageNumberLabel = null;
 
-	private JLabel incomingNumberLabel = null;
+    private JLabel incomingNumberLabel = null;
 
-	private transient SplineModel model;
+    private transient SplineModel model;
 
-	public SplineVisualizer() {
-		super();
-		model = new SplineModel();
-		graph = new SplineGraph();
-		this.model.setListener(this);
-		setGUI();
-	}
+    public SplineVisualizer() {
+        super();
+        model = new SplineModel();
+        graph = new SplineGraph();
+        this.model.setListener(this);
+        setGUI();
+    }
 
-	public void add(SampleResult res) {
-		model.add(res);
-	}
+    public void add(SampleResult res) {
+        model.add(res);
+    }
 
-	public String getLabelResource() {
-		return "spline_visualizer_title"; //$NON-NLS-1$
-	}
+    public String getLabelResource() {
+        return "spline_visualizer_title"; //$NON-NLS-1$
+    }
 
-	public void updateGui(Sample s) {
-		updateGui();
-	}
+    public void updateGui(Sample s) {
+        updateGui();
+    }
 
-	public void clearData() {
-		model.clearData();
-	}
+    public void clearData() {
+        model.clearData();
+    }
 
-	private void setGUI() {
-		Color backColor = BACKGROUND_COLOR;
+    private void setGUI() {
+        Color backColor = BACKGROUND_COLOR;
 
-		this.setBackground(backColor);
+        this.setBackground(backColor);
 
-		this.setLayout(new BorderLayout());
+        this.setLayout(new BorderLayout());
 
-		// MAIN PANEL
-		JPanel mainPanel = new JPanel();
-		Border margin = new EmptyBorder(10, 10, 5, 10);
+        // MAIN PANEL
+        JPanel mainPanel = new JPanel();
+        Border margin = new EmptyBorder(10, 10, 5, 10);
 
-		mainPanel.setBorder(margin);
-		mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
+        mainPanel.setBorder(margin);
+        mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
 
-		// NAME
-		mainPanel.add(makeTitlePanel());
+        // NAME
+        mainPanel.add(makeTitlePanel());
 
-		maximumLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_maximum")); //$NON-NLS-1$
-		maximumLabel.setForeground(MAXIMUM_COLOR);
-		maximumLabel.setBackground(backColor);
+        maximumLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_maximum")); //$NON-NLS-1$
+        maximumLabel.setForeground(MAXIMUM_COLOR);
+        maximumLabel.setBackground(backColor);
 
-		averageLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_average")); //$NON-NLS-1$
-		averageLabel.setForeground(AVERAGE_COLOR);
-		averageLabel.setBackground(backColor);
+        averageLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_average")); //$NON-NLS-1$
+        averageLabel.setForeground(AVERAGE_COLOR);
+        averageLabel.setBackground(backColor);
 
-		incomingLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_incoming")); //$NON-NLS-1$
-		incomingLabel.setForeground(INCOMING_COLOR);
-		incomingLabel.setBackground(backColor);
+        incomingLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_incoming")); //$NON-NLS-1$
+        incomingLabel.setForeground(INCOMING_COLOR);
+        incomingLabel.setBackground(backColor);
 
-		minimumLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_minimum")); //$NON-NLS-1$
-		minimumLabel.setForeground(MINIMUM_COLOR);
-		minimumLabel.setBackground(backColor);
+        minimumLabel = new JLabel(JMeterUtils.getResString("spline_visualizer_minimum")); //$NON-NLS-1$
+        minimumLabel.setForeground(MINIMUM_COLOR);
+        minimumLabel.setBackground(backColor);
 
-		maximumNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
-		maximumNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
-		maximumNumberLabel.setForeground(MAXIMUM_COLOR);
-		maximumNumberLabel.setBackground(backColor);
+        maximumNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
+        maximumNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
+        maximumNumberLabel.setForeground(MAXIMUM_COLOR);
+        maximumNumberLabel.setBackground(backColor);
 
-		averageNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
-		averageNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
-		averageNumberLabel.setForeground(AVERAGE_COLOR);
-		averageNumberLabel.setBackground(backColor);
+        averageNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
+        averageNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
+        averageNumberLabel.setForeground(AVERAGE_COLOR);
+        averageNumberLabel.setBackground(backColor);
 
-		incomingNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
-		incomingNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
-		incomingNumberLabel.setForeground(INCOMING_COLOR);
-		incomingNumberLabel.setBackground(backColor);
+        incomingNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
+        incomingNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
+        incomingNumberLabel.setForeground(INCOMING_COLOR);
+        incomingNumberLabel.setBackground(backColor);
 
-		minimumNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
-		minimumNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
-		minimumNumberLabel.setForeground(MINIMUM_COLOR);
-		minimumNumberLabel.setBackground(backColor);
+        minimumNumberLabel = new JLabel("0 ms"); //$NON-NLS-1$
+        minimumNumberLabel.setHorizontalAlignment(JLabel.RIGHT);
+        minimumNumberLabel.setForeground(MINIMUM_COLOR);
+        minimumNumberLabel.setBackground(backColor);
 
-		// description Panel
-		JPanel labelPanel = new JPanel();
+        // description Panel
+        JPanel labelPanel = new JPanel();
 
-		labelPanel.setLayout(new GridLayout(0, 1));
-		labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
-		labelPanel.setBackground(backColor);
-		labelPanel.add(maximumLabel);
-		labelPanel.add(averageLabel);
-		if (model.SHOW_INCOMING_SAMPLES) {
-			labelPanel.add(incomingLabel);
-		}
-		labelPanel.add(minimumLabel);
-		// number Panel
-		JPanel numberPanel = new JPanel();
+        labelPanel.setLayout(new GridLayout(0, 1));
+        labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
+        labelPanel.setBackground(backColor);
+        labelPanel.add(maximumLabel);
+        labelPanel.add(averageLabel);
+        if (model.SHOW_INCOMING_SAMPLES) {
+            labelPanel.add(incomingLabel);
+        }
+        labelPanel.add(minimumLabel);
+        // number Panel
+        JPanel numberPanel = new JPanel();
 
-		numberPanel.setLayout(new GridLayout(0, 1));
-		numberPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
-		numberPanel.setBackground(backColor);
-		numberPanel.add(maximumNumberLabel);
-		numberPanel.add(averageNumberLabel);
-		if (model.SHOW_INCOMING_SAMPLES) {
-			numberPanel.add(incomingNumberLabel);
-		}
-		numberPanel.add(minimumNumberLabel);
-		// information display Panel
-		JPanel infoPanel = new JPanel();
+        numberPanel.setLayout(new GridLayout(0, 1));
+        numberPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
+        numberPanel.setBackground(backColor);
+        numberPanel.add(maximumNumberLabel);
+        numberPanel.add(averageNumberLabel);
+        if (model.SHOW_INCOMING_SAMPLES) {
+            numberPanel.add(incomingNumberLabel);
+        }
+        numberPanel.add(minimumNumberLabel);
+        // information display Panel
+        JPanel infoPanel = new JPanel();
 
-		infoPanel.setLayout(new BorderLayout());
-		infoPanel.add(labelPanel, BorderLayout.CENTER);
-		infoPanel.add(numberPanel, BorderLayout.EAST);
+        infoPanel.setLayout(new BorderLayout());
+        infoPanel.add(labelPanel, BorderLayout.CENTER);
+        infoPanel.add(numberPanel, BorderLayout.EAST);
 
-		this.add(mainPanel, BorderLayout.NORTH);
-		this.add(infoPanel, BorderLayout.WEST);
-		this.add(graph, BorderLayout.CENTER);
-		// everyone is free to swing on its side :)
-		// add(infoPanel, BorderLayout.EAST);
-	}
+        this.add(mainPanel, BorderLayout.NORTH);
+        this.add(infoPanel, BorderLayout.WEST);
+        this.add(graph, BorderLayout.CENTER);
+        // everyone is free to swing on its side :)
+        // add(infoPanel, BorderLayout.EAST);
+    }
 
-	public void updateGui() {
-		repaint();
-		synchronized (this) {
-			setMinimum(model.getMinimum());
-			setMaximum(model.getMaximum());
-			setAverage(model.getAverage());
-			setIncoming(model.getCurrent());
-		}
-	}
+    public void updateGui() {
+        repaint();
+        synchronized (this) {
+            setMinimum(model.getMinimum());
+            setMaximum(model.getMaximum());
+            setAverage(model.getAverage());
+            setIncoming(model.getCurrent());
+        }
+    }
 
-	public String toString() {
-		return "Show the samples analysis as a Spline curve";
-	}
+    public String toString() {
+        return "Show the samples analysis as a Spline curve";
+    }
 
-	private String formatMeasureToDisplay(long measure) {
-		String numberString = String.valueOf(measure);
+    private String formatMeasureToDisplay(long measure) {
+        String numberString = String.valueOf(measure);
 
-		if (FILL_UP_WITH_ZEROS) {
-			for (int i = numberString.length(); i < NUMBERS_TO_DISPLAY; i++) {
-				numberString = "0" + numberString; //$NON-NLS-1$
-			}
-		}
-		return numberString;
-	}
+        if (FILL_UP_WITH_ZEROS) {
+            for (int i = numberString.length(); i < NUMBERS_TO_DISPLAY; i++) {
+                numberString = "0" + numberString; //$NON-NLS-1$
+            }
+        }
+        return numberString;
+    }
 
-	private void setMinimum(long n) {
-		String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
+    private void setMinimum(long n) {
+        String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
 
-		this.minimumNumberLabel.setText(text);
-	}
+        this.minimumNumberLabel.setText(text);
+    }
 
-	private void setMaximum(long n) {
-		String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
+    private void setMaximum(long n) {
+        String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
 
-		this.maximumNumberLabel.setText(text);
-	}
+        this.maximumNumberLabel.setText(text);
+    }
 
-	private void setAverage(long n) {
-		String text = this.formatMeasureToDisplay(n) + SUFFIX_MS; 
+    private void setAverage(long n) {
+        String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
 
-		this.averageNumberLabel.setText(text);
-	}
+        this.averageNumberLabel.setText(text);
+    }
 
-	private void setIncoming(long n) {
-		String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
+    private void setIncoming(long n) {
+        String text = this.formatMeasureToDisplay(n) + SUFFIX_MS;
 
-		this.incomingNumberLabel.setText(text);
-	}
+        this.incomingNumberLabel.setText(text);
+    }
 
-	public JPanel getControlPanel() {// TODO - is this needed?
-		return this;
-	}
+    public JPanel getControlPanel() {// TODO - is this needed?
+        return this;
+    }
 
-	public Image getImage() {
-		Image result = graph.createImage(graph.getWidth(), graph.getHeight());
+    public Image getImage() {
+        Image result = graph.createImage(graph.getWidth(), graph.getHeight());
 
-		graph.paintComponent(result.getGraphics());
+        graph.paintComponent(result.getGraphics());
 
-		return result;
-	}
+        return result;
+    }
 
-	/**
-	 * Component showing a Spline curve.
-	 * 
-	 */
-	public class SplineGraph extends JComponent {
-		public boolean reinterpolated = false;
+    /**
+     * Component showing a Spline curve.
+     *
+     */
+    public class SplineGraph extends JComponent {
+        public boolean reinterpolated = false;
 
-		protected final Color WAITING_COLOR = Color.darkGray;
+        protected final Color WAITING_COLOR = Color.darkGray;
 
-		protected int lastWidth = -1;
+        protected int lastWidth = -1;
 
-		protected int lastHeight = -1;
+        protected int lastHeight = -1;
 
-		protected int[] plot = null;
+        protected int[] plot = null;
 
-		public SplineGraph() {
-		}
+        public SplineGraph() {
+        }
 
-		/**
-		 * Clear the Spline graph and get ready for the next wave.
-		 */
-		public void clear() {
-			lastWidth = -1;
-			lastHeight = -1;
-			plot = null;
-			this.repaint();
-		}
+        /**
+         * Clear the Spline graph and get ready for the next wave.
+         */
+        public void clear() {
+            lastWidth = -1;
+            lastHeight = -1;
+            plot = null;
+            this.repaint();
+        }
 
-		public void paintComponent(Graphics g) {
-			super.paintComponent(g);
+        public void paintComponent(Graphics g) {
+            super.paintComponent(g);
 
-			Dimension dimension = this.getSize();
-			int width = dimension.width;
-			int height = dimension.height;
+            Dimension dimension = this.getSize();
+            int width = dimension.width;
+            int height = dimension.height;
 
-			if (model.getDataCurve() == null) {
-				g.setColor(this.getBackground());
-				g.fillRect(0, 0, width, height);
-				g.setColor(WAITING_COLOR);
-				g.drawString(JMeterUtils.getResString("spline_visualizer_waitingmessage"),  //$NON-NLS-1$
-						(width - 120) / 2, height - (height - 12) / 2);
-				return;
-			}
+            if (model.getDataCurve() == null) {
+                g.setColor(this.getBackground());
+                g.fillRect(0, 0, width, height);
+                g.setColor(WAITING_COLOR);
+                g.drawString(JMeterUtils.getResString("spline_visualizer_waitingmessage"),  //$NON-NLS-1$
+                        (width - 120) / 2, height - (height - 12) / 2);
+                return;
+            }
 
-			// boolean resized = true;
+            // boolean resized = true;
 
-			if (width == lastWidth && height == lastHeight) {
-				// dimension of the SplineGraph is the same
-				// resized = false;
-			} else {
-				// dimension changed
-				// resized = true;
-				lastWidth = width;
-				lastHeight = height;
-			}
+            if (width == lastWidth && height == lastHeight) {
+                // dimension of the SplineGraph is the same
+                // resized = false;
+            } else {
+                // dimension changed
+                // resized = true;
+                lastWidth = width;
+                lastHeight = height;
+            }
 
-			this.plot = model.getDataCurve().getPlots(width, height); // rounds!
+            this.plot = model.getDataCurve().getPlots(width, height); // rounds!
 
-			int n = plot.length;
-			int curY = plot[0];
+            int n = plot.length;
+            int curY = plot[0];
 
-			for (int i = 1; i < n; i++) {
-				g.setColor(Color.black);
-				g.drawLine(i - 1, height - curY - 1, i, height - plot[i] - 1);
-				curY = plot[i];
-			}
-		}
-	}
+            for (int i = 1; i < n; i++) {
+                g.setColor(Color.black);
+                g.drawLine(i - 1, height - curY - 1, i, height - plot[i] - 1);
+                curY = plot[i];
+            }
+        }
+    }
 }

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java?rev=674351&r1=674350&r2=674351&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java Sun Jul  6 14:47:12 2008
@@ -5,15 +5,15 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations
  * under the License.
- *  
+ *
  */
 
 package org.apache.jmeter.visualizers;
@@ -71,179 +71,179 @@
  * who've done the other visualizers ahead of me (Stefano Mazzocchi), who I
  * borrowed code from to start me off (and much code may still exist). Thank
  * you!
- * 
+ *
  */
 public class StatGraphVisualizer extends AbstractVisualizer implements Clearable,
 ActionListener {
     private static final Logger log = LoggingManager.getLoggerForClass();
-    
-	private final String[] COLUMNS = { JMeterUtils.getResString("sampler_label"), //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_count"),			//$NON-NLS-1$
-			JMeterUtils.getResString("average"),						//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_median"),		//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_90%_line"),		//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_min"),			//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_max"),			//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_error%"),		//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_rate"),			//$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_bandwidth") };	//$NON-NLS-1$
-    
+
+    private final String[] COLUMNS = { JMeterUtils.getResString("sampler_label"), //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_count"),         //$NON-NLS-1$
+            JMeterUtils.getResString("average"),                        //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_median"),        //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_90%_line"),      //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_min"),           //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_max"),           //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_error%"),        //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_rate"),          //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_bandwidth") };   //$NON-NLS-1$
+
     private final String[] GRAPH_COLUMNS = {JMeterUtils.getResString("average"),//$NON-NLS-1$
-            JMeterUtils.getResString("aggregate_report_median"),		//$NON-NLS-1$
-            JMeterUtils.getResString("aggregate_report_90%_line"),		//$NON-NLS-1$
-            JMeterUtils.getResString("aggregate_report_min"),			//$NON-NLS-1$
-            JMeterUtils.getResString("aggregate_report_max")};			//$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_median"),        //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_90%_line"),      //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_min"),           //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_max")};          //$NON-NLS-1$
+
+    private final String TOTAL_ROW_LABEL =
+        JMeterUtils.getResString("aggregate_report_total_label");       //$NON-NLS-1$
 
-	private final String TOTAL_ROW_LABEL =
-		JMeterUtils.getResString("aggregate_report_total_label");		//$NON-NLS-1$
+    protected JTable myJTable;
 
-	protected JTable myJTable;
+    protected JScrollPane myScrollPane;
 
-	protected JScrollPane myScrollPane;
+    private transient ObjectTableModel model;
 
-	private transient ObjectTableModel model;
+    Map tableRows = Collections.synchronizedMap(new HashMap());
 
-	Map tableRows = Collections.synchronizedMap(new HashMap());
-    
     protected AxisGraph graphPanel = null;
-    
+
     protected VerticalPanel graph = null;
-    
+
     protected JScrollPane graphScroll = null;
-    
+
     protected JSplitPane spane = null;
-    
-    protected JLabeledChoice columns = 
+
+    protected JLabeledChoice columns =
         new JLabeledChoice(JMeterUtils.getResString("aggregate_graph_column"),GRAPH_COLUMNS);//$NON-NLS-1$
-    
+
     //NOT USED protected double[][] data = null;
-    
-    protected JButton displayButton = 
-        new JButton(JMeterUtils.getResString("aggregate_graph_display"));				//$NON-NLS-1$
-    
-    protected JButton saveGraph = 
-        new JButton(JMeterUtils.getResString("aggregate_graph_save"));					//$NON-NLS-1$
-    
-    protected JButton saveTable = 
-        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));			//$NON-NLS-1$
-    
+
+    protected JButton displayButton =
+        new JButton(JMeterUtils.getResString("aggregate_graph_display"));                //$NON-NLS-1$
+
+    protected JButton saveGraph =
+        new JButton(JMeterUtils.getResString("aggregate_graph_save"));                    //$NON-NLS-1$
+
+    protected JButton saveTable =
+        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));            //$NON-NLS-1$
+
     private JCheckBox saveHeaders = // should header be saved with the data?
-    	new JCheckBox(JMeterUtils.getResString("aggregate_graph_save_table_header"));	//$NON-NLS-1$
- 
-    JLabeledTextField graphTitle = 
-        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_user_title"));	//$NON-NLS-1$
-    
-    JLabeledTextField maxLengthXAxisLabel = 
+        new JCheckBox(JMeterUtils.getResString("aggregate_graph_save_table_header"));    //$NON-NLS-1$
+
+    JLabeledTextField graphTitle =
+        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_user_title"));    //$NON-NLS-1$
+
+    JLabeledTextField maxLengthXAxisLabel =
         new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_max_length_xaxis_label"));//$NON-NLS-1$
-    
-    JLabeledTextField graphWidth = 
-        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_width"));		//$NON-NLS-1$
-    JLabeledTextField graphHeight = 
-        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_height"));		//$NON-NLS-1$
-    
+
+    JLabeledTextField graphWidth =
+        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_width"));        //$NON-NLS-1$
+    JLabeledTextField graphHeight =
+        new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_height"));        //$NON-NLS-1$
+
     protected String yAxisLabel = JMeterUtils.getResString("aggregate_graph_response_time");//$NON-NLS-1$
-    
-    protected String yAxisTitle = JMeterUtils.getResString("aggregate_graph_ms");		//$NON-NLS-1$
-    
+
+    protected String yAxisTitle = JMeterUtils.getResString("aggregate_graph_ms");        //$NON-NLS-1$
+
     protected boolean saveGraphToFile = false;
-    
+
     protected int defaultWidth = 400;
-    
+
     protected int defaultHeight = 300;
 
-	public StatGraphVisualizer() {
-		super();
-		model = new ObjectTableModel(COLUMNS,
-				SamplingStatCalculator.class,
-				new Functor[] {
-				new Functor("getLabel"),					//$NON-NLS-1$
-				new Functor("getCount"),					//$NON-NLS-1$
-				new Functor("getMeanAsNumber"),				//$NON-NLS-1$
-				new Functor("getMedian"),					//$NON-NLS-1$
-				new Functor("getPercentPoint",				//$NON-NLS-1$
-				new Object[] { new Float(.900) }),
-				new Functor("getMin"),						//$NON-NLS-1$
-				new Functor("getMax"), 						//$NON-NLS-1$
-				new Functor("getErrorPercentage"),	        //$NON-NLS-1$
-				new Functor("getRate"),				        //$NON-NLS-1$
-				new Functor("getKBPerSecond") },			//$NON-NLS-1$
-				new Functor[] { null, null, null, null, null, null, null, null,	null, null }, 
-				new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
-				Long.class, String.class, String.class, String.class });
-		clearData();
-		init();
-	}
-
-	// Column renderers
-	private static final TableCellRenderer[] RENDERERS = 
-		new TableCellRenderer[]{
-		    null, // Label
-		    null, // count
-		    null, // Mean
-		    null, // median
-		    null, // 90%
-		    null, // Min
-		    null, // Max
-		    new NumberRenderer("#0.00%"), // Error %age
-		    new RateRenderer("#.0"),      // Throughpur
-		    new NumberRenderer("#.0"),    // pageSize
-		};
-
-	public static boolean testFunctors(){
-		StatGraphVisualizer instance = new StatGraphVisualizer();
-		return instance.model.checkFunctors(null,instance.getClass());
-	}
-	
-	public String getLabelResource() {
-		return "aggregate_graph_title";						//$NON-NLS-1$
-	}
+    public StatGraphVisualizer() {
+        super();
+        model = new ObjectTableModel(COLUMNS,
+                SamplingStatCalculator.class,
+                new Functor[] {
+                new Functor("getLabel"),                    //$NON-NLS-1$
+                new Functor("getCount"),                    //$NON-NLS-1$
+                new Functor("getMeanAsNumber"),                //$NON-NLS-1$
+                new Functor("getMedian"),                    //$NON-NLS-1$
+                new Functor("getPercentPoint",                //$NON-NLS-1$
+                new Object[] { new Float(.900) }),
+                new Functor("getMin"),                        //$NON-NLS-1$
+                new Functor("getMax"),                         //$NON-NLS-1$
+                new Functor("getErrorPercentage"),            //$NON-NLS-1$
+                new Functor("getRate"),                        //$NON-NLS-1$
+                new Functor("getKBPerSecond") },            //$NON-NLS-1$
+                new Functor[] { null, null, null, null, null, null, null, null,    null, null },
+                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
+                Long.class, String.class, String.class, String.class });
+        clearData();
+        init();
+    }
+
+    // Column renderers
+    private static final TableCellRenderer[] RENDERERS =
+        new TableCellRenderer[]{
+            null, // Label
+            null, // count
+            null, // Mean
+            null, // median
+            null, // 90%
+            null, // Min
+            null, // Max
+            new NumberRenderer("#0.00%"), // Error %age
+            new RateRenderer("#.0"),      // Throughpur
+            new NumberRenderer("#.0"),    // pageSize
+        };
+
+    public static boolean testFunctors(){
+        StatGraphVisualizer instance = new StatGraphVisualizer();
+        return instance.model.checkFunctors(null,instance.getClass());
+    }
+
+    public String getLabelResource() {
+        return "aggregate_graph_title";                        //$NON-NLS-1$
+    }
 
-	public void add(SampleResult res) {
-		SamplingStatCalculator row = null;
+    public void add(SampleResult res) {
+        SamplingStatCalculator row = null;
         final String sampleLabel = res.getSampleLabel();
-		synchronized (tableRows) {
+        synchronized (tableRows) {
             row = (SamplingStatCalculator) tableRows.get(sampleLabel);
-			if (row == null) {
-				row = new SamplingStatCalculator(sampleLabel);
-				tableRows.put(row.getLabel(), row);
-				model.insertRow(row, model.getRowCount() - 1);
-			}
-		}
-		row.addSample(res);
-		((SamplingStatCalculator) tableRows.get(TOTAL_ROW_LABEL)).addSample(res);
-		model.fireTableDataChanged();
-	}
-
-	/**
-	 * Clears this visualizer and its model, and forces a repaint of the table.
-	 */
-	public void clearData() {
-		model.clearData();
-		tableRows.clear();
-		tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL));
-		model.addRow(tableRows.get(TOTAL_ROW_LABEL));
-	}
-
-	/**
-	 * Main visualizer setup.
-	 */
-	private void init() {
-		this.setLayout(new BorderLayout());
-
-		// MAIN PANEL
-		JPanel mainPanel = new JPanel();
-		Border margin = new EmptyBorder(10, 10, 5, 10);
+            if (row == null) {
+                row = new SamplingStatCalculator(sampleLabel);
+                tableRows.put(row.getLabel(), row);
+                model.insertRow(row, model.getRowCount() - 1);
+            }
+        }
+        row.addSample(res);
+        ((SamplingStatCalculator) tableRows.get(TOTAL_ROW_LABEL)).addSample(res);
+        model.fireTableDataChanged();
+    }
+
+    /**
+     * Clears this visualizer and its model, and forces a repaint of the table.
+     */
+    public void clearData() {
+        model.clearData();
+        tableRows.clear();
+        tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL));
+        model.addRow(tableRows.get(TOTAL_ROW_LABEL));
+    }
+
+    /**
+     * Main visualizer setup.
+     */
+    private void init() {
+        this.setLayout(new BorderLayout());
+
+        // MAIN PANEL
+        JPanel mainPanel = new JPanel();
+        Border margin = new EmptyBorder(10, 10, 5, 10);
         Border margin2 = new EmptyBorder(10, 10, 5, 10);
-        
-		mainPanel.setBorder(margin);
-		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
-		mainPanel.add(makeTitlePanel());
-
-		myJTable = new JTable(model);
-		myJTable.setPreferredScrollableViewportSize(new Dimension(500, 80));
-		RendererUtils.applyRenderers(myJTable, RENDERERS);
-		myScrollPane = new JScrollPane(myJTable);
-        
+
+        mainPanel.setBorder(margin);
+        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
+        mainPanel.add(makeTitlePanel());
+
+        myJTable = new JTable(model);
+        myJTable.setPreferredScrollableViewportSize(new Dimension(500, 80));
+        RendererUtils.applyRenderers(myJTable, RENDERERS);
+        myScrollPane = new JScrollPane(myJTable);
+
         graph = new VerticalPanel();
         graph.setBorder(margin2);
 
@@ -259,7 +259,7 @@
         buttonpanel.add(saveGraph);
         buttonpanel.add(saveTable);
         buttonpanel.add(saveHeaders);
-        
+
         graph.add(graphLabel);
         graph.add(graphTitle);
         graph.add(maxLengthXAxisLabel);
@@ -282,8 +282,8 @@
 
         this.add(mainPanel, BorderLayout.NORTH);
         this.add(spane,BorderLayout.CENTER);
-	}
-    
+    }
+
     public void makeGraph() {
         String wstr = graphWidth.getText();
         String hstr = graphHeight.getText();
@@ -315,7 +315,7 @@
         graph.setSize(new Dimension(graph.getWidth(), height + 120));
         spane.repaint();
     }
-    
+
     public double[][] getData() {
         if (model.getRowCount() > 1) {
             int count = model.getRowCount() -1;
@@ -326,9 +326,9 @@
             }
             return data;
         }
-		return new double[][]{ { 250, 45, 36, 66, 145, 80, 55  } };
+        return new double[][]{ { 250, 45, 36, 66, 145, 80, 55  } };
     }
-    
+
     public String[] getAxisLabels() {
         if (model.getRowCount() > 1) {
             int count = model.getRowCount() -1;
@@ -338,12 +338,12 @@
             }
             return labels;
         }
-		return new String[]{ "/", "/samples", "/jsp-samples", "/manager", "/manager/status", "/hello", "/world" };
+        return new String[]{ "/", "/samples", "/jsp-samples", "/manager", "/manager/status", "/hello", "/world" };
     }
-    
+
     /**
      * We use this method to get the data, since we are using
-     * ObjectTableModel, so the calling getDataVector doesn't 
+     * ObjectTableModel, so the calling getDataVector doesn't
      * work as expected.
      * @return the data from the model
      */
@@ -362,7 +362,7 @@
         }
         return data;
     }
-    
+
     public void actionPerformed(ActionEvent event) {
         if (event.getSource() == displayButton) {
             makeGraph();
@@ -373,10 +373,10 @@
                         ActionNames.SAVE_GRAPHICS,SaveGraphics.class.getName()).doAction(
                                 new ActionEvent(this,1,ActionNames.SAVE_GRAPHICS));
             } catch (Exception e) {
-            	log.error(e.getMessage());
+                log.error(e.getMessage());
             }
         } else if (event.getSource() == saveTable) {
-            JFileChooser chooser = FileDialoger.promptToSaveFile("statistics.csv");	//$NON-NLS-1$
+            JFileChooser chooser = FileDialoger.promptToSaveFile("statistics.csv");    //$NON-NLS-1$
             if (chooser == null) {
                 return;
             }
@@ -394,7 +394,7 @@
             }
         }
     }
-    
+
     public JComponent getPrintableComponent() {
         if (saveGraphToFile == true) {
             saveGraphToFile = false;
@@ -402,6 +402,6 @@
                     graphPanel.width,graphPanel.height);
             return graphPanel;
         }
-		return this;
+        return this;
     }
 }

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java?rev=674351&r1=674350&r2=674351&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java Sun Jul  6 14:47:12 2008
@@ -5,15 +5,15 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations
  * under the License.
- *  
+ *
  */
 
 package org.apache.jmeter.visualizers;
@@ -65,263 +65,263 @@
  * who've done the other visualizers ahead of me (Stefano Mazzocchi), who I
  * borrowed code from to start me off (and much code may still exist). Thank
  * you!
- * 
+ *
  */
 public class StatVisualizer extends AbstractVisualizer implements Clearable, ActionListener {
-    
-	private static final Logger log = LoggingManager.getLoggerForClass();
 
-    private final String[] COLUMNS = { 
+    private static final Logger log = LoggingManager.getLoggerForClass();
+
+    private final String[] COLUMNS = {
             JMeterUtils.getResString("sampler_label"),  //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_count"),  //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_count"),  //$NON-NLS-1$
             JMeterUtils.getResString("average"),  //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_median"),  //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_median"),  //$NON-NLS-1$
             JMeterUtils.getResString("aggregate_report_90%_line"),  //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_min"),  //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_min"),  //$NON-NLS-1$
             JMeterUtils.getResString("aggregate_report_max"),  //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_error%"),  //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_error%"),  //$NON-NLS-1$
             JMeterUtils.getResString("aggregate_report_rate"),  //$NON-NLS-1$
-			JMeterUtils.getResString("aggregate_report_bandwidth") };  //$NON-NLS-1$
+            JMeterUtils.getResString("aggregate_report_bandwidth") };  //$NON-NLS-1$
 
-	private final String TOTAL_ROW_LABEL 
+    private final String TOTAL_ROW_LABEL
         = JMeterUtils.getResString("aggregate_report_total_label");  //$NON-NLS-1$
 
-	protected JTable myJTable;
+    protected JTable myJTable;
+
+    protected JScrollPane myScrollPane;
 
-	protected JScrollPane myScrollPane;
+    protected JButton saveTable =
+        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));            //$NON-NLS-1$
 
-    protected JButton saveTable = 
-        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));			//$NON-NLS-1$
-    
-    private JCheckBox useGroupName = 
+    private JCheckBox useGroupName =
         new JCheckBox(JMeterUtils.getResString("aggregate_graph_use_group_name"));            //$NON-NLS-1$
-    
-	private transient ObjectTableModel model;
 
-	Map tableRows = Collections.synchronizedMap(new HashMap());
+    private transient ObjectTableModel model;
+
+    Map tableRows = Collections.synchronizedMap(new HashMap());
 
-	public StatVisualizer() {
-		super();
-		model = new ObjectTableModel(COLUMNS, 
-				SamplingStatCalculator.class,
-                new Functor[] { 
+    public StatVisualizer() {
+        super();
+        model = new ObjectTableModel(COLUMNS,
+                SamplingStatCalculator.class,
+                new Functor[] {
                     new Functor("getLabel"),   //$NON-NLS-1$
                     new Functor("getCount"),  //$NON-NLS-1$
-    				new Functor("getMeanAsNumber"),   //$NON-NLS-1$
+                    new Functor("getMeanAsNumber"),   //$NON-NLS-1$
                     new Functor("getMedian"),  //$NON-NLS-1$
-    				new Functor("getPercentPoint",  //$NON-NLS-1$
-                            new Object[] { new Float(.900) }), 
+                    new Functor("getPercentPoint",  //$NON-NLS-1$
+                            new Object[] { new Float(.900) }),
                     new Functor("getMin"),  //$NON-NLS-1$
                     new Functor("getMax"),   //$NON-NLS-1$
                     new Functor("getErrorPercentage"),   //$NON-NLS-1$
                     new Functor("getRate"),  //$NON-NLS-1$
-    				new Functor("getKBPerSecond")   //$NON-NLS-1$
+                    new Functor("getKBPerSecond")   //$NON-NLS-1$
                 },
-                new Functor[] { null, null, null, null, null, null, null, null, null, null }, 
-                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, 
+                new Functor[] { null, null, null, null, null, null, null, null, null, null },
+                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class,
                               Long.class, Long.class, String.class, String.class, String.class });
-		clearData();
-		init();
-	}
-
-	// Column renderers
-	private static final TableCellRenderer[] RENDERERS = 
-		new TableCellRenderer[]{
-		    null, // Label
-		    null, // count
-		    null, // Mean
-		    null, // median
-		    null, // 90%
-		    null, // Min
-		    null, // Max
-		    new NumberRenderer("#0.00%"), // Error %age //$NON-NLS-1$
-		    new RateRenderer("#.0"),      // Throughput //$NON-NLS-1$
-		    new NumberRenderer("#.0"),    // pageSize   //$NON-NLS-1$
-		};
-
-	public static boolean testFunctors(){
-		StatVisualizer instance = new StatVisualizer();
-		return instance.model.checkFunctors(null,instance.getClass());
-	}
-	
-	public String getLabelResource() {
-		return "aggregate_report";  //$NON-NLS-1$
-	}
+        clearData();
+        init();
+    }
+
+    // Column renderers
+    private static final TableCellRenderer[] RENDERERS =
+        new TableCellRenderer[]{
+            null, // Label
+            null, // count
+            null, // Mean
+            null, // median
+            null, // 90%
+            null, // Min
+            null, // Max
+            new NumberRenderer("#0.00%"), // Error %age //$NON-NLS-1$
+            new RateRenderer("#.0"),      // Throughput //$NON-NLS-1$
+            new NumberRenderer("#.0"),    // pageSize   //$NON-NLS-1$
+        };
+
+    public static boolean testFunctors(){
+        StatVisualizer instance = new StatVisualizer();
+        return instance.model.checkFunctors(null,instance.getClass());
+    }
+
+    public String getLabelResource() {
+        return "aggregate_report";  //$NON-NLS-1$
+    }
 
-	public void add(SampleResult res) {
-		SamplingStatCalculator row = null;
+    public void add(SampleResult res) {
+        SamplingStatCalculator row = null;
         final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
-		synchronized (tableRows) {
+        synchronized (tableRows) {
             row = (SamplingStatCalculator) tableRows.get(sampleLabel);
-			if (row == null) {
-				row = new SamplingStatCalculator(sampleLabel);
-				tableRows.put(row.getLabel(), row);
-				model.insertRow(row, model.getRowCount() - 1);
-			}
-		}
+            if (row == null) {
+                row = new SamplingStatCalculator(sampleLabel);
+                tableRows.put(row.getLabel(), row);
+                model.insertRow(row, model.getRowCount() - 1);
+            }
+        }
         /*
          * Synch is needed because multiple threads can update the counts.
          */
-        synchronized(row) { 
+        synchronized(row) {
             row.addSample(res);
         }
-		SamplingStatCalculator tot = (SamplingStatCalculator) tableRows.get(TOTAL_ROW_LABEL);
-		synchronized(tot) {
-		    tot.addSample(res);
-		}
-		model.fireTableDataChanged();
-	}
-
-	/**
-	 * Clears this visualizer and its model, and forces a repaint of the table.
-	 */
-	public void clearData() {
-	    synchronized (tableRows) {
-    		model.clearData();
-    		tableRows.clear();
-    		tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL));
-    		model.addRow(tableRows.get(TOTAL_ROW_LABEL));
-	    }
-	}
-
-	/**
-	 * Main visualizer setup.
-	 */
-	private void init() {
-		this.setLayout(new BorderLayout());
-
-		// MAIN PANEL
-		JPanel mainPanel = new JPanel();
-		Border margin = new EmptyBorder(10, 10, 5, 10);
-
-		mainPanel.setBorder(margin);
-		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
-
-		mainPanel.add(makeTitlePanel());
-
-		// SortFilterModel mySortedModel =
-		// new SortFilterModel(myStatTableModel);
-		myJTable = new JTable(model);
-		myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70));
-		RendererUtils.applyRenderers(myJTable, RENDERERS);
-		myScrollPane = new JScrollPane(myJTable);
-		this.add(mainPanel, BorderLayout.NORTH);
-		this.add(myScrollPane, BorderLayout.CENTER);
-		saveTable.addActionListener(this);
+        SamplingStatCalculator tot = (SamplingStatCalculator) tableRows.get(TOTAL_ROW_LABEL);
+        synchronized(tot) {
+            tot.addSample(res);
+        }
+        model.fireTableDataChanged();
+    }
+
+    /**
+     * Clears this visualizer and its model, and forces a repaint of the table.
+     */
+    public void clearData() {
+        synchronized (tableRows) {
+            model.clearData();
+            tableRows.clear();
+            tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL));
+            model.addRow(tableRows.get(TOTAL_ROW_LABEL));
+        }
+    }
+
+    /**
+     * Main visualizer setup.
+     */
+    private void init() {
+        this.setLayout(new BorderLayout());
+
+        // MAIN PANEL
+        JPanel mainPanel = new JPanel();
+        Border margin = new EmptyBorder(10, 10, 5, 10);
+
+        mainPanel.setBorder(margin);
+        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
+
+        mainPanel.add(makeTitlePanel());
+
+        // SortFilterModel mySortedModel =
+        // new SortFilterModel(myStatTableModel);
+        myJTable = new JTable(model);
+        myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70));
+        RendererUtils.applyRenderers(myJTable, RENDERERS);
+        myScrollPane = new JScrollPane(myJTable);
+        this.add(mainPanel, BorderLayout.NORTH);
+        this.add(myScrollPane, BorderLayout.CENTER);
+        saveTable.addActionListener(this);
         JPanel opts = new JPanel();
         opts.add(useGroupName, BorderLayout.WEST);
         opts.add(saveTable, BorderLayout.CENTER);
         this.add(opts,BorderLayout.SOUTH);
-	}
+    }
 
-	public void actionPerformed(ActionEvent ev) {
-		if (ev.getSource() == saveTable) {
-	        JFileChooser chooser = FileDialoger.promptToSaveFile("aggregate.csv");//$NON-NLS-1$
-	        if (chooser == null) {
-	            return;
-	        }
-			FileWriter writer = null;
-			try {
-			    writer = new FileWriter(chooser.getSelectedFile());
-			    CSVSaveService.saveCSVStats(model,writer);
-			} catch (FileNotFoundException e) {
-			    log.warn(e.getMessage());
-			} catch (IOException e) {
-			    log.warn(e.getMessage());
-			} finally {
-			    JOrphanUtils.closeQuietly(writer);
-			}
-		}
-	}
+    public void actionPerformed(ActionEvent ev) {
+        if (ev.getSource() == saveTable) {
+            JFileChooser chooser = FileDialoger.promptToSaveFile("aggregate.csv");//$NON-NLS-1$
+            if (chooser == null) {
+                return;
+            }
+            FileWriter writer = null;
+            try {
+                writer = new FileWriter(chooser.getSelectedFile());
+                CSVSaveService.saveCSVStats(model,writer);
+            } catch (FileNotFoundException e) {
+                log.warn(e.getMessage());
+            } catch (IOException e) {
+                log.warn(e.getMessage());
+            } finally {
+                JOrphanUtils.closeQuietly(writer);
+            }
+        }
+    }
 }
 
 /**
  * Pulled this mainly out of a Core Java book to implement a sorted table -
  * haven't implemented this yet, it needs some non-trivial work done to it to
  * support our dynamically-sizing TableModel for this visualizer.
- * 
+ *
  */
 
 //class SortFilterModel extends AbstractTableModel {
-//	private TableModel model;
+//  private TableModel model;
 //
-//	private int sortColumn;
+//  private int sortColumn;
 //
-//	private Row[] rows;
+//  private Row[] rows;
 //
-//	public SortFilterModel(TableModel m) {
-//		model = m;
-//		rows = new Row[model.getRowCount()];
-//		for (int i = 0; i < rows.length; i++) {
-//			rows[i] = new Row();
-//			rows[i].index = i;
-//		}
-//	}
-//
-//	public SortFilterModel() {
-//	}
-//
-//	public void setValueAt(Object aValue, int r, int c) {
-//		model.setValueAt(aValue, rows[r].index, c);
-//	}
-//
-//	public Object getValueAt(int r, int c) {
-//		return model.getValueAt(rows[r].index, c);
-//	}
-//
-//	public boolean isCellEditable(int r, int c) {
-//		return model.isCellEditable(rows[r].index, c);
-//	}
-//
-//	public int getRowCount() {
-//		return model.getRowCount();
-//	}
-//
-//	public int getColumnCount() {
-//		return model.getColumnCount();
-//	}
-//
-//	public String getColumnName(int c) {
-//		return model.getColumnName(c);
-//	}
-//
-//	public Class getColumnClass(int c) {
-//		return model.getColumnClass(c);
-//	}
-//
-//	public void sort(int c) {
-//		sortColumn = c;
-//		Arrays.sort(rows);
-//		fireTableDataChanged();
-//	}
-//
-//	public void addMouseListener(final JTable table) {
-//		table.getTableHeader().addMouseListener(new MouseAdapter() {
-//			public void mouseClicked(MouseEvent event) {
-//				if (event.getClickCount() < 2) {
-//					return;
-//				}
-//				int tableColumn = table.columnAtPoint(event.getPoint());
-//				int modelColumn = table.convertColumnIndexToModel(tableColumn);
-//
-//				sort(modelColumn);
-//			}
-//		});
-//	}
-//
-//	private class Row implements Comparable {
-//		public int index;
-//
-//		public int compareTo(Object other) {
-//			Row otherRow = (Row) other;
-//			Object a = model.getValueAt(index, sortColumn);
-//			Object b = model.getValueAt(otherRow.index, sortColumn);
-//
-//			if (a instanceof Comparable) {
-//				return ((Comparable) a).compareTo(b);
-//			} else {
-//				return index - otherRow.index;
-//			}
-//		}
-//	}
+//  public SortFilterModel(TableModel m) {
+//      model = m;
+//      rows = new Row[model.getRowCount()];
+//      for (int i = 0; i < rows.length; i++) {
+//          rows[i] = new Row();
+//          rows[i].index = i;
+//      }
+//  }
+//
+//  public SortFilterModel() {
+//  }
+//
+//  public void setValueAt(Object aValue, int r, int c) {
+//        model.setValueAt(aValue, rows[r].index, c);
+//    }
+//
+//    public Object getValueAt(int r, int c) {
+//        return model.getValueAt(rows[r].index, c);
+//    }
+//
+//    public boolean isCellEditable(int r, int c) {
+//        return model.isCellEditable(rows[r].index, c);
+//    }
+//
+//    public int getRowCount() {
+//        return model.getRowCount();
+//    }
+//
+//    public int getColumnCount() {
+//        return model.getColumnCount();
+//    }
+//
+//    public String getColumnName(int c) {
+//        return model.getColumnName(c);
+//    }
+//
+//    public Class getColumnClass(int c) {
+//        return model.getColumnClass(c);
+//    }
+//
+//    public void sort(int c) {
+//        sortColumn = c;
+//        Arrays.sort(rows);
+//        fireTableDataChanged();
+//    }
+//
+//    public void addMouseListener(final JTable table) {
+//        table.getTableHeader().addMouseListener(new MouseAdapter() {
+//            public void mouseClicked(MouseEvent event) {
+//                if (event.getClickCount() < 2) {
+//                    return;
+//                }
+//                int tableColumn = table.columnAtPoint(event.getPoint());
+//                int modelColumn = table.convertColumnIndexToModel(tableColumn);
+//
+//                sort(modelColumn);
+//            }
+//        });
+//    }
+//
+//    private class Row implements Comparable {
+//        public int index;
+//
+//        public int compareTo(Object other) {
+//            Row otherRow = (Row) other;
+//            Object a = model.getValueAt(index, sortColumn);
+//            Object b = model.getValueAt(otherRow.index, sortColumn);
+//
+//            if (a instanceof Comparable) {
+//                return ((Comparable) a).compareTo(b);
+//            } else {
+//                return index - otherRow.index;
+//            }
+//        }
+//    }
 //} // class SortFilterModel



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org