Distributed Genetic Programming Framework
print print

File org.jfree.chart.axis.junit.ValueAxisTests.java

Here you can find all the information about the file org.jfree.chart.axis.junit.ValueAxisTests.java. You may explore it here or download it onto your local disk.
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 * -------------------
 * ValueAxisTests.java
 * -------------------
 * (C) Copyright 2003-2005, by Object Refinery Limited and Contributors.
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 * $Id: ValueAxisTests.java,v 2005/10/25 20:38:51 mungady Exp $
 * Changes
 * -------
 * 13-Aug-2003 : Version 1 (DG);

package org.jfree.chart.axis.junit;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Stroke;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.Range;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

 * Tests for the {@link ValueAxis} class.

public class ValueAxisTests extends TestCase {

    private static final double EPSILON = 0.000000001;
     * Returns the tests as a test suite.
     * @return The test suite.

    public static Test suite() {
        return new TestSuite(ValueAxisTests.class);

     * Constructs a new set of tests.
     * @param name  the name of the tests.

    public ValueAxisTests(String name) {

     * Confirm that cloning works.

    public void testCloning() {
        ValueAxis a1 = new NumberAxis("Test");
        ValueAxis a2 = null;
        try {
            a2 = (NumberAxis) a1.clone();
        catch (CloneNotSupportedException e) {
            System.err.println("ValueAxisTests.testCloning: failed to clone.");
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());

     * Confirm that the equals method can distinguish all the required fields.

    public void testEquals() {
        NumberAxis a1 = new NumberAxis("Test");
        NumberAxis a2 = new NumberAxis("Test");
        // axis line visible flag...
        // positiveArrowVisible;
        // negativeArrowVisible;
        //private Shape upArrow;
        //private Shape downArrow;
        //private Shape leftArrow;
        //private Shape rightArrow;
        // axisLinePaint
        // axisLineStroke 
        Stroke stroke = new BasicStroke(2.0f);
        // inverted
        // range 
        a1.setRange(new Range(50.0, 75.0));
        a2.setRange(new Range(50.0, 75.0));

        // autoRange 

        // autoRangeMinimumSize

        // upperMargin

        // lowerMargin

        //private double fixedAutoRange;

        //private boolean autoTickUnitSelection;

        //private TickUnits standardTickUnits;

        // verticalTickLabels

        //private int autoTickIndex;
        //protected double reservedForTickLabels;  
        //protected double reservedForAxisLabel;

     * Tests the the lower and upper margin settings produce the expected 
     * results.

    public void testAxisMargins() {
        XYSeries series = new XYSeries("S1");
        series.add(100.0, 1.1);
        series.add(200.0, 2.2);
        XYSeriesCollection dataset = new XYSeriesCollection(series);
        JFreeChart chart = ChartFactory.createScatterPlot(
            "Title""X""Y", dataset, PlotOrientation.VERTICAL, 
            false, false, false
        ValueAxis domainAxis = chart.getXYPlot().getDomainAxis();
        Range r = domainAxis.getRange();
        assertEquals(110.0, r.getLength(), EPSILON);
        r = domainAxis.getRange();
        assertEquals(120.0, r.getLength(), EPSILON);

File Information:

file name:ValueAxisTests.java
qualified name:org.jfree.chart.axis.junit.ValueAxisTests.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/jfree/chart/axis/junit/ValueAxisTests.java
size:7.458 KB (7637 B)
uploaded: 2018-01-07 12:03:35 GMT+0000
last update: 2006-08-25 12:16:44 GMT+0000
last access: 2018-03-23 05:18:28 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2018-01-07 12:03:34 GMT+0000 served at 2018-03-23 05:18:28 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo