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

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

?? pieplot3d.java

?? 制作圖表的好工具
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* ===========================================================
 * 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.]
 *
 * --------------
 * PiePlot3D.java
 * --------------
 * (C) Copyright 2000-2005, by Object Refinery and Contributors.
 *
 * Original Author:  Tomer Peretz;
 * Contributor(s):   Richard Atkinson;
 *                   David Gilbert (for Object Refinery Limited);
 *                   Xun Kang;
 *                   Christian W. Zuckschwerdt;
 *                   Arnaud Lelievre;
 *                   Dave Crane;
 *
 * $Id: PiePlot3D.java,v 1.10.2.2 2005/10/25 20:52:08 mungady Exp $
 *
 * Changes
 * -------
 * 21-Jun-2002 : Version 1;
 * 31-Jul-2002 : Modified to use startAngle and direction, drawing modified so 
 *               that charts render with foreground alpha < 1.0 (DG);
 * 05-Aug-2002 : Small modification to draw method to support URLs for HTML 
 *               image maps (RA);
 * 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
 * 18-Oct-2002 : Added drawing bug fix sent in by Xun Kang, and made a couple 
 *               of other related fixes (DG);
 * 30-Oct-2002 : Changed the PieDataset interface. Fixed another drawing 
 *               bug (DG);
 * 12-Nov-2002 : Fixed null pointer exception for zero or negative values (DG);
 * 07-Mar-2003 : Modified to pass pieIndex on to PieSectionEntity (DG);
 * 21-Mar-2003 : Added workaround for bug id 620031 (DG);
 * 26-Mar-2003 : Implemented Serializable (DG);
 * 30-Jul-2003 : Modified entity constructor (CZ);
 * 29-Aug-2003 : Small changes for API updates in PiePlot class (DG);
 * 02-Sep-2003 : Fixed bug where the 'no data' message is not displayed (DG);
 * 08-Sep-2003 : Added internationalization via use of properties 
 *               resourceBundle (RFE 690236) (AL); 
 * 29-Oct-2003 : Added workaround for font alignment in PDF output (DG);
 * 20-Nov-2003 : Fixed bug 845289 (sides not showing) (DG);
 * 25-Nov-2003 : Added patch (845095) to fix outline paint issues (DG);
 * 10-Mar-2004 : Numerous changes to enhance labelling (DG);
 * 31-Mar-2004 : Adjusted plot area when label generator is null (DG);
 * 08-Apr-2004 : Added flag to PiePlot class to control the treatment of null 
 *               values (DG);
 *               Added pieIndex to PieSectionEntity (DG);
 * 15-Nov-2004 : Removed creation of default tool tip generator (DG);
 * 16-Jun-2005 : Added default constructor (DG);
 * 
 */

package org.jfree.chart.plot;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Arc2D;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.jfree.chart.entity.EntityCollection;
import org.jfree.chart.entity.PieSectionEntity;
import org.jfree.chart.labels.PieToolTipGenerator;
import org.jfree.data.general.DatasetUtilities;
import org.jfree.data.general.PieDataset;
import org.jfree.ui.RectangleInsets;

/**
 * A plot that displays data in the form of a 3D pie chart, using data from
 * any class that implements the {@link PieDataset} interface.
 * <P>
 * Although this class extends {@link PiePlot}, it does not currently support
 * exploded sections.
 */
public class PiePlot3D extends PiePlot implements Serializable {

    /** For serialization. */
    private static final long serialVersionUID = 3408984188945161432L;
    
    /** The factor of the depth of the pie from the plot height */
    private double depthFactor = 0.2;

    /**
     * Creates a new instance with no dataset.
     */
    public PiePlot3D() {
        this(null);   
    }
    
    /**
     * Creates a pie chart with a three dimensional effect using the specified 
     * dataset.
     *
     * @param dataset  the dataset (<code>null</code> permitted).
     */
    public PiePlot3D(PieDataset dataset) {
        super(dataset);
        setCircular(false, false);
    }

    /**
     * Sets the pie depth as a percentage of the height of the plot area.
     *
     * @param factor  the depth factor (for example, 0.20 is twenty percent).
     */
    public void setDepthFactor(double factor) {
        this.depthFactor = factor;
    }

    /**
     * The depth factor for the chart.
     *
     * @return The depth factor.
     */
    public double getDepthFactor () {
        return this.depthFactor;
    }

    /**
     * Draws the plot on a Java 2D graphics device (such as the screen or a 
     * printer).  This method is called by the 
     * {@link org.jfree.chart.JFreeChart} class, you don't normally need 
     * to call it yourself.
     *
     * @param g2  the graphics device.
     * @param plotArea  the area within which the plot should be drawn.
     * @param anchor  the anchor point.
     * @param parentState  the state from the parent plot, if there is one.
     * @param info  collects info about the drawing 
     *              (<code>null</code> permitted).
     */
    public void draw(Graphics2D g2, Rectangle2D plotArea, Point2D anchor,
                     PlotState parentState,
                     PlotRenderingInfo info) {

        // adjust for insets...
        RectangleInsets insets = getInsets();
        insets.trim(plotArea);

        Rectangle2D originalPlotArea = (Rectangle2D) plotArea.clone();
        if (info != null) {
            info.setPlotArea(plotArea);
            info.setDataArea(plotArea);
        }

        Shape savedClip = g2.getClip();
        g2.clip(plotArea);

        // adjust the plot area by the interior spacing value
        double gapPercent = getInteriorGap();
        double labelPercent = 0.0;
        if (getLabelGenerator() != null) {
            labelPercent = getLabelGap() + getMaximumLabelWidth() 
                           + getLabelLinkMargin();   
        }
        double gapHorizontal = plotArea.getWidth() 
                               * (gapPercent + labelPercent);
        double gapVertical = plotArea.getHeight() * gapPercent;

        double linkX = plotArea.getX() + gapHorizontal / 2;
        double linkY = plotArea.getY() + gapVertical / 2;
        double linkW = plotArea.getWidth() - gapHorizontal;
        double linkH = plotArea.getHeight() - gapVertical;
        
        // make the link area a square if the pie chart is to be circular...
        if (isCircular()) { // is circular?
            double min = Math.min(linkW, linkH) / 2;
            linkX = (linkX + linkX + linkW) / 2 - min;
            linkY = (linkY + linkY + linkH) / 2 - min;
            linkW = 2 * min;
            linkH = 2 * min;
        }
        
        PiePlotState state = initialise(g2, plotArea, this, null, info);
        // the explode area defines the max circle/ellipse for the exploded pie 
        // sections.
        // it is defined by shrinking the linkArea by the linkMargin factor.
        double hh = linkW * getLabelLinkMargin();
        double vv = linkH * getLabelLinkMargin();
        Rectangle2D explodeArea = new Rectangle2D.Double(
            linkX + hh / 2.0, linkY + vv / 2.0, linkW - hh, linkH - vv
        );
       
        state.setExplodedPieArea(explodeArea);
        
        // the pie area defines the circle/ellipse for regular pie sections.
        // it is defined by shrinking the explodeArea by the explodeMargin 
        // factor. 
        double maximumExplodePercent = getMaximumExplodePercent();
        double percent = maximumExplodePercent / (1.0 + maximumExplodePercent);
        
        double h1 = explodeArea.getWidth() * percent;
        double v1 = explodeArea.getHeight() * percent;
        Rectangle2D pieArea = new Rectangle2D.Double(
            explodeArea.getX() + h1 / 2.0, explodeArea.getY() + v1 / 2.0,
            explodeArea.getWidth() - h1, explodeArea.getHeight() - v1
        );

        int depth = (int) (pieArea.getHeight() * this.depthFactor);
        // the link area defines the dog-leg point for the linking lines to 
        // the labels
        Rectangle2D linkArea = new Rectangle2D.Double(
            linkX, linkY, linkW, linkH - depth
        );
        state.setLinkArea(linkArea);   

        state.setPieArea(pieArea);
        state.setPieCenterX(pieArea.getCenterX());
        state.setPieCenterY(pieArea.getCenterY() - depth / 2.0);
        state.setPieWRadius(pieArea.getWidth() / 2.0);
        state.setPieHRadius((pieArea.getHeight() - depth) / 2.0);

        drawBackground(g2, plotArea);
        // get the data source - return if null;
        PieDataset dataset = getDataset();
        if (DatasetUtilities.isEmptyOrNull(getDataset())) {
            drawNoDataMessage(g2, plotArea);
            g2.setClip(savedClip);
            drawOutline(g2, plotArea);
            return;
        }

        // if too any elements
        if (dataset.getKeys().size() > plotArea.getWidth()) {
            String text = "Too many elements";
            Font sfont = new Font("dialog", Font.BOLD, 10);
            g2.setFont(sfont);
            FontMetrics fm = g2.getFontMetrics(sfont);
            int stringWidth = fm.stringWidth(text);

            g2.drawString(
                text, 
                (int) (plotArea.getX() + (plotArea.getWidth() - stringWidth) 
                        / 2),
                (int) (plotArea.getY() + (plotArea.getHeight() / 2))
            );
            return;
        }
        // if we are drawing a perfect circle, we need to readjust the top left
        // coordinates of the drawing area for the arcs to arrive at this
        // effect.
        if (isCircular()) {
            double min = Math.min(plotArea.getWidth(), 
                    plotArea.getHeight()) / 2;
            plotArea = new Rectangle2D.Double(
                plotArea.getCenterX() - min, plotArea.getCenterY() - min, 
                2 * min, 2 * min
            );
        }
        // get a list of keys...
        List sectionKeys = dataset.getKeys();

        if (sectionKeys.size() == 0) {
            return;
        }

        // establish the coordinates of the top left corner of the drawing area
        double arcX = pieArea.getX();
        double arcY = pieArea.getY();

        //g2.clip(clipArea);
        Composite originalComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 
                getForegroundAlpha()));

        double totalValue = DatasetUtilities.calculatePieDatasetTotal(dataset);
        double runningTotal = 0;
        if (depth < 0) {
            return;  // if depth is negative don't draw anything
        }

        ArrayList arcList = new ArrayList();
        Arc2D.Double arc;
        Paint paint;
        Paint outlinePaint;
        Stroke outlineStroke;

        Iterator iterator = sectionKeys.iterator();
        while (iterator.hasNext()) {

            Comparable currentKey = (Comparable) iterator.next();
            Number dataValue = dataset.getValue(currentKey);
            if (dataValue == null) {
                arcList.add(null);
                continue;
            }
            double value = dataValue.doubleValue();
            if (value <= 0) {
                arcList.add(null);
                continue;
            }
            double startAngle = getStartAngle();
            double direction = getDirection().getFactor();
            double angle1 = startAngle + (direction * (runningTotal * 360)) 
            / totalValue;
            double angle2 = startAngle + (direction * (runningTotal + value) 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情伊人五月天久久综合| 亚洲美女区一区| 中文字幕在线免费不卡| 日韩精品国产欧美| jizzjizzjizz欧美| 精品久久国产字幕高潮| 一区二区激情视频| 国产ts人妖一区二区| 91精品国产一区二区三区| 国产精品青草综合久久久久99| 视频一区二区三区入口| 91网站最新地址| 国产夜色精品一区二区av| 日韩激情视频网站| 91高清视频在线| 亚洲另类春色校园小说| 成人黄色在线视频| 国产亚洲欧美在线| 国产综合色在线视频区| 91精品国产91久久久久久一区二区| 亚洲va在线va天堂| av在线不卡观看免费观看| 久久精品视频一区二区| 九一九一国产精品| 日韩午夜av电影| 日本人妖一区二区| 正在播放亚洲一区| 午夜精品久久久久久久| 欧美日韩精品一区二区三区 | 粉嫩13p一区二区三区| 精品福利在线导航| 久草精品在线观看| 久久精品亚洲精品国产欧美 | 中文字幕中文在线不卡住| 成人中文字幕电影| 欧美国产一区在线| jizzjizzjizz欧美| 亚洲欧美日韩国产综合在线| 精品制服美女久久| 亚洲激情在线激情| 免费xxxx性欧美18vr| 成人污污视频在线观看| 91精品综合久久久久久| 国产精品国产三级国产a| 一区二区三区中文字幕精品精品 | 国产激情视频一区二区三区欧美 | 欧美日韩在线播放三区| 亚洲精品va在线观看| 在线播放91灌醉迷j高跟美女| 亚洲高清不卡在线| 欧美性猛片aaaaaaa做受| 日韩精品电影一区亚洲| 欧美一区欧美二区| 国产aⅴ精品一区二区三区色成熟| 国产精品久久久久久久蜜臀| 色综合久久久久综合99| 亚洲高清免费在线| 精品免费一区二区三区| 懂色av噜噜一区二区三区av| 依依成人精品视频| 欧美人狂配大交3d怪物一区| ww亚洲ww在线观看国产| 一区二区三区在线免费观看| 一区二区三区丝袜| 国产jizzjizz一区二区| 中文字幕一区二区三区四区不卡 | 日韩一卡二卡三卡四卡| 久99久精品视频免费观看| 国产精品国产馆在线真实露脸| 欧美三级三级三级| 国内精品伊人久久久久av影院| 亚洲视频在线观看一区| 91精品欧美一区二区三区综合在 | 欧美日韩的一区二区| 国产寡妇亲子伦一区二区| 亚洲亚洲精品在线观看| 久久久久9999亚洲精品| 欧美日韩精品高清| 成人一区二区视频| 另类小说色综合网站| 亚洲黄色片在线观看| 国产亚洲女人久久久久毛片| 欧美猛男超大videosgay| av一区二区三区| 国产麻豆成人精品| 五月开心婷婷久久| 亚洲乱码国产乱码精品精的特点| 午夜精品久久久久久久99樱桃| 日韩美女啊v在线免费观看| 成人性生交大片免费看在线播放| 亚洲高清视频在线| 久久综合视频网| 99综合影院在线| 91免费看视频| 国产精品夜夜嗨| 五月天亚洲婷婷| 椎名由奈av一区二区三区| 久久麻豆一区二区| 日韩视频一区在线观看| 色成人在线视频| 色综合久久中文字幕| 成人污视频在线观看| 国产高清精品在线| 国产精品一区二区久久精品爱涩| 青青草国产成人av片免费| 亚洲国产成人av网| 亚洲午夜视频在线观看| 一区二区不卡在线视频 午夜欧美不卡在| 久久久国产一区二区三区四区小说 | 精品捆绑美女sm三区| 性感美女久久精品| 日韩情涩欧美日韩视频| 欧美精品在线一区二区三区| 色噜噜狠狠色综合欧洲selulu| 99久久精品国产一区| 成人av第一页| av电影一区二区| 99re成人精品视频| 97精品视频在线观看自产线路二| 国产一区 二区| 国产成人激情av| jlzzjlzz欧美大全| 色视频一区二区| 欧美三级电影在线观看| 51精品久久久久久久蜜臀| 欧美一区二区免费观在线| 欧美成人免费网站| 国产三级一区二区| 亚洲视频在线观看三级| 美女www一区二区| 亚洲男人电影天堂| 亚洲欧洲日产国产综合网| 国产精品伦一区| 日精品一区二区三区| 国产成人激情av| 亚洲超丰满肉感bbw| 裸体健美xxxx欧美裸体表演| 国模无码大尺度一区二区三区| 处破女av一区二区| 欧美性视频一区二区三区| 日韩视频免费观看高清完整版| 欧美成人一区二区| 久久精品视频免费| 亚洲一区在线观看网站| 日本欧美一区二区| 美女视频网站久久| 国产一区二区三区香蕉| 96av麻豆蜜桃一区二区| 9191国产精品| 欧美国产激情二区三区| 中文字幕乱码亚洲精品一区| 一区二区三区四区精品在线视频 | 亚洲成人激情综合网| 精品一区二区三区在线视频| 国产乱码精品1区2区3区| 91老师片黄在线观看| 欧美成人一区二区| 一区二区三区在线观看动漫| 精品一区二区三区香蕉蜜桃| 91久久精品一区二区| www欧美成人18+| 亚洲成人免费av| 成人av在线一区二区| 91精品国模一区二区三区| 中文字幕一区二区三区精华液| 免费黄网站欧美| 日本韩国欧美在线| 中文av一区二区| 男人的天堂久久精品| 在线免费观看日本一区| 国产欧美日韩视频在线观看| 日本视频一区二区三区| 91国偷自产一区二区开放时间| 国产日韩欧美不卡在线| 人妖欧美一区二区| 欧美性猛交一区二区三区精品| 国产精品素人视频| 免费的成人av| 欧美日本一区二区在线观看| 亚洲欧美偷拍三级| 播五月开心婷婷综合| 久久色在线观看| 久久99精品视频| 日韩视频123| 国产精品亚洲人在线观看| 337p亚洲精品色噜噜| 一级女性全黄久久生活片免费| 福利视频网站一区二区三区| 欧美精品一区二区在线播放 | 欧美mv日韩mv国产网站app| 亚洲电影激情视频网站| 色综合一区二区| 中文字幕色av一区二区三区| 国产成人精品影院| 国产亚洲一区二区三区在线观看 | 91超碰这里只有精品国产| 欧美综合在线视频| 国产精品青草综合久久久久99| 国产麻豆精品久久一二三| xfplay精品久久|