亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? numberaxistests.java

?? jfreechart1.0.1 jsp繪制圖表的開發包
?? JAVA
字號:
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2006, 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.]
 *
 * --------------------
 * NumberAxisTests.java
 * --------------------
 * (C) Copyright 2003-2006, by Object Refinery Limited and Contributors.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: NumberAxisTests.java,v 1.4.2.2 2006/01/11 11:27:34 mungady Exp $
 *
 * Changes
 * -------
 * 26-Mar-2003 : Version 1 (DG);
 * 14-Aug-2003 : Added tests for equals() method (DG);
 * 05-Oct-2004 : Added tests to pick up a bug in the auto-range calculation for
 *               a domain axis on an XYPlot using an XYSeriesCollection (DG);
 * 07-Jan-2005 : Added test for hashCode() (DG);
 * 11-Jan-2006 : Fixed testAutoRange2() and testAutoRange3() following changes 
 *               to BarRenderer (DG);
 *
 */

package org.jfree.chart.axis.junit;


import java.awt.geom.Rectangle2D;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.text.DecimalFormat;

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.NumberTickUnit;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.RectangleEdge;

/**
 * Tests for the {@link NumberAxis} class.
 */
public class NumberAxisTests extends TestCase {

    /**
     * Returns the tests as a test suite.
     *
     * @return The test suite.
     */
    public static Test suite() {
        return new TestSuite(NumberAxisTests.class);
    }

    /**
     * Constructs a new set of tests.
     *
     * @param name  the name of the tests.
     */
    public NumberAxisTests(String name) {
        super(name);
    }
    
    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        NumberAxis a1 = new NumberAxis("Test");
        NumberAxis a2 = null;
        try {
            a2 = (NumberAxis) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        
        NumberAxis a1 = new NumberAxis("Test");
        NumberAxis a2 = new NumberAxis("Test");
        assertTrue(a1.equals(a2));
        
        //private boolean autoRangeIncludesZero;
        a1.setAutoRangeIncludesZero(false);
        assertFalse(a1.equals(a2));
        a2.setAutoRangeIncludesZero(false);
        assertTrue(a1.equals(a2));

        //private boolean autoRangeStickyZero;
        a1.setAutoRangeStickyZero(false);
        assertFalse(a1.equals(a2));
        a2.setAutoRangeStickyZero(false);
        assertTrue(a1.equals(a2));

        //private NumberTickUnit tickUnit;
        a1.setTickUnit(new NumberTickUnit(25.0));
        assertFalse(a1.equals(a2));
        a2.setTickUnit(new NumberTickUnit(25.0));
        assertTrue(a1.equals(a2));

        //private NumberFormat numberFormatOverride;
        a1.setNumberFormatOverride(new DecimalFormat("0.00"));
        assertFalse(a1.equals(a2));
        a2.setNumberFormatOverride(new DecimalFormat("0.00"));
        assertTrue(a1.equals(a2));

    }

    /**
     * Two objects that are equal are required to return the same hashCode. 
     */
    public void testHashCode() {
        NumberAxis a1 = new NumberAxis("Test");
        NumberAxis a2 = new NumberAxis("Test");
        assertTrue(a1.equals(a2));
        int h1 = a1.hashCode();
        int h2 = a2.hashCode();
        assertEquals(h1, h2);
    }

    private static final double EPSILON = 0.0000001;
    
    /**
     * Test the translation of Java2D values to data values.
     */
    public void testTranslateJava2DToValue() {
        NumberAxis axis = new NumberAxis();
        axis.setRange(50.0, 100.0); 
        Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0);
        double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);  
        assertEquals(y1, 95.8333333, EPSILON); 
        double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);   
        assertEquals(y2, 95.8333333, EPSILON); 
        double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);   
        assertEquals(x1, 58.125, EPSILON); 
        double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);   
        assertEquals(x2, 58.125, EPSILON); 
        axis.setInverted(true);
        double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);  
        assertEquals(y3, 54.1666667, EPSILON); 
        double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);   
        assertEquals(y4, 54.1666667, EPSILON); 
        double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);   
        assertEquals(x3, 91.875, EPSILON); 
        double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);   
        assertEquals(x4, 91.875, EPSILON); 
        
    }
    
    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        NumberAxis a1 = new NumberAxis("Test Axis");
        NumberAxis a2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(a1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                new ByteArrayInputStream(buffer.toByteArray())
            );
            a2 = (NumberAxis) in.readObject();
            in.close();
        }
        catch (Exception e) {
            System.out.println(e.toString());
        }
        assertEquals(a1, a2);

    }

    /**
     * A simple test for the auto-range calculation looking at a
     * NumberAxis used as the range axis for a CategoryPlot.
     */
    public void testAutoRange1() {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.setValue(100.0, "Row 1", "Column 1");
        dataset.setValue(200.0, "Row 1", "Column 2");
        JFreeChart chart = ChartFactory.createBarChart(
            "Test", 
            "Categories",
            "Value",
            dataset,
            PlotOrientation.VERTICAL,
            false, 
            false,
            false
        );
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        NumberAxis axis = (NumberAxis) plot.getRangeAxis();
        assertEquals(axis.getLowerBound(), 0.0, EPSILON);    
        assertEquals(axis.getUpperBound(), 210.0, EPSILON);    
    }
    
    /**
     * A simple test for the auto-range calculation looking at a
     * NumberAxis used as the range axis for a CategoryPlot.  In this
     * case, the 'autoRangeIncludesZero' flag is set to false.
     */
    public void testAutoRange2() {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.setValue(100.0, "Row 1", "Column 1");
        dataset.setValue(200.0, "Row 1", "Column 2");
        JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",
                "Value", dataset, PlotOrientation.VERTICAL, false, false,
                false);
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        NumberAxis axis = (NumberAxis) plot.getRangeAxis();
        axis.setAutoRangeIncludesZero(false);
        assertEquals(axis.getLowerBound(), 95.0, EPSILON);    
        assertEquals(axis.getUpperBound(), 205.0, EPSILON);    
    }
    
    /**
     * A simple test for the auto-range calculation looking at a
     * NumberAxis used as the range axis for a CategoryPlot.  In this
     * case, the 'autoRangeIncludesZero' flag is set to false AND the
     * original dataset is replaced with a new dataset.
     */
    public void testAutoRange3() {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.setValue(100.0, "Row 1", "Column 1");
        dataset.setValue(200.0, "Row 1", "Column 2");
        JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",
                "Value", dataset, PlotOrientation.VERTICAL, false, false,
                false);
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        NumberAxis axis = (NumberAxis) plot.getRangeAxis();
        axis.setAutoRangeIncludesZero(false);
        assertEquals(axis.getLowerBound(), 95.0, EPSILON);    
        assertEquals(axis.getUpperBound(), 205.0, EPSILON);    
        
        // now replacing the dataset should update the axis range...
        DefaultCategoryDataset dataset2 = new DefaultCategoryDataset();
        dataset2.setValue(900.0, "Row 1", "Column 1");
        dataset2.setValue(1000.0, "Row 1", "Column 2");
        plot.setDataset(dataset2);
        assertEquals(axis.getLowerBound(), 895.0, EPSILON);    
        assertEquals(axis.getUpperBound(), 1005.0, EPSILON);    
    }
    
    /**
     * Checks that the auto-range for the domain axis on an XYPlot is
     * working as expected.
     */
    public void testXYAutoRange1() {
        XYSeries series = new XYSeries("Series 1");
        series.add(1.0, 1.0);
        series.add(2.0, 2.0);
        series.add(3.0, 3.0);
        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(series);
        JFreeChart chart = ChartFactory.createScatterPlot(
            "Test", 
            "X",
            "Y",
            dataset,
            PlotOrientation.VERTICAL,
            false, 
            false,
            false
        );
        XYPlot plot = (XYPlot) chart.getPlot();
        NumberAxis axis = (NumberAxis) plot.getDomainAxis();
        axis.setAutoRangeIncludesZero(false);
        assertEquals(0.9, axis.getLowerBound(), EPSILON);    
        assertEquals(3.1, axis.getUpperBound(), EPSILON);    
    }
    
    /**
     * Checks that the auto-range for the range axis on an XYPlot is
     * working as expected.
     */
    public void testXYAutoRange2() {
        XYSeries series = new XYSeries("Series 1");
        series.add(1.0, 1.0);
        series.add(2.0, 2.0);
        series.add(3.0, 3.0);
        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(series);
        JFreeChart chart = ChartFactory.createScatterPlot(
            "Test", 
            "X",
            "Y",
            dataset,
            PlotOrientation.VERTICAL,
            false, 
            false,
            false
        );
        XYPlot plot = (XYPlot) chart.getPlot();
        NumberAxis axis = (NumberAxis) plot.getRangeAxis();
        axis.setAutoRangeIncludesZero(false);
        assertEquals(0.9, axis.getLowerBound(), EPSILON);    
        assertEquals(3.1, axis.getUpperBound(), EPSILON);    
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费视频成人| 无码av中文一区二区三区桃花岛| 国产高清精品在线| 26uuu亚洲综合色| 精品午夜一区二区三区在线观看| 91精品国产福利| 五月天久久比比资源色| 欧美性极品少妇| 性欧美疯狂xxxxbbbb| 欧美人与z0zoxxxx视频| 亚洲国产一区二区三区 | 成人av在线资源网站| 国产人妖乱国产精品人妖| 国产福利91精品| 亚洲国产精品av| 91丨九色丨蝌蚪丨老版| 亚洲素人一区二区| 欧美在线观看你懂的| 亚洲一级不卡视频| 777午夜精品免费视频| 免费观看在线综合| 亚洲精品一区二区三区福利| 国产在线视视频有精品| 久久伊人中文字幕| 久久国产精品露脸对白| 精品福利一二区| 久久99久久精品| 精品国产亚洲一区二区三区在线观看| 久久国产成人午夜av影院| 欧美成人官网二区| 国产裸体歌舞团一区二区| 国产欧美日韩综合精品一区二区| 国产乱淫av一区二区三区| 久久久久久久久久久久久女国产乱| 久久国产精品99久久久久久老狼 | a级精品国产片在线观看| 国产精品免费丝袜| 99精品久久只有精品| 亚洲女与黑人做爰| 欧美性videosxxxxx| 日韩精品一级二级| 欧美成人乱码一区二区三区| 奇米精品一区二区三区四区| 日韩欧美在线综合网| 精品一区二区久久| 日本一区二区三区在线不卡| 成人福利在线看| 亚洲精品视频一区| 欧美日韩国产一区二区三区地区| 亚洲成年人网站在线观看| 久久五月婷婷丁香社区| 91麻豆文化传媒在线观看| 亚洲v中文字幕| 欧美一级在线观看| 国产精品资源在线观看| 亚洲欧洲精品一区二区精品久久久| 在线免费观看一区| 免费在线观看一区二区三区| 久久婷婷成人综合色| 91在线视频播放地址| 首页国产丝袜综合| 久久久久久免费| 色偷偷一区二区三区| 三级亚洲高清视频| 国产午夜精品一区二区| 色婷婷精品久久二区二区蜜臂av| 午夜精品久久久久久久99水蜜桃 | 成人看片黄a免费看在线| 国产精品乱人伦中文| 色婷婷激情综合| 狠狠网亚洲精品| 亚洲欧美另类综合偷拍| 666欧美在线视频| 丁香亚洲综合激情啪啪综合| 亚洲一区二区三区三| 久久一二三国产| 日本乱人伦aⅴ精品| 另类人妖一区二区av| ...中文天堂在线一区| 91精选在线观看| 波多野结衣视频一区| 日本强好片久久久久久aaa| 中文字幕av资源一区| 日韩三级免费观看| 在线观看网站黄不卡| 国产真实精品久久二三区| 亚洲在线免费播放| 国产区在线观看成人精品| 色综合中文字幕| 国产成人精品影院| 日韩专区中文字幕一区二区| 国产拍揄自揄精品视频麻豆| 欧美人伦禁忌dvd放荡欲情| 国产成人精品综合在线观看| 午夜精品福利在线| 国产精品成人网| 日韩美女视频在线| 欧美性猛交xxxx黑人交| 高清成人免费视频| 美女被吸乳得到大胸91| 一区二区三区日本| 国产欧美一区二区精品性| 欧美视频在线观看一区二区| 成人午夜看片网址| 韩国av一区二区三区四区| 亚瑟在线精品视频| 亚洲免费三区一区二区| 久久蜜桃一区二区| 欧美高清www午色夜在线视频| www.日韩av| 国产大陆a不卡| 精品中文av资源站在线观看| 香蕉久久一区二区不卡无毒影院| 国产精品久久久久久户外露出| 日韩视频在线观看一区二区| 欧美亚洲一区二区三区四区| 成人av在线播放网站| 国产精品综合二区| 久久激情五月激情| 午夜精品福利一区二区三区蜜桃| 亚洲一区二区四区蜜桃| 亚洲精品免费在线| 亚洲丝袜美腿综合| 欧美国产日本视频| 久久人人爽爽爽人久久久| 欧美精品久久99久久在免费线| 欧美性大战久久| 91久久人澡人人添人人爽欧美| 波多野结衣中文一区| 国产成人啪免费观看软件| 久久成人18免费观看| 三级影片在线观看欧美日韩一区二区| 亚洲图片激情小说| 中文字幕亚洲不卡| 国产精品久久福利| 国产精品色在线观看| 国产欧美视频在线观看| 久久久久久久久岛国免费| 精品国产1区二区| xfplay精品久久| 亚洲精品一区二区三区四区高清| 日韩欧美一区在线观看| 欧美日韩不卡一区| 在线一区二区视频| 色综合久久中文字幕| 91老师片黄在线观看| 色综合久久综合网97色综合| 99re这里只有精品首页| 99久久久精品| 91免费看视频| 在线免费观看一区| 欧美情侣在线播放| 91精品蜜臀在线一区尤物| 91精品国产手机| 9191精品国产综合久久久久久| 欧美最猛性xxxxx直播| 欧美日韩高清一区二区不卡| 在线不卡免费av| 69久久99精品久久久久婷婷| 欧美一激情一区二区三区| 国产午夜精品一区二区三区嫩草 | 亚洲一区二三区| 五月天激情小说综合| 日韩专区一卡二卡| 麻豆一区二区三区| 国产乱码精品1区2区3区| 成人三级在线视频| 不卡av免费在线观看| 不卡av在线免费观看| 欧美亚洲丝袜传媒另类| 91 com成人网| 久久噜噜亚洲综合| 中文字幕人成不卡一区| 亚洲精品国久久99热| 亚洲国产一区在线观看| 蜜臀久久99精品久久久画质超高清| 九九九久久久精品| 成人av集中营| fc2成人免费人成在线观看播放 | 极品尤物av久久免费看| 国产一区二区三区在线观看免费视频 | 亚洲欧洲中文日韩久久av乱码| 亚洲综合一区二区三区| 日本不卡高清视频| 国产精品一区二区无线| 91在线高清观看| 欧美精品一二三| 91精品啪在线观看国产60岁| 午夜电影网亚洲视频| 久久精品72免费观看| av一区二区三区黑人| 日韩一区和二区| 中文字幕在线观看一区| 婷婷六月综合网| 国产成人免费网站| 91黄视频在线| 久久久久99精品国产片| 亚洲永久免费视频| 国产精品一区二区三区乱码| 日本韩国一区二区|