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

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

?? xyplottests.java

?? Web圖形化的Java庫
?? JAVA
字號:
/* ======================================
 * JFreeChart : a free Java chart library
 * ======================================
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 * Project Lead:  David Gilbert (david.gilbert@object-refinery.com);
 *
 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors.
 *
 * 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., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * ----------------
 * XYPlotTests.java
 * ----------------
 * (C) Copyright 2003 by Object Refinery Limited and Contributors.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: XYPlotTests.java,v 1.12 2003/08/20 11:58:09 mungady Exp $
 *
 * Changes
 * -------
 * 26-Mar-2003 : Version 1 (DG);
 *
 */

package org.jfree.chart.plot.junit;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Stroke;
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 junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.jfree.chart.Marker;
import org.jfree.chart.Spacer;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.labels.TimeSeriesToolTipGenerator;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.DefaultXYItemRenderer;
import org.jfree.chart.renderer.StandardXYItemRenderer;
import org.jfree.chart.renderer.XYBarRenderer;
import org.jfree.chart.renderer.XYItemRenderer;
import org.jfree.data.IntervalXYDataset;
import org.jfree.data.XYDataset;
import org.jfree.data.XYSeriesCollection;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.date.SerialDate;

/**
 * Tests for the {@link XYPlot} class.
 *
 * @author David Gilbert
 */
public class XYPlotTests extends TestCase {

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

    /**
     * Constructs a new set of tests.
     *
     * @param  name the name of the tests.
     */
    public XYPlotTests(String name) {
        super(name);
    }

    /**
     * Test the equals method.
     */
    public void testEquals() {
        
        XYPlot plot1 = new XYPlot();
        XYPlot plot2 = new XYPlot();
        assertTrue(plot1.equals(plot2));    
        
        // orientation...
        plot1.setOrientation(PlotOrientation.HORIZONTAL);
        assertFalse(plot1.equals(plot2));
        plot2.setOrientation(PlotOrientation.HORIZONTAL);
        assertTrue(plot1.equals(plot2));
        
        // axisOffset...
        plot1.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 0.05, 0.05, 0.05, 0.05));
        assertFalse(plot1.equals(plot2));
        plot2.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 0.05, 0.05, 0.05, 0.05));
        assertTrue(plot1.equals(plot2));

        // domainAxis...
        plot1.setDomainAxis(new NumberAxis("Domain Axis"));
        assertFalse(plot1.equals(plot2));
        plot2.setDomainAxis(new NumberAxis("Domain Axis"));
        assertTrue(plot1.equals(plot2));

        // domainAxisLocation...
        plot1.setDomainAxisLocation(AxisLocation.TOP_OR_RIGHT);
        assertFalse(plot1.equals(plot2));
        plot2.setDomainAxisLocation(AxisLocation.TOP_OR_RIGHT);
        assertTrue(plot1.equals(plot2));

        // secondaryDomainAxes...
        plot1.setSecondaryDomainAxis(11, new NumberAxis("Secondary Domain Axis"));
        assertFalse(plot1.equals(plot2));
        plot2.setSecondaryDomainAxis(11, new NumberAxis("Secondary Domain Axis"));
        assertTrue(plot1.equals(plot2));

        // secondaryDomainAxisLocations...
        plot1.setSecondaryDomainAxisLocation(11, AxisLocation.TOP_OR_RIGHT);
        assertFalse(plot1.equals(plot2));
        plot2.setSecondaryDomainAxisLocation(11, AxisLocation.TOP_OR_RIGHT);
        assertTrue(plot1.equals(plot2));

        // rangeAxis...
        plot1.setRangeAxis(new NumberAxis("Range Axis"));
        assertFalse(plot1.equals(plot2));
        plot2.setRangeAxis(new NumberAxis("Range Axis"));
        assertTrue(plot1.equals(plot2));

        // rangeAxisLocation...
        plot1.setRangeAxisLocation(AxisLocation.TOP_OR_RIGHT);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeAxisLocation(AxisLocation.TOP_OR_RIGHT);
        assertTrue(plot1.equals(plot2));

        // secondaryRangeAxes...
        plot1.setSecondaryRangeAxis(11, new NumberAxis("Secondary Range Axis"));
        assertFalse(plot1.equals(plot2));
        plot2.setSecondaryRangeAxis(11, new NumberAxis("Secondary Range Axis"));
        assertTrue(plot1.equals(plot2));

        // secondaryRangeAxisLocations...
        plot1.setSecondaryRangeAxisLocation(11, AxisLocation.TOP_OR_RIGHT);
        assertFalse(plot1.equals(plot2));
        plot2.setSecondaryRangeAxisLocation(11, AxisLocation.TOP_OR_RIGHT);
        assertTrue(plot1.equals(plot2));
        
        // secondaryDatasetDomainAxisMap...
        plot1.mapSecondaryDatasetToDomainAxis(11, new Integer(11));
        assertFalse(plot1.equals(plot2));
        plot2.mapSecondaryDatasetToDomainAxis(11, new Integer(11));
        assertTrue(plot1.equals(plot2));

        // secondaryDatasetRangeAxisMap...
        plot1.mapSecondaryDatasetToRangeAxis(11, new Integer(11));
        assertFalse(plot1.equals(plot2));
        plot2.mapSecondaryDatasetToRangeAxis(11, new Integer(11));
        assertTrue(plot1.equals(plot2));
        
        // renderer
        plot1.setRenderer(new DefaultXYItemRenderer());
        assertFalse(plot1.equals(plot2));
        plot2.setRenderer(new DefaultXYItemRenderer());
        assertTrue(plot1.equals(plot2));
        
        // secondary renderers
        plot1.setSecondaryRenderer(11, new DefaultXYItemRenderer());
        assertFalse(plot1.equals(plot2));
        plot2.setSecondaryRenderer(11, new DefaultXYItemRenderer());
        assertTrue(plot1.equals(plot2));
        
        // domainGridlinesVisible
        plot1.setDomainGridlinesVisible(false);
        assertFalse(plot1.equals(plot2));
        plot2.setDomainGridlinesVisible(false);
        assertTrue(plot1.equals(plot2));

        // domainGridlineStroke
        Stroke stroke = new BasicStroke(2.0f);
        plot1.setDomainGridlineStroke(stroke);
        assertFalse(plot1.equals(plot2));
        plot2.setDomainGridlineStroke(stroke);
        assertTrue(plot1.equals(plot2));
        
        // domainGridlinePaint
        plot1.setDomainGridlinePaint(Color.blue);
        assertFalse(plot1.equals(plot2));
        plot2.setDomainGridlinePaint(Color.blue);
        assertTrue(plot1.equals(plot2));
        
        // rangeGridlinesVisible
        plot1.setRangeGridlinesVisible(false);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeGridlinesVisible(false);
        assertTrue(plot1.equals(plot2));

        // rangeGridlineStroke
        plot1.setRangeGridlineStroke(stroke);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeGridlineStroke(stroke);
        assertTrue(plot1.equals(plot2));
        
        // rangeGridlinePaint
        plot1.setRangeGridlinePaint(Color.blue);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeGridlinePaint(Color.blue);
        assertTrue(plot1.equals(plot2));
                
        // rangeCrosshairVisible
        plot1.setRangeCrosshairVisible(true);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeCrosshairVisible(true);
        assertTrue(plot1.equals(plot2));
        
        // rangeCrosshairValue
        plot1.setRangeCrosshairValue(100.0);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeCrosshairValue(100.0);
        assertTrue(plot1.equals(plot2));
        
        // rangeCrosshairStroke
        plot1.setRangeCrosshairStroke(stroke);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeCrosshairStroke(stroke);
        assertTrue(plot1.equals(plot2));
        
        // rangeCrosshairPaint
        plot1.setRangeCrosshairPaint(Color.red);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeCrosshairPaint(Color.red);
        assertTrue(plot1.equals(plot2));
        
        // rangeCrosshairLockedOnData
        plot1.setRangeCrosshairLockedOnData(false);
        assertFalse(plot1.equals(plot2));
        plot2.setRangeCrosshairLockedOnData(false);
        assertTrue(plot1.equals(plot2));
        
        // range markers
        plot1.addRangeMarker(new Marker(4.0));
        assertFalse(plot1.equals(plot2));
        plot2.addRangeMarker(new Marker(4.0));
        assertTrue(plot1.equals(plot2));
        
        // secondary range markers
        plot1.addSecondaryRangeMarker(new Marker(4.0));
        assertFalse(plot1.equals(plot2));
        plot2.addSecondaryRangeMarker(new Marker(4.0));
        assertTrue(plot1.equals(plot2));
                
        // weight
        plot1.setWeight(3);
        assertFalse(plot1.equals(plot2));
        plot2.setWeight(3);
        assertTrue(plot1.equals(plot2));
        
    }

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYPlot p1 = new XYPlot();
        XYPlot p2 = null;
        try {
            p2 = (XYPlot) p1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
            System.err.println("XYPlotTests.testCloning: failed to clone.");
        }
        assertTrue(p1 != p2);
        assertTrue(p1.getClass() == p2.getClass());
        assertTrue(p1.equals(p2));
    }
    
    /**
     * Setting a null renderer should be allowed, but is generating a null pointer exception in
     * 0.9.7.
     */
    public void testSetNullRenderer() {

        boolean failed = false;
        try {
            XYPlot plot = new XYPlot(null, new NumberAxis("X"), new NumberAxis("Y"), null);
            plot.setRenderer(null);
        }
        catch (Exception e) {
            failed = true;
        }
        assertTrue(!failed);
    }

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization1() {

        XYDataset data = new XYSeriesCollection();
        NumberAxis domainAxis = new NumberAxis("Domain");
        NumberAxis rangeAxis = new NumberAxis("Range");
        StandardXYItemRenderer renderer = new StandardXYItemRenderer();
        XYPlot p1 = new XYPlot(data, domainAxis, rangeAxis, renderer);
        XYPlot p2 = null;

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

            ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
            p2 = (XYPlot) in.readObject();
            in.close();
        }
        catch (Exception e) {
            System.out.println(e.toString());
        }
        boolean test = p1.equals(p2);
        assertEquals(p1, p2);

    }


    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization2() {

        IntervalXYDataset data1 = createDataset1();
        XYItemRenderer renderer1 = new XYBarRenderer(0.20);

        renderer1.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0,000.0"));
        XYPlot p1 = new XYPlot(data1, new DateAxis("Date"), null, renderer1);

        XYPlot p2 = null;

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

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

    }

    /**
     * Creates a sample dataset.
     *
     * @return Series 1.
     */
    private IntervalXYDataset createDataset1() {

        // create dataset 1...
        TimeSeries series1 = new TimeSeries("Series 1", Day.class);
        series1.add(new Day(1, SerialDate.MARCH, 2002), 12353.3);
        series1.add(new Day(2, SerialDate.MARCH, 2002), 13734.4);
        series1.add(new Day(3, SerialDate.MARCH, 2002), 14525.3);
        series1.add(new Day(4, SerialDate.MARCH, 2002), 13984.3);
        series1.add(new Day(5, SerialDate.MARCH, 2002), 12999.4);
        series1.add(new Day(6, SerialDate.MARCH, 2002), 14274.3);
        series1.add(new Day(7, SerialDate.MARCH, 2002), 15943.5);
        series1.add(new Day(8, SerialDate.MARCH, 2002), 14845.3);
        series1.add(new Day(9, SerialDate.MARCH, 2002), 14645.4);
        series1.add(new Day(10, SerialDate.MARCH, 2002), 16234.6);
        series1.add(new Day(11, SerialDate.MARCH, 2002), 17232.3);
        series1.add(new Day(12, SerialDate.MARCH, 2002), 14232.2);
        series1.add(new Day(13, SerialDate.MARCH, 2002), 13102.2);
        series1.add(new Day(14, SerialDate.MARCH, 2002), 14230.2);
        series1.add(new Day(15, SerialDate.MARCH, 2002), 11235.2);

        TimeSeriesCollection collection = new TimeSeriesCollection(series1);
        collection.setDomainIsPointsInTime(false);  // this tells the time series collection that
                                                    // we intend the data to represent time periods
                                                    // NOT points in time.  This is required when
                                                    // determining the min/max values in the
                                                    // dataset's domain.
        return collection;

    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成av人片在www色猫咪| 91精品国产综合久久香蕉的特点| 日韩精彩视频在线观看| 一区二区三区免费在线观看| 中文字幕在线一区免费| 国产精品久久久久毛片软件| 国产精品久久久久婷婷二区次| 国产欧美在线观看一区| 国产精品大尺度| 亚洲免费观看高清完整版在线观看| 亚洲视频在线观看一区| 亚洲曰韩产成在线| 日韩电影免费一区| 激情综合网天天干| 国产成人精品三级| 本田岬高潮一区二区三区| 色8久久精品久久久久久蜜 | 久久成人免费网| 久久精品国产精品亚洲综合| 国产高清不卡二三区| 97se亚洲国产综合自在线不卡| 91福利精品视频| 欧美一区二区国产| 欧美激情一区不卡| 亚洲一二三区不卡| 国产专区综合网| 一本大道久久a久久综合| 欧美日韩国产精品自在自线| 精品久久久久久久久久久久久久久 | 国产午夜精品一区二区三区四区| 国产精品三级在线观看| 亚洲一区二区三区在线| 国产精品伊人色| 欧美三级欧美一级| 国产日韩欧美一区二区三区乱码 | 欧美一级片免费看| 国产精品久久久99| 丝袜亚洲另类欧美| www.欧美日韩| 日韩美女在线视频 | 久久97超碰色| 91免费观看视频| 精品国产免费一区二区三区四区| 日韩码欧中文字| 国产米奇在线777精品观看| 91激情五月电影| 欧美激情综合五月色丁香小说| 亚洲超碰97人人做人人爱| 国产成人在线观看| 精品少妇一区二区三区视频免付费| 伊人性伊人情综合网| 捆绑调教美女网站视频一区| 在线一区二区视频| 国产欧美一区在线| 精品一区二区三区免费毛片爱 | 欧美国产97人人爽人人喊| 日韩电影免费在线| 欧美色图片你懂的| 亚洲日本在线看| 国产不卡在线播放| 欧美电影免费观看高清完整版 | 精品免费日韩av| 美腿丝袜亚洲一区| 欧美另类一区二区三区| 亚洲精品国产一区二区三区四区在线| 国产麻豆欧美日韩一区| 欧美一区二区三区公司| 亚洲电影一级片| 欧美午夜片在线看| 亚洲成人综合网站| 欧美日韩精品二区第二页| 亚洲欧美日韩综合aⅴ视频| 成人爽a毛片一区二区免费| 国产日韩欧美高清在线| 国产精品亚洲第一区在线暖暖韩国 | 久久久久国色av免费看影院| 另类小说综合欧美亚洲| 精品免费99久久| 国产麻豆欧美日韩一区| 国产欧美日韩久久| 99综合影院在线| 亚洲综合一二区| 欧美性猛交xxxx乱大交退制版| 亚洲午夜精品在线| 91麻豆精品91久久久久久清纯| 日韩精品电影一区亚洲| 精品国产一区二区三区av性色| 精品一区二区影视| 久久嫩草精品久久久精品一| 粉嫩绯色av一区二区在线观看 | 欧美一级一区二区| 国产一区二区精品久久| 国产精品久久久久国产精品日日| 色综合网色综合| 亚洲电影一级黄| 欧美tickling挠脚心丨vk| 国产黑丝在线一区二区三区| 国产精品传媒在线| 在线电影国产精品| 国产一区亚洲一区| 国产精品久久精品日日| 欧美日韩亚洲综合| 国产一区二区三区不卡在线观看 | 久久精品网站免费观看| 99久久综合精品| 丝袜亚洲另类欧美| 中文字幕欧美三区| 欧美日韩午夜在线视频| 国产一区二区三区精品欧美日韩一区二区三区 | 日韩欧美www| 91蜜桃视频在线| 久久精品国产一区二区| 国产精品第五页| 日韩欧美一卡二卡| 99精品视频在线观看| 蜜桃久久av一区| 综合久久一区二区三区| 欧美mv日韩mv国产网站| 91视频观看视频| 国产精品中文有码| 日本亚洲三级在线| 一区二区三区精品视频| 久久精品视频在线看| 欧美亚洲国产一区二区三区va| 国内欧美视频一区二区| 亚洲国产一区在线观看| 国产精品久久久久9999吃药| 日韩免费电影网站| 欧美久久免费观看| 91啦中文在线观看| 懂色一区二区三区免费观看| 青椒成人免费视频| 亚洲成人你懂的| 亚洲免费电影在线| 国产精品免费久久久久| 26uuu久久综合| 欧美成人午夜电影| 91精品国产综合久久国产大片 | 欧美一区二区三区在线电影| 日本韩国欧美一区| 色综合久久久久网| jiyouzz国产精品久久| 国产成人aaa| 国产精品资源在线看| 久久er99热精品一区二区| 亚欧色一区w666天堂| 亚洲一区二区三区中文字幕| 亚洲黄色尤物视频| 一区二区高清视频在线观看| 亚洲伦在线观看| 亚洲欧美成aⅴ人在线观看| 中文字幕一区二区三区精华液| 欧美激情在线一区二区| 日本一区二区三区在线不卡| 久久久亚洲欧洲日产国码αv| 久久午夜电影网| 中文字幕在线播放不卡一区| 最新国产の精品合集bt伙计| 亚洲欧洲中文日韩久久av乱码| 怡红院av一区二区三区| 亚洲夂夂婷婷色拍ww47| 日韩二区三区在线观看| 久久成人免费网站| 国产精品一区二区黑丝| heyzo一本久久综合| 欧美亚洲禁片免费| 欧美一区二区免费视频| 久久影院午夜片一区| 国产精品三级av| 亚洲精品视频在线| 日韩综合在线视频| 国产精品中文字幕一区二区三区| 成人黄色a**站在线观看| 91久久香蕉国产日韩欧美9色| 精品视频一区二区三区免费| 日韩欧美一级二级三级| 国产欧美日韩亚州综合 | 日本成人在线一区| 国产一区二区日韩精品| 不卡的电视剧免费网站有什么| 91免费在线看| 欧美变态凌虐bdsm| 一区二区三区毛片| 九九久久精品视频| 91麻豆国产自产在线观看| 日韩三级在线观看| 成人欧美一区二区三区小说| 日日摸夜夜添夜夜添国产精品| 国内久久精品视频| 欧美日韩亚洲综合在线| 国产亚洲成av人在线观看导航| 亚洲精品视频免费观看| 久久99精品久久久久婷婷| 色偷偷一区二区三区| 日韩免费看网站| 午夜精品成人在线视频| av中文字幕亚洲| 精品福利av导航| 日韩av电影一区| 日本高清不卡一区|