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

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

?? pie3dplot.java

?? Web圖形化的Java庫
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* ======================================
 * 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.
 *
 * --------------
 * PiePlot3D.java
 * --------------
 * (C) Copyright 2000-2003, 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;
 *
 * $Id: Pie3DPlot.java,v 1.13 2003/09/09 10:22:40 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); 
 *
 */

package org.jfree.chart.plot;

import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Paint;
import java.awt.Polygon;
import java.awt.Shape;
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.ChartRenderingInfo;
import org.jfree.chart.entity.EntityCollection;
import org.jfree.chart.entity.PieSectionEntity;
import org.jfree.chart.labels.StandardPieItemLabelGenerator;
import org.jfree.data.DatasetUtilities;
import org.jfree.data.PieDataset;

/**
 * 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 or the display of multiple pie charts within one plot.
 *
 * @author Tomer Peretz
 */
public class Pie3DPlot extends PiePlot implements Serializable {

    /** The factor of the depth of the pie from the plot height */
    private double depthFactor = 0.2;

    /**
     * Creates a 3D pie chart with default attributes.
     *
     * @param data  the data for the chart.
     */
    public Pie3DPlot(PieDataset data) {
        super(data);
        setCircularAttribute(false);
    }

    /**
     * Sets the factor of the pie depth from the plot height.
     *
     * @param newDepthFactor  the new depth factor.
     */
    public void setDepthFactor(double newDepthFactor) {
        this.depthFactor = newDepthFactor;
    }

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

    /**
     * Draws the plot on a Java 2D graphics device (such as the screen or a printer).
     *
     * @param g2  the graphics device.
     * @param plotArea  the area within which the plot should be drawn.
     * @param info  collects info about the drawing.
     */
    public void draw(Graphics2D g2, Rectangle2D plotArea, ChartRenderingInfo info) {
        
        Shape savedClip = g2.getClip();
        Rectangle2D clipArea = savedClip != null
            ? savedClip.getBounds2D().createIntersection(plotArea)
            : plotArea;

        // adjust for insets...
        Insets insets = getInsets();
        if (insets != null) {
            plotArea.setRect(plotArea.getX() + insets.left,
                             plotArea.getY() + insets.top,
                             plotArea.getWidth() - insets.left - insets.right,
                             plotArea.getHeight() - insets.top - insets.bottom);
        }

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

        // adjust the plot area by the interior spacing value
        double gapPercent = getInteriorGap();
        double gapHorizontal = plotArea.getWidth() * gapPercent;
        double gapVertical = plotArea.getHeight() * gapPercent;

        double pieX = plotArea.getX() + gapHorizontal / 2;
        double pieY = plotArea.getY() + gapVertical / 2;
        double pieW = plotArea.getWidth() - gapHorizontal;
        double pieH = plotArea.getHeight() - gapVertical;

        if (isCircular()) {
            double min = Math.min(pieW, pieH) / 2;
            pieX = (pieX + pieX + pieW) / 2 - min;
            pieY = (pieY + pieY + pieH) / 2 - min;
            pieW = 2 * min;
            pieH = 2 * min;
        }

        Rectangle2D explodedPieArea = new Rectangle2D.Double(pieX, pieY, pieW, pieH);
        double radiusPercent = getRadius();
        double explodeHorizontal = (1 - radiusPercent) * pieW;
        double explodeVertical = (1 - radiusPercent) * pieH;
        Rectangle2D pieArea = new Rectangle2D.Double(pieX + explodeHorizontal / 2,
                                                     pieY + explodeVertical / 2,
                                                     pieW - explodeHorizontal,
                                                     pieH - explodeVertical);

        drawBackground(g2, plotArea);
        // get the data source - return if null;
        PieDataset dataset = getPieDataset();
        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);
            int stringWidth
                = (int) sfont.getStringBounds(text, g2.getFontRenderContext()).getWidth();

            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.getPieDatasetTotal(dataset);
        double runningTotal = 0;
        int depth = (int) (pieArea.getHeight() * depthFactor);
        if (depth < 0) {
            return;  // if depth is negative don't draw anything
        }

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

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

            Comparable currentKey = (Comparable) iterator.next();
            Number dataValue = dataset.getValue(currentKey);
            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) * 360) / totalValue;
            if (Math.abs(angle2 - angle1) > getMinimumArcAngleToDraw()) {

                arcList.add(new Arc2D.Double(arcX,
                                             arcY + depth,
                                             pieArea.getWidth(),
                                             pieArea.getHeight() - depth,
                                             angle1,
                                             angle2 - angle1,
                                             Arc2D.PIE));
            }
            else {
                arcList.add(null);
            }
            runningTotal += value;
        }

        Shape oldClip = g2.getClip();

        Ellipse2D top = new Ellipse2D.Double(pieArea.getX(),
                                             pieArea.getY(),
                                             pieArea.getWidth(),
                                             pieArea.getHeight() - depth);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区视频在线| 婷婷综合另类小说色区| 欧美久久婷婷综合色| 色菇凉天天综合网| 成人av网站在线观看免费| 懂色av一区二区三区免费观看| 黄网站免费久久| 国产最新精品免费| 国产成人在线视频网址| 成人美女视频在线观看18| 国产在线一区二区综合免费视频| 一区二区三区国产| 午夜精品一区二区三区三上悠亚| 日韩精品一级二级| 精品无码三级在线观看视频| 国产精品中文字幕日韩精品 | 亚洲自拍欧美精品| 亚洲风情在线资源站| 亚洲成人动漫一区| 美女视频黄久久| 国产精品小仙女| 97久久精品人人做人人爽| 欧美日韩精品一区二区三区蜜桃 | 国产米奇在线777精品观看| 国产老女人精品毛片久久| 不卡的av网站| 欧美日韩国产首页| 欧美第一区第二区| 亚洲另类中文字| 日本午夜一区二区| 成人高清视频在线观看| 777xxx欧美| 亚洲欧洲成人av每日更新| 爽好久久久欧美精品| 国产999精品久久久久久绿帽| 欧美日韩国产成人在线免费| 久久这里都是精品| 亚洲午夜精品一区二区三区他趣| 久久精品国产**网站演员| 丁香一区二区三区| 日韩欧美电影在线| 亚洲在线视频免费观看| 国产经典欧美精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 在线电影一区二区三区| 国产精品不卡在线观看| 精品亚洲porn| 欧美日韩国产综合久久| 日韩伦理电影网| 国产高清在线观看免费不卡| 日韩欧美激情四射| 亚洲国产一二三| 99国产精品久久久久久久久久| 欧美草草影院在线视频| 日韩激情视频网站| 欧美色综合久久| 亚洲激情在线播放| av不卡免费在线观看| 国产欧美精品一区二区色综合| 男人的天堂亚洲一区| 欧美伊人久久大香线蕉综合69| 国产精品成人网| www.成人网.com| 亚洲国产精品成人综合色在线婷婷| 另类小说一区二区三区| 日本二三区不卡| 国产精品盗摄一区二区三区| 国产精品资源在线看| 久久久99免费| 韩国精品在线观看| 欧美刺激午夜性久久久久久久| 天堂影院一区二区| 337p亚洲精品色噜噜噜| 日本在线不卡视频| 精品久久久久久久久久久久久久久| 丝瓜av网站精品一区二区| 欧美精品色综合| 亚洲va韩国va欧美va| 欧美二区在线观看| 久久国产日韩欧美精品| 精品日韩在线观看| 久久成人久久爱| 久久色视频免费观看| 国产精品一区二区无线| 国产精品久久二区二区| 色婷婷久久久亚洲一区二区三区 | 欧美日韩日本视频| 亚洲成人激情社区| 欧美成人福利视频| 成人性生交大片免费看在线播放| 亚洲欧洲日韩一区二区三区| 在线免费观看视频一区| 久久精品国产久精国产爱| 久久久欧美精品sm网站| 成人av在线一区二区三区| 一区二区三区av电影| 制服丝袜亚洲色图| 国产精品123区| 亚洲欧美成人一区二区三区| 欧美另类videos死尸| 韩国欧美国产1区| 亚洲精品一二三| 日韩一二在线观看| 成人精品电影在线观看| 亚洲成人免费电影| 久久色在线视频| 在线视频你懂得一区二区三区| 免费三级欧美电影| 日韩毛片视频在线看| 日韩欧美一区二区久久婷婷| www.成人在线| 久久精品国产澳门| 亚洲一级在线观看| 国产午夜久久久久| 欧美欧美欧美欧美| av福利精品导航| 久久成人久久爱| 亚洲一区二区三区精品在线| 久久久久久久av麻豆果冻| 欧美三区在线视频| youjizz国产精品| 国产呦精品一区二区三区网站| 亚洲乱码国产乱码精品精98午夜| 精品久久久久久综合日本欧美| 91国产福利在线| 成人高清免费在线播放| 蜜臀av性久久久久蜜臀av麻豆| 亚洲黄色录像片| 欧美怡红院视频| 粉嫩av亚洲一区二区图片| 日韩精品国产精品| 亚洲乱码国产乱码精品精98午夜| 欧美激情一区三区| 久久亚洲一级片| 日韩欧美一级精品久久| 欧美高清视频www夜色资源网| 色综合天天综合网天天看片| 国产精品69毛片高清亚洲| 精品在线观看免费| 日韩电影在线免费观看| 亚洲一区二区黄色| 亚洲色欲色欲www在线观看| 国产精品你懂的| 国产精品成人午夜| 中文字幕在线观看一区| 国产精品免费观看视频| 国产精品女主播av| 国产精品国产精品国产专区不蜜 | 亚洲人成网站在线| 17c精品麻豆一区二区免费| 国产日韩一级二级三级| 国产色91在线| 中文在线免费一区三区高中清不卡| 精品国产伦一区二区三区观看体验 | 26uuu亚洲婷婷狠狠天堂| 4438成人网| 日韩免费观看2025年上映的电影 | 95精品视频在线| 99国产精品视频免费观看| 色激情天天射综合网| 欧美三级资源在线| 欧美精品乱码久久久久久| 欧美一区二区三区在线观看视频 | 亚洲福利一区二区三区| 亚洲123区在线观看| 日韩精品成人一区二区三区| 玖玖九九国产精品| 懂色av噜噜一区二区三区av| 色综合咪咪久久| 欧美精品 日韩| 精品国产乱码久久久久久图片 | 亚洲国产美国国产综合一区二区| 亚洲电影一级片| 精品一区二区三区在线观看国产 | 91丨porny丨首页| 欧美精品高清视频| 精品动漫一区二区三区在线观看| 中文字幕的久久| 亚洲成人先锋电影| 国产麻豆一精品一av一免费| av成人免费在线观看| 欧美色精品在线视频| 久久久久99精品国产片| 亚洲黄一区二区三区| 麻豆精品精品国产自在97香蕉| 国产成人精品免费| 欧美性高清videossexo| 国产午夜精品在线观看| 亚洲国产欧美在线| 国产乱淫av一区二区三区| 欧美三级视频在线观看| 久久久欧美精品sm网站| 亚洲国产欧美另类丝袜| 岛国精品在线播放| 日韩一区二区三| 亚洲女性喷水在线观看一区| 麻豆中文一区二区| 欧美三级一区二区| 国产精品国产自产拍高清av王其| 免费欧美在线视频|