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

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

?? pieplot3d.java

?? jfreechart1.0.1 jsp繪制圖表的開發包
?? 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一区二区三区免费野_久草精品视频
欧美国产成人在线| 久久精品视频网| 92精品国产成人观看免费 | 精品国产乱码久久久久久浪潮| 色天天综合久久久久综合片| 不卡电影免费在线播放一区| 粉嫩一区二区三区性色av| 国产精品一区二区久激情瑜伽| 久久国产麻豆精品| 国产精品1区二区.| 成人av网站在线观看免费| 色天天综合久久久久综合片| 欧美亚洲动漫精品| 337p亚洲精品色噜噜| 欧美一区二区三区免费视频| 欧美va亚洲va国产综合| 久久久激情视频| 国产精品久久久久久久久久免费看| 国产精品女同互慰在线看| 中文字幕亚洲精品在线观看| 亚洲一区二区欧美激情| 奇米四色…亚洲| 国产成人精品1024| 91老师片黄在线观看| 欧美日韩成人在线一区| 日韩视频在线永久播放| 国产精品丝袜一区| 亚洲成人免费在线| 国产成人亚洲综合色影视| 岛国一区二区三区| 欧美日韩高清一区二区不卡| 日韩欧美一级二级三级久久久| 精品国产一区二区三区不卡| 亚洲人快播电影网| 国产福利91精品| 91女厕偷拍女厕偷拍高清| 欧美久久婷婷综合色| 日韩精品在线看片z| 中文字幕在线一区二区三区| 天堂久久久久va久久久久| 九色综合国产一区二区三区| 91在线云播放| 欧美岛国在线观看| 亚洲精品自拍动漫在线| 蜜桃视频在线观看一区二区| 成人18视频日本| 欧美成人bangbros| 一级做a爱片久久| 国产**成人网毛片九色| 91精品婷婷国产综合久久| 国产精品久久久久久亚洲毛片| 亚洲第一福利视频在线| 波多野结衣欧美| 亚洲精品一区二区在线观看| 亚洲小少妇裸体bbw| 成人av免费在线观看| 日韩免费高清电影| 性感美女久久精品| 色老综合老女人久久久| 久久久久久久久久久久久女国产乱 | 欧美疯狂做受xxxx富婆| 亚洲人成小说网站色在线 | 伊人夜夜躁av伊人久久| 久久97超碰国产精品超碰| 97精品国产露脸对白| 国产婷婷精品av在线| 奇米精品一区二区三区在线观看| 91日韩在线专区| 国产精品久久久久婷婷| 国产黑丝在线一区二区三区| 欧美一级一区二区| 日本美女视频一区二区| 欧美群妇大交群的观看方式| 亚洲天堂久久久久久久| www.av精品| 国产精品乱码久久久久久| 国产成人综合在线观看| 久久久三级国产网站| 欧美精品第1页| 亚洲日本在线天堂| 欧美性色综合网| 一区二区三区在线视频观看58| 91丨九色丨蝌蚪富婆spa| 国产精品久久影院| 99精品视频一区二区三区| 中文字幕电影一区| 波多野结衣欧美| 亚洲精品中文在线观看| 91国产免费观看| 天堂av在线一区| 欧美一区二区二区| 国产美女在线观看一区| 国产精品国产成人国产三级| jvid福利写真一区二区三区| 亚洲精品视频自拍| 欧美精品日韩精品| 激情久久五月天| 中文字幕乱码日本亚洲一区二区| 菠萝蜜视频在线观看一区| 亚洲美女一区二区三区| 欧美熟乱第一页| 蜜臀精品一区二区三区在线观看| 久久蜜桃av一区精品变态类天堂| 国产黄色精品网站| 亚洲国产视频一区二区| 精品国产伦一区二区三区观看方式 | 一区二区三区欧美日韩| 91精品视频网| www.亚洲色图.com| 视频一区国产视频| 欧美国产欧美亚州国产日韩mv天天看完整| av电影在线观看完整版一区二区| 亚洲国产裸拍裸体视频在线观看乱了| 日韩欧美三级在线| 91亚洲大成网污www| 日本一区中文字幕| 亚洲日本在线观看| 欧美精品一区二区三区在线播放| 一本久久综合亚洲鲁鲁五月天 | 国产精品护士白丝一区av| 欧美色精品在线视频| 国产麻豆精品theporn| 亚洲国产精品一区二区久久 | 国产精品久久免费看| 欧美体内she精视频| 高清在线观看日韩| 日本不卡一区二区三区高清视频| 中文字幕欧美激情| 欧美一区二区三区免费在线看 | 欧美日韩中文一区| 国产成人免费xxxxxxxx| 婷婷激情综合网| 中文字幕亚洲一区二区va在线| 精品人伦一区二区色婷婷| 在线观看欧美黄色| 91免费版pro下载短视频| 国产一区二区按摩在线观看| 日本在线不卡视频| 调教+趴+乳夹+国产+精品| 亚洲欧洲一区二区三区| 日本一区二区不卡视频| 精品国产乱码久久久久久影片| 91麻豆精品国产91久久久久久久久| 91片在线免费观看| 99久久99久久久精品齐齐| 国产福利视频一区二区三区| 麻豆成人在线观看| 免费在线视频一区| 免播放器亚洲一区| 蜜芽一区二区三区| 麻豆极品一区二区三区| 美女一区二区视频| 青青青伊人色综合久久| 午夜精品视频一区| 日韩av一区二区在线影视| 石原莉奈一区二区三区在线观看| 亚洲午夜久久久久久久久电影网| 亚洲精品久久7777| 亚洲午夜av在线| 午夜精品久久久久久久99水蜜桃 | 蜜桃免费网站一区二区三区| 丝袜美腿成人在线| 免费观看在线色综合| 国产一区二区三区四| 成人视屏免费看| 一本一道波多野结衣一区二区| 色婷婷综合久久久中文一区二区 | 国产综合色在线视频区| 美国十次综合导航| 国产精选一区二区三区| 成人国产精品免费观看动漫| 成人av网站免费观看| 欧美私模裸体表演在线观看| 欧美日韩一级二级三级| 日韩欧美123| 国产丝袜在线精品| 国产精品国产a| 亚洲一区免费视频| 日韩高清不卡在线| 丰满岳乱妇一区二区三区| 97久久精品人人做人人爽50路| 色国产综合视频| 91精品啪在线观看国产60岁| 久久久亚洲午夜电影| 一区视频在线播放| 视频一区视频二区中文字幕| 国产一区福利在线| 色综合久久99| 日韩欧美一二三四区| 国产精品区一区二区三| 性久久久久久久| 国产成人午夜电影网| 欧美亚洲另类激情小说| 久久综合九色综合97_久久久| 国产精品久久久久久妇女6080| 亚洲成人tv网| 波多野结衣的一区二区三区| 欧美日韩在线三级| 中文av一区二区| 免费在线观看精品|