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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? multiplepieplot.java

?? jfreechart1.0.1 jsp繪制圖表的開發(fā)包
?? JAVA
字號(hào):
/* ===========================================================
 * 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.]
 *
 * --------------------
 * MultiplePiePlot.java
 * --------------------
 * (C) Copyright 2004, 2005, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: MultiplePiePlot.java,v 1.12.2.4 2005/11/28 12:06:35 mungady Exp $
 *
 * Changes (from 21-Jun-2001)
 * --------------------------
 * 29-Jan-2004 : Version 1 (DG);
 * 31-Mar-2004 : Added setPieIndex() call during drawing (DG);
 * 20-Apr-2005 : Small change for update to LegendItem constructors (DG);
 * 05-May-2005 : Updated draw() method parameters (DG);
 * 16-Jun-2005 : Added get/setDataset() and equals() methods (DG);
 *
 */

package org.jfree.chart.plot;

import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Stroke;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;

import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.LegendItem;
import org.jfree.chart.LegendItemCollection;
import org.jfree.chart.event.PlotChangeEvent;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.CategoryToPieDataset;
import org.jfree.data.general.DatasetChangeEvent;
import org.jfree.data.general.DatasetUtilities;
import org.jfree.data.general.PieDataset;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.RectangleInsets;
import org.jfree.util.ObjectUtilities;
import org.jfree.util.TableOrder;

/**
 * A plot that displays multiple pie plots using data from a 
 * {@link CategoryDataset}.
 */
public class MultiplePiePlot extends Plot implements Cloneable, Serializable {
    
    /** For serialization. */
    private static final long serialVersionUID = -355377800470807389L;
    
    /** The chart object that draws the individual pie charts. */
    private JFreeChart pieChart;
    
    /** The dataset. */
    private CategoryDataset dataset;
    
    /** The data extract order (by row or by column). */
    private TableOrder dataExtractOrder;
    
    /** The pie section limit percentage. */
    private double limit = 0.0;
    
    /**
     * Creates a new plot with no data.
     */
    public MultiplePiePlot() {
        this(null);
    }
    
    /**
     * Creates a new plot.
     * 
     * @param dataset  the dataset (<code>null</code> permitted).
     */
    public MultiplePiePlot(CategoryDataset dataset) {
        super();
        this.dataset = dataset;
        PiePlot piePlot = new PiePlot(null);
        this.pieChart = new JFreeChart(piePlot);
        this.pieChart.removeLegend();
        this.dataExtractOrder = TableOrder.BY_COLUMN;
        this.pieChart.setBackgroundPaint(null);
        TextTitle seriesTitle = new TextTitle(
            "Series Title", new Font("SansSerif", Font.BOLD, 12)
        );
        seriesTitle.setPosition(RectangleEdge.BOTTOM);
        this.pieChart.setTitle(seriesTitle);
    }
    
    /**
     * Returns the dataset used by the plot.
     * 
     * @return The dataset (possibly <code>null</code>).
     */
    public CategoryDataset getDataset() {
        return this.dataset;   
    }
    
    /**
     * Sets the dataset used by the plot and sends a {@link PlotChangeEvent}
     * to all registered listeners.
     * 
     * @param dataset  the dataset (<code>null</code> permitted).
     */
    public void setDataset(CategoryDataset dataset) {
        // if there is an existing dataset, remove the plot from the list of 
        // change listeners...
        if (this.dataset != null) {
            this.dataset.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
            setDatasetGroup(dataset.getGroup());
            dataset.addChangeListener(this);
        }

        // send a dataset change event to self to trigger plot change event
        datasetChanged(new DatasetChangeEvent(this, dataset));
    }
    
    /**
     * Returns the pie chart that is used to draw the individual pie plots.
     * 
     * @return The pie chart.
     */
    public JFreeChart getPieChart() {
        return this.pieChart;
    }
    
    /**
     * Sets the chart that is used to draw the individual pie plots.
     * 
     * @param pieChart  the pie chart.
     */
    public void setPieChart(JFreeChart pieChart) {
        this.pieChart = pieChart;
        notifyListeners(new PlotChangeEvent(this));
    }
    
    /**
     * Returns the data extract order (by row or by column).
     * 
     * @return The data extract order (never <code>null</code>).
     */
    public TableOrder getDataExtractOrder() {
        return this.dataExtractOrder;
    }
    
    /**
     * Sets the data extract order (by row or by column) and sends a 
     * {@link PlotChangeEvent} to all registered listeners.
     * 
     * @param order  the order (<code>null</code> not permitted).
     */
    public void setDataExtractOrder(TableOrder order) {
        if (order == null) {
            throw new IllegalArgumentException("Null 'order' argument");
        }
        this.dataExtractOrder = order;
        notifyListeners(new PlotChangeEvent(this));
    }
    
    /**
     * Returns the limit (as a percentage) below which small pie sections are 
     * aggregated.
     * 
     * @return The limit percentage.
     */
    public double getLimit() {
        return this.limit;
    }
    
    /**
     * Sets the limit below which pie sections are aggregated.  
     * Set this to 0.0 if you don't want any aggregation to occur.
     * 
     * @param limit  the limit percent.
     */
    public void setLimit(double limit) {
        this.limit = limit;
        notifyListeners(new PlotChangeEvent(this));
    }
    
    /**
     * Returns a short string describing the type of plot.
     *
     * @return The plot type.
     */
    public String getPlotType() {
        return "Multiple Pie Plot";  
         // TODO: need to fetch this from localised resources
    }

    /**
     * Draws the plot on a Java 2D graphics device (such as the screen or a 
     * printer).
     *
     * @param g2  the graphics device.
     * @param area  the area within which the plot should be drawn.
     * @param anchor  the anchor point (<code>null</code> permitted).
     * @param parentState  the state from the parent plot, if there is one.
     * @param info  collects info about the drawing.
     */
    public void draw(Graphics2D g2, 
                     Rectangle2D area,
                     Point2D anchor,
                     PlotState parentState,
                     PlotRenderingInfo info) {
        
       
        // adjust the drawing area for the plot insets (if any)...
        RectangleInsets insets = getInsets();
        insets.trim(area);
        drawBackground(g2, area);
        drawOutline(g2, area);
        
        // check that there is some data to display...
        if (DatasetUtilities.isEmptyOrNull(this.dataset)) {
            drawNoDataMessage(g2, area);
            return;
        }

        int pieCount = 0;
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            pieCount = this.dataset.getRowCount();
        }
        else {
            pieCount = this.dataset.getColumnCount();
        }

        // the columns variable is always >= rows
        int displayCols = (int) Math.ceil(Math.sqrt(pieCount));
        int displayRows 
            = (int) Math.ceil((double) pieCount / (double) displayCols);

        // swap rows and columns to match plotArea shape
        if (displayCols > displayRows && area.getWidth() < area.getHeight()) {
            int temp = displayCols;
            displayCols = displayRows;
            displayRows = temp;
        }

        // int fontHeight 
        //     = g2.getFontMetrics(this.plotLabelFont).getHeight() * 2;
        int x = (int) area.getX();
        int y = (int) area.getY();
        int width = ((int) area.getWidth()) / displayCols;
        int height = ((int) area.getHeight()) / displayRows;
        int row = 0;
        int column = 0;
        int diff = (displayRows * displayCols) - pieCount;
        int xoffset = 0;
        Rectangle rect = new Rectangle();

        for (int pieIndex = 0; pieIndex < pieCount; pieIndex++) {
            rect.setBounds(
                x + xoffset + (width * column), y + (height * row), 
                width, height
            );

            String title = null;
            if (this.dataExtractOrder == TableOrder.BY_ROW) {
                title = this.dataset.getRowKey(pieIndex).toString();
            }
            else {
                title = this.dataset.getColumnKey(pieIndex).toString();
            }
            this.pieChart.setTitle(title);
            
            PieDataset piedataset = null;
            PieDataset dd = new CategoryToPieDataset(
                this.dataset, this.dataExtractOrder, pieIndex
            );
            if (this.limit > 0.0) {
                piedataset = DatasetUtilities.createConsolidatedPieDataset(
                    dd, "Other", this.limit
                );
            }
            else {
                piedataset = dd;
            }
            PiePlot piePlot = (PiePlot) this.pieChart.getPlot();
            piePlot.setDataset(piedataset);
            piePlot.setPieIndex(pieIndex);
            ChartRenderingInfo subinfo = null;
            if (info != null) {
                subinfo = new ChartRenderingInfo();
            }
            this.pieChart.draw(g2, rect, subinfo);
            if (info != null) {
                info.getOwner().getEntityCollection().addAll(
                    subinfo.getEntityCollection()
                );
                info.addSubplotInfo(subinfo.getPlotInfo());
            }
            
            ++column;
            if (column == displayCols) {
                column = 0;
                ++row;

                if (row == displayRows - 1 && diff != 0) {
                    xoffset = (diff * width) / 2;
                }
            }
        }

    }
    
    /**
     * Returns a collection of legend items for the pie chart.
     *
     * @return The legend items.
     */
    public LegendItemCollection getLegendItems() {

        LegendItemCollection result = new LegendItemCollection();

        if (this.dataset != null) {
            List keys = null;
      
            if (this.dataExtractOrder == TableOrder.BY_ROW) {
                keys = this.dataset.getColumnKeys();
            }
            else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
                keys = this.dataset.getRowKeys();
            }

            if (keys != null) {
                int section = 0;
                Iterator iterator = keys.iterator();
                while (iterator.hasNext()) {
                    String label = iterator.next().toString();
                    String description = label;
                    PiePlot plot = (PiePlot) this.pieChart.getPlot();
                    Paint paint = plot.getSectionPaint(section);
                    Paint outlinePaint = plot.getSectionOutlinePaint(section);
                    Stroke outlineStroke 
                        = plot.getSectionOutlineStroke(section);
                    LegendItem item = new LegendItem(label, description, 
                            null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE, 
                            paint, outlineStroke, outlinePaint);

                    result.add(item);
                    section++;
                }
            }
        }
        return result;
    }
    
    /**
     * Tests this plot for equality with an arbitrary object.  Note that the 
     * plot's dataset is not considered in the equality test.
     * 
     * @param obj  the object (<code>null</code> permitted).
     */
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;   
        }
        if (!(obj instanceof MultiplePiePlot)) {
            return false;   
        }
        MultiplePiePlot that = (MultiplePiePlot) obj;
        if (this.dataExtractOrder != that.dataExtractOrder) {
            return false;   
        }
        if (this.limit != that.limit) {
            return false;   
        }
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
            return false;   
        }
        if (!super.equals(obj)) {
            return false;   
        }
        return true;
    }
    
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99国产精品久久久久久久久久| 国产中文字幕一区| 欧美一卡二卡三卡| 不卡大黄网站免费看| 天堂影院一区二区| 18成人在线观看| 久久久久国产成人精品亚洲午夜| 欧美日韩中文精品| 粉嫩aⅴ一区二区三区四区| 99精品在线免费| 免费欧美高清视频| 捆绑紧缚一区二区三区视频| 亚洲制服丝袜av| 亚洲一区二区精品视频| 亚洲黄一区二区三区| 欧美成人性福生活免费看| 欧美一区二区视频网站| 一本到三区不卡视频| av激情综合网| 色婷婷久久99综合精品jk白丝| av电影天堂一区二区在线| 国产福利精品一区二区| 成人综合在线观看| 欧美色欧美亚洲另类二区| 欧美日韩精品免费观看视频| 欧美日韩亚洲综合| 日韩欧美电影一区| 国产精品亲子伦对白| 亚洲日韩欧美一区二区在线| 亚洲欧美在线视频| 中文字幕免费一区| 亚洲另类在线制服丝袜| 亚洲国产综合91精品麻豆| 免费在线观看不卡| 欧美性一级生活| 欧美日韩综合在线| 日韩色在线观看| 久久久久综合网| 一片黄亚洲嫩模| 美女一区二区久久| 色就色 综合激情| 精品国产在天天线2019| 亚洲欧洲中文日韩久久av乱码| 亚洲精品欧美在线| 久久99精品网久久| 91极品视觉盛宴| 国产日韩三级在线| 日韩电影在线观看一区| 日本精品视频一区二区| 日韩一区二区电影网| 自拍偷拍国产亚洲| 国内不卡的二区三区中文字幕 | 国产欧美日韩在线视频| 亚洲第一成人在线| av亚洲产国偷v产偷v自拍| 亚洲综合色丁香婷婷六月图片| 91美女在线观看| 欧美一区二区三区免费大片 | 日韩一级免费一区| 一区二区三区蜜桃| 欧美体内she精高潮| 一区二区三区在线视频免费| 国产91对白在线观看九色| 亚洲精品一区二区精华| 亚洲一区二区av电影| 色综合中文字幕| 亚洲三级小视频| 欧美网站一区二区| 一区二区三区中文字幕| 色综合久久久久综合体| 久久先锋资源网| 91美女片黄在线观看| 夜夜精品浪潮av一区二区三区| 日本黄色一区二区| 婷婷综合久久一区二区三区| 欧美日韩卡一卡二| 亚洲成人av电影在线| 色婷婷亚洲精品| 亚洲国产日韩a在线播放性色| 91免费国产视频网站| 亚洲欧美激情一区二区| 在线精品国精品国产尤物884a| 人人爽香蕉精品| 欧美一区二区精品在线| 福利一区福利二区| 一区二区三区四区蜜桃| 日韩精品专区在线影院观看| 国产精品一二三四区| 一色屋精品亚洲香蕉网站| 91久久线看在观草草青青| 一区二区三区色| 久久久亚洲精华液精华液精华液| 国产成人综合亚洲网站| 夜夜亚洲天天久久| 国产女人水真多18毛片18精品视频| 91麻豆国产自产在线观看| 美国十次综合导航| 国产精品理伦片| 欧美日韩国产综合一区二区三区| 国产乱妇无码大片在线观看| 亚洲一区二区3| 日韩美女视频一区二区 | 亚洲人成在线播放网站岛国| 欧美成人欧美edvon| 99视频一区二区| 精品在线播放免费| 亚洲乱码国产乱码精品精可以看 | 国产乱对白刺激视频不卡| 天天操天天色综合| 国产精品福利一区| 欧美国产一区在线| 久久蜜桃一区二区| 精品国产a毛片| 久久女同精品一区二区| 欧美一区二区视频免费观看| 欧美三区免费完整视频在线观看| 国产在线一区观看| 国产另类ts人妖一区二区| 日本va欧美va欧美va精品| 日韩高清在线观看| 国产成人自拍网| 精品一区二区综合| 国产原创一区二区| 国产成人综合精品三级| 国产成人av福利| 99re66热这里只有精品3直播| 国产成人在线观看免费网站| 福利91精品一区二区三区| 91在线无精精品入口| 一本大道av一区二区在线播放| 91久久精品一区二区三区| 91黄视频在线观看| 7777精品伊人久久久大香线蕉的 | 欧美日本在线播放| 欧美另类变人与禽xxxxx| 欧美一区二区黄色| 中文字幕乱码一区二区免费| 一区二区三区在线观看国产| 午夜电影一区二区| 丁香婷婷综合激情五月色| 91精品91久久久中77777| 在线播放中文一区| 国产亚洲成av人在线观看导航 | 91亚洲精品久久久蜜桃| 在线播放/欧美激情| 久久先锋影音av| 夜夜精品浪潮av一区二区三区| 亚洲国产一区二区三区青草影视| 久久www免费人成看片高清| 99视频在线精品| 日韩欧美国产一区二区三区| 亚洲欧美另类图片小说| 北条麻妃一区二区三区| 日韩视频永久免费| 亚洲国产你懂的| 成人午夜大片免费观看| 日韩欧美中文字幕一区| 亚洲综合在线免费观看| 成人精品免费视频| 久久综合视频网| 视频一区中文字幕| 欧美午夜片在线看| 亚洲一区二区三区爽爽爽爽爽| 国产一区免费电影| 2020国产精品自拍| 国产综合色视频| 欧美va亚洲va香蕉在线| 免费日韩伦理电影| 91精品国产综合久久精品app| 亚洲午夜久久久久久久久久久 | 91丨porny丨蝌蚪视频| 日韩精品一区二区三区中文不卡| 午夜电影网亚洲视频| 精品视频在线免费| 午夜精品福利视频网站 | 欧美日韩极品在线观看一区| 一级女性全黄久久生活片免费| 97aⅴ精品视频一二三区| 国产精品久久久久影视| 91日韩在线专区| 中文字幕在线不卡国产视频| a美女胸又www黄视频久久| 亚洲欧美综合另类在线卡通| 一本色道久久综合精品竹菊| 国产精品天干天干在线综合| 97精品久久久午夜一区二区三区 | 亚洲成av人片| 日韩欧美资源站| aaa亚洲精品| 午夜欧美视频在线观看 | 久久精品亚洲一区二区三区浴池| 国产成人精品一区二区三区网站观看| 欧美国产丝袜视频| 欧美日本在线播放| 国产精品 欧美精品| 伊人性伊人情综合网| 久久一夜天堂av一区二区三区 | 亚洲男人的天堂在线观看| 欧美挠脚心视频网站| 国产91在线|亚洲|