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

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

?? stackedbarrenderer3d.java

?? jfreechart1.0.1 jsp繪制圖表的開發包
?? JAVA
字號:
/* ===========================================================
 * 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.]
 *
 * -------------------------
 * StackedBarRenderer3D.java
 * -------------------------
 * (C) Copyright 2000-2005, by Serge V. Grachov and Contributors.
 *
 * Original Author:  Serge V. Grachov;
 * Contributor(s):   David Gilbert (for Object Refinery Limited);
 *                   Richard Atkinson;
 *                   Christian W. Zuckschwerdt;
 *
 * $Id: StackedBarRenderer3D.java,v 1.8.2.3 2005/10/25 20:54:16 mungady Exp $
 *
 * Changes
 * -------
 * 31-Oct-2001 : Version 1, contributed by Serge V. Grachov (DG);
 * 15-Nov-2001 : Modified to allow for null data values (DG);
 * 13-Dec-2001 : Added tooltips (DG);
 * 15-Feb-2002 : Added isStacked() method (DG);
 * 24-May-2002 : Incorporated tooltips into chart entities (DG);
 * 19-Jun-2002 : Added check for null info in drawCategoryItem method (DG);
 * 25-Jun-2002 : Removed redundant imports (DG);
 * 26-Jun-2002 : Small change to entity (DG);
 * 05-Aug-2002 : Small modification to drawCategoryItem method to support URLs 
 *               for HTML image maps (RA);
 * 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
 * 24-Oct-2002 : Amendments for changes in CategoryDataset interface and 
 *               CategoryToolTipGenerator interface (DG);
 * 05-Nov-2002 : Replaced references to CategoryDataset with TableDataset (DG);
 * 26-Nov-2002 : Replaced isStacked() method with getRangeType() method (DG);
 * 17-Jan-2003 : Moved plot classes to a separate package (DG);
 * 25-Mar-2003 : Implemented Serializable (DG);
 * 01-May-2003 : Added default constructor (bug 726235) and fixed bug 
 *               726260) (DG);
 * 13-May-2003 : Renamed StackedVerticalBarRenderer3D 
 *               --> StackedBarRenderer3D (DG);
 * 30-Jul-2003 : Modified entity constructor (CZ);
 * 07-Oct-2003 : Added renderer state (DG);
 * 21-Nov-2003 : Added a new constructor (DG);
 * 27-Nov-2003 : Modified code to respect maxBarWidth setting (DG);
 * 11-Aug-2004 : Fixed bug where isDrawBarOutline() was ignored (DG);
 * 05-Nov-2004 : Modified drawItem() signature (DG);
 * 07-Jan-2005 : Renamed getRangeExtent() --> findRangeBounds (DG);
 * 18-Mar-2005 : Override for getPassCount() method (DG);
 * 20-Apr-2005 : Renamed CategoryLabelGenerator 
 *               --> CategoryItemLabelGenerator (DG);
 * 09-Jun-2005 : Use addItemEntity() method from superclass (DG);
 * 22-Sep-2005 : Renamed getMaxBarWidth() --> getMaximumBarWidth() (DG);
 *
 */

package org.jfree.chart.renderer.category;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;

import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.entity.EntityCollection;
import org.jfree.chart.labels.CategoryItemLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.Range;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.general.DatasetUtilities;
import org.jfree.ui.RectangleEdge;
import org.jfree.util.PublicCloneable;

/**
 * Renders stacked bars with 3D-effect, for use with the 
 * {@link org.jfree.chart.plot.CategoryPlot} class.
 */
public class StackedBarRenderer3D extends BarRenderer3D 
                                  implements Cloneable, PublicCloneable, 
                                             Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -5832945916493247123L;
    
    /**
     * Creates a new renderer with no tool tip generator and no URL generator.
     * <P>
     * The defaults (no tool tip or URL generators) have been chosen to 
     * minimise the processing required to generate a default chart.  If you 
     * require tool tips or URLs, then you can easily add the required 
     * generators.
     */
    public StackedBarRenderer3D() {
        super();
    }

    /**
     * Constructs a new renderer with the specified '3D effect'.
     *
     * @param xOffset  the x-offset for the 3D effect.
     * @param yOffset  the y-offset for the 3D effect.
     */
    public StackedBarRenderer3D(double xOffset, double yOffset) {
        super(xOffset, yOffset);
    }

    /**
     * Returns the range of values the renderer requires to display all the 
     * items from the specified dataset.
     * 
     * @param dataset  the dataset (<code>null</code> not permitted).
     * 
     * @return The range (or <code>null</code> if the dataset is empty).
     */
    public Range findRangeBounds(CategoryDataset dataset) {
        return DatasetUtilities.findStackedRangeBounds(dataset);   
    }

    /**
     * Calculates the bar width and stores it in the renderer state.
     * 
     * @param plot  the plot.
     * @param dataArea  the data area.
     * @param rendererIndex  the renderer index.
     * @param state  the renderer state.
     */
    protected void calculateBarWidth(CategoryPlot plot, 
                                     Rectangle2D dataArea, 
                                     int rendererIndex,
                                     CategoryItemRendererState state) {

        // calculate the bar width
        CategoryAxis domainAxis = getDomainAxis(plot, rendererIndex);
        CategoryDataset data = plot.getDataset(rendererIndex);
        if (data != null) {
            PlotOrientation orientation = plot.getOrientation();
            double space = 0.0;
            if (orientation == PlotOrientation.HORIZONTAL) {
                space = dataArea.getHeight();
            }
            else if (orientation == PlotOrientation.VERTICAL) {
                space = dataArea.getWidth();
            }
            double maxWidth = space * getMaximumBarWidth();
            int columns = data.getColumnCount();
            double categoryMargin = 0.0;
            if (columns > 1) {
                categoryMargin = domainAxis.getCategoryMargin();
            }

            double used = space * (1 - domainAxis.getLowerMargin() 
                                     - domainAxis.getUpperMargin()
                                     - categoryMargin);
            if (columns > 0) {
                state.setBarWidth(Math.min(used / columns, maxWidth));
            }
            else {
                state.setBarWidth(Math.min(used, maxWidth));
            }
        }

    }
    
    /**
     * Draws a stacked bar (with 3D-effect) for a specific item.
     *
     * @param g2  the graphics device.
     * @param state  the renderer state.
     * @param dataArea  the plot area.
     * @param plot  the plot.
     * @param domainAxis  the domain (category) axis.
     * @param rangeAxis  the range (value) axis.
     * @param dataset  the data.
     * @param row  the row index (zero-based).
     * @param column  the column index (zero-based).
     * @param pass  the pass index.
     */
    public void drawItem(Graphics2D g2,
                         CategoryItemRendererState state,
                         Rectangle2D dataArea,
                         CategoryPlot plot,
                         CategoryAxis domainAxis,
                         ValueAxis rangeAxis,
                         CategoryDataset dataset,
                         int row,
                         int column,
                         int pass) {

        // check the value we are plotting...
        Number dataValue = dataset.getValue(row, column);
        if (dataValue == null) {
            return;
        }
        
        double value = dataValue.doubleValue();
        
        Rectangle2D adjusted = new Rectangle2D.Double(
            dataArea.getX(), dataArea.getY() + getYOffset(),
            dataArea.getWidth() - getXOffset(), 
            dataArea.getHeight() - getYOffset()
        );

        PlotOrientation orientation = plot.getOrientation();

        double barW0 = domainAxis.getCategoryMiddle(
            column, getColumnCount(), adjusted, plot.getDomainAxisEdge()
        ) - state.getBarWidth() / 2.0;

        double positiveBase = getBase();
        double negativeBase = positiveBase;
        for (int i = 0; i < row; i++) {
            Number v = dataset.getValue(i, column);
            if (v != null) {
                double d = v.doubleValue();
                if (d > 0) {
                    positiveBase = positiveBase + d;
                }
                else {
                    negativeBase = negativeBase + d;
                }
            }
        }

        double translatedBase;
        double translatedValue;
        RectangleEdge location = plot.getRangeAxisEdge();
        if (value > 0.0) {
            translatedBase = rangeAxis.valueToJava2D(positiveBase, adjusted, 
                    location);
            translatedValue = rangeAxis.valueToJava2D(positiveBase + value, 
                    adjusted, location);
        }
        else {
            translatedBase = rangeAxis.valueToJava2D(negativeBase, adjusted, 
                    location);
            translatedValue = rangeAxis.valueToJava2D(negativeBase + value, 
                    adjusted, location);
        }
        double barL0 = Math.min(translatedBase, translatedValue);
        double barLength = Math.max(
            Math.abs(translatedValue - translatedBase), getMinimumBarLength()
        );

        Rectangle2D bar = null;
        if (orientation == PlotOrientation.HORIZONTAL) {
            bar = new Rectangle2D.Double(barL0, barW0, barLength, 
                    state.getBarWidth());
        }
        else {
            bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), 
                    barLength);
        }
        Paint itemPaint = getItemPaint(row, column);
        g2.setPaint(itemPaint);
        g2.fill(bar);

        if (pass == 0) {
            double x0 = bar.getMinX();
            double x1 = x0 + getXOffset();
            double x2 = bar.getMaxX();
            double x3 = x2 + getXOffset();
        
            double y0 = bar.getMinY() - getYOffset();
            double y1 = bar.getMinY();
            double y2 = bar.getMaxY() - getYOffset();
            double y3 = bar.getMaxY();
        
            GeneralPath bar3dRight = null;
            GeneralPath bar3dTop = null;
            if (value > 0.0 || orientation == PlotOrientation.VERTICAL) {
                bar3dRight = new GeneralPath();
                bar3dRight.moveTo((float) x2, (float) y3);
                bar3dRight.lineTo((float) x2, (float) y1);
                bar3dRight.lineTo((float) x3, (float) y0);
                bar3dRight.lineTo((float) x3, (float) y2);
                bar3dRight.closePath();

                if (itemPaint instanceof Color) {
                    g2.setPaint(((Color) itemPaint).darker());
                }
                g2.fill(bar3dRight);
            }

            if (value > 0.0 || orientation == PlotOrientation.HORIZONTAL) {
                bar3dTop = new GeneralPath();
                bar3dTop.moveTo((float) x0, (float) y1);
                bar3dTop.lineTo((float) x1, (float) y0);
                bar3dTop.lineTo((float) x3, (float) y0);
                bar3dTop.lineTo((float) x2, (float) y1);
                bar3dTop.closePath();
                g2.fill(bar3dTop);
            }

            if (isDrawBarOutline() && state.getBarWidth() > 3) {
                g2.setStroke(getItemOutlineStroke(row, column));
                g2.setPaint(getItemOutlinePaint(row, column));
                g2.draw(bar);
                if (bar3dRight != null) {
                    g2.draw(bar3dRight);
                }
                if (bar3dTop != null) {
                    g2.draw(bar3dTop);
                }
            }

            // add an item entity, if this information is being collected
            EntityCollection entities = state.getEntityCollection();
            if (entities != null) {
                addItemEntity(entities, dataset, row, column, bar);
            }
        }
        else if (pass == 1) {
            CategoryItemLabelGenerator generator 
                = getItemLabelGenerator(row, column);
            if (generator != null && isItemLabelVisible(row, column)) {
                drawItemLabel(
                    g2, dataset, row, column, plot, generator, bar, 
                    (value < 0.0)
                );
            }
        }

    }
    
    /**
     * Returns the number of passes through the dataset required by the 
     * renderer.  This method returns <code>2</code>, the second pass is used
     * to draw the item labels.
     * 
     * @return The pass count.
     */
    public int getPassCount() {
        return 2;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品亚洲一区二区三区浴池 | 欧美精品一区二区精品网| 欧美情侣在线播放| 欧美大胆人体bbbb| 国产调教视频一区| 亚洲免费视频中文字幕| 五月婷婷综合网| 国产精品一区二区免费不卡| 成人av先锋影音| 欧美日韩国产小视频在线观看| 日韩免费在线观看| 自拍偷在线精品自拍偷无码专区 | 91免费观看国产| 欧美大片在线观看| 夜色激情一区二区| 国产精品一区二区三区99| 在线精品视频免费观看| 久久品道一品道久久精品| 韩国精品在线观看| 91视频xxxx| 国产女人aaa级久久久级| 日韩电影在线看| 在线免费观看日本一区| 国产精品国产三级国产aⅴ中文 | 欧美一区二区三区四区在线观看 | 成人激情午夜影院| 国产视频一区二区在线观看| 麻豆一区二区在线| 欧美无人高清视频在线观看| 丝袜美腿亚洲一区二区图片| 欧洲一区二区av| 亚洲精品免费电影| 在线视频欧美精品| 亚洲一区免费视频| 91麻豆精品久久久久蜜臀| 五月综合激情婷婷六月色窝| 欧美视频第二页| 日本不卡高清视频| 日韩理论片网站| 欧美亚洲动漫精品| 亚洲bt欧美bt精品777| 欧美日韩亚洲综合在线 | 日韩丝袜美女视频| 国产成人免费视频一区| 国产精品萝li| 欧美日韩高清一区| 国产在线看一区| 国产精品午夜久久| 欧美亚洲精品一区| 91久久香蕉国产日韩欧美9色| 国产精品成人一区二区艾草 | 亚洲情趣在线观看| 欧美成人精精品一区二区频| 国产精品18久久久久久vr| 亚洲色图.com| 久久色中文字幕| 51精品久久久久久久蜜臀| 北条麻妃一区二区三区| 久久精品国产精品亚洲精品| 自拍av一区二区三区| 国产片一区二区| 精品精品国产高清一毛片一天堂| 日本精品一级二级| 99精品偷自拍| 粉嫩高潮美女一区二区三区| 日韩中文字幕区一区有砖一区| 欧美国产精品专区| 国产精品少妇自拍| 精品毛片乱码1区2区3区| 欧美午夜精品电影| www.亚洲人| www.亚洲国产| 91在线云播放| 色婷婷激情久久| 成人一道本在线| 成人免费看视频| 久久精品国产久精国产爱| 美日韩一级片在线观看| 亚洲国产乱码最新视频 | 91国模大尺度私拍在线视频| 成人丝袜18视频在线观看| 国产激情偷乱视频一区二区三区| 麻豆一区二区三| 国产精品一区不卡| 9人人澡人人爽人人精品| 欧美性xxxxxxxx| 精品国产乱码久久久久久久久| 欧美电影免费观看高清完整版在线| 日韩精品一区在线观看| 国产视频一区在线观看| 亚洲精品欧美激情| 激情六月婷婷综合| 97精品国产露脸对白| 欧美在线短视频| 日韩色在线观看| 国产精品免费网站在线观看| 一区二区三区四区国产精品| 美腿丝袜一区二区三区| 97精品超碰一区二区三区| 色94色欧美sute亚洲线路二| 欧美四级电影在线观看| 国产亚洲视频系列| 亚洲高清视频中文字幕| 不卡av免费在线观看| 日韩精品一区二区三区视频在线观看| 国产日产欧美一区| 麻豆国产欧美一区二区三区| 色88888久久久久久影院按摩| 久久亚洲二区三区| 免费看精品久久片| 欧美综合视频在线观看| 国产亚洲女人久久久久毛片| 日韩二区三区四区| 在线观看欧美精品| 成人免费在线视频| 国产麻豆精品一区二区| 久久综合色天天久久综合图片| 免费人成黄页网站在线一区二区 | 国产精品久久99| 丁香激情综合国产| 日本一区二区三级电影在线观看| 秋霞成人午夜伦在线观看| 在线免费不卡视频| 亚洲一区二区三区激情| 色妞www精品视频| 亚洲一区二区美女| 欧美亚洲另类激情小说| 爽好久久久欧美精品| 欧美成人a∨高清免费观看| 狠狠久久亚洲欧美| 中文字幕免费一区| 欧美丝袜丝交足nylons图片| 亚洲va欧美va国产va天堂影院| 欧美视频一区二区三区在线观看| 亚洲成人av一区二区| 日韩美女视频一区二区在线观看| 精品在线观看免费| 国产精品欧美一区二区三区| 99久久婷婷国产综合精品电影| 午夜精品福利一区二区三区av| 精品剧情在线观看| 成人avav影音| 免费观看成人av| 一区二区三区日本| 91精品国产综合久久久久久久久久 | 亚洲免费色视频| 久久精品夜夜夜夜久久| 欧美日韩二区三区| 国产精品77777竹菊影视小说| 亚洲婷婷综合色高清在线| 日韩一区二区三区免费看| 成人不卡免费av| 久久国产日韩欧美精品| 亚洲精品视频在线观看网站| 欧美va亚洲va国产综合| 欧美视频三区在线播放| 91麻豆蜜桃一区二区三区| 丰满少妇在线播放bd日韩电影| 男女男精品网站| 视频一区欧美精品| 亚洲综合成人网| 一区二区三区中文免费| 中文字幕av一区二区三区高| 久久久青草青青国产亚洲免观| 欧美三级中文字幕在线观看| 色网综合在线观看| 91视频xxxx| 欧美日韩精品一区二区三区蜜桃 | 国产精品久久久久影院| 国产喂奶挤奶一区二区三区| 日韩一级精品视频在线观看| 日韩欧美中文一区二区| 精品999久久久| 久久久久久久久久久电影| 欧美精品一区二区久久婷婷| 久久尤物电影视频在线观看| 久久久综合九色合综国产精品| 26uuu亚洲综合色| 国产精品女同互慰在线看| 中文字幕一区二区三区在线不卡| 国产精品三级视频| 亚洲一区二区三区视频在线播放| 亚洲一区二区视频| 久久成人免费电影| 成人一区二区三区视频| 日本久久一区二区三区| 欧美久久一二三四区| 久久美女高清视频| 亚瑟在线精品视频| 国产一区二区三区在线看麻豆| 成人做爰69片免费看网站| 欧美中文字幕一区二区三区 | 午夜激情久久久| 成人美女在线视频| 日韩欧美成人一区| 亚洲va韩国va欧美va精品 | 国产三级精品视频| 亚洲一区二区在线免费看| 国产一区二区成人久久免费影院 | 丝袜国产日韩另类美女|