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

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

?? wafermaprenderer.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.]
 *
 * ---------------------
 * WaferMapRenderer.java
 * ---------------------
 * (C) Copyright 2003-2005, by Robert Redburn and Contributors.
 *
 * Original Author:  Robert Redburn;
 * Contributor(s):   David Gilbert (for Object Refinery Limited);
 *
 * $Id: WaferMapRenderer.java,v 1.6.2.3 2005/11/28 12:06:35 mungady Exp $
 *
 * Changes
 * -------
 * 25-Nov-2003 : Version 1, contributed by Robert Redburn.  Changes have been 
 *               made to fit the JFreeChart coding style (DG);
 * 20-Apr-2005 : Small update for changes to LegendItem class (DG);
 *
 */

package org.jfree.chart.renderer;

import java.awt.Color;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.jfree.chart.LegendItem;
import org.jfree.chart.LegendItemCollection;
import org.jfree.chart.plot.DrawingSupplier;
import org.jfree.chart.plot.WaferMapPlot;
import org.jfree.data.general.WaferMapDataset;

/**
 * A renderer for wafer map plots.  Provides color managment facilities.
 * 
 * @author Robert Redburn.
 */
public class WaferMapRenderer extends AbstractRenderer {

    /** paint index */
    private Map paintIndex;
    
    /** plot */
    private WaferMapPlot plot;
    
    /** paint limit */
    private int paintLimit;
    
    /** default paint limit */
    private static final int DEFAULT_PAINT_LIMIT = 35;  
    
    /** default multivalue paint calculation */
    public static final int POSITION_INDEX = 0;
    
    /** The default value index. */
    public static final int VALUE_INDEX = 1;
    
    /** paint index method */
    private int paintIndexMethod;
    
    /**
     * Creates a new renderer.
     */
    public WaferMapRenderer() {
        this(null, null);
    }
    
    /**
     * Creates a new renderer.
     * 
     * @param paintLimit  the paint limit.
     * @param paintIndexMethod  the paint index method.
     */
    public WaferMapRenderer(int paintLimit, int paintIndexMethod) {
        this(new Integer(paintLimit), new Integer(paintIndexMethod));
    }
    
    /**
     * Creates a new renderer.
     * 
     * @param paintLimit  the paint limit.
     * @param paintIndexMethod  the paint index method.
     */
    public WaferMapRenderer(Integer paintLimit, Integer paintIndexMethod) {
        
        super();
        this.paintIndex = new HashMap();
        
        if (paintLimit == null) {
            this.paintLimit = DEFAULT_PAINT_LIMIT;
        }
        else {
            this.paintLimit = paintLimit.intValue();
        }
        
        this.paintIndexMethod = VALUE_INDEX;
        if (paintIndexMethod != null) {
            if (isMethodValid(paintIndexMethod.intValue())) { 
                this.paintIndexMethod = paintIndexMethod.intValue();
            }
        }
    }

    /**
     * Verifies that the passed paint index method is valid.
     * 
     * @param method  the method.
     * 
     * @return <code>true</code> or </code>false</code>.
     */
    private boolean isMethodValid(int method) {
        switch (method) {
            case POSITION_INDEX: return true;
            case VALUE_INDEX:    return true;
            default: return false;
        }
    }

    /**
     * Returns the drawing supplier from the plot.
     * 
     * @return The drawing supplier.
     */
    public DrawingSupplier getDrawingSupplier() {
        DrawingSupplier result = null;
        WaferMapPlot p = getPlot();
        if (p != null) {
            result = p.getDrawingSupplier();
        }
        return result;
    }

    /**
     * Returns the plot.
     * 
     * @return The plot.
     */
    public WaferMapPlot getPlot() {
        return this.plot;
    }

    /**
     * Sets the plot and build the paint index.
     * 
     * @param plot  the plot.
     */
    public void setPlot(WaferMapPlot plot) {
        this.plot = plot;
        makePaintIndex();
    }
    
    /**
     * Returns the paint for a given chip value.
     * 
     * @param value  the value.
     * 
     * @return The paint.
     */
    public Paint getChipColor(Number value) {
        return getSeriesPaint(getPaintIndex(value));
    }
    
    /**
     * Returns the paint index for a given chip value.
     * 
     * @param value  the value.
     * 
     * @return The paint index.
     */
    private int getPaintIndex(Number value) {
        return ((Integer) this.paintIndex.get(value)).intValue();
    }
    
    /**
     * Builds a map of chip values to paint colors.
     * paintlimit is the maximum allowed number of colors.
     */
    private void makePaintIndex() {
        if (this.plot == null) {
            return;
        }
        WaferMapDataset data = this.plot.getDataset();
        Number dataMin = data.getMinValue();
        Number dataMax = data.getMaxValue();
        Set uniqueValues = data.getUniqueValues();
        if (uniqueValues.size() <= this.paintLimit) {
            int count = 0; // assign a color for each unique value
            for (Iterator i = uniqueValues.iterator(); i.hasNext();) {
                this.paintIndex.put(i.next(), new Integer(count++));
            }
        }
        else {  
            // more values than paints so map
            // multiple values to the same color
            switch (this.paintIndexMethod) {
                case POSITION_INDEX: 
                    makePositionIndex(uniqueValues); 
                    break;
                case VALUE_INDEX:    
                    makeValueIndex(dataMax, dataMin, uniqueValues); 
                    break;
                default:
                    break;
            }
        }
    }
        
    /**
     * Builds the paintindex by assigning colors based on the number 
     * of unique values: totalvalues/totalcolors.
     * 
     * @param uniqueValues  the set of unique values.
     */
    private void makePositionIndex(Set uniqueValues) {
        int valuesPerColor = (int) Math.ceil(
            (double) uniqueValues.size() / this.paintLimit
        );
        int count = 0; // assign a color for each unique value
        int paint = 0;
        for (Iterator i = uniqueValues.iterator(); i.hasNext();) {
            this.paintIndex.put(i.next(), new Integer(paint));
            if (++count % valuesPerColor == 0) {
                paint++;
            }
            if (paint > this.paintLimit) {
                paint = this.paintLimit;
            }
        }
    }

    /**
     * Builds the paintindex by assigning colors evenly across the range
     * of values:  maxValue-minValue/totalcolors
     * 
     * @param max  the maximum value.
     * @param min  the minumum value.
     * @param uniqueValues  the unique values.
     */
    private void makeValueIndex(Number max, Number min, Set uniqueValues) {
        double valueRange = max.doubleValue() - min.doubleValue();
        double valueStep = valueRange / this.paintLimit;
        int paint = 0;
        double cutPoint = min.doubleValue() + valueStep;
        for (Iterator i = uniqueValues.iterator(); i.hasNext();) {
            Number value = (Number) i.next();
            while (value.doubleValue() > cutPoint) {
                cutPoint += valueStep;
                paint++;
                if (paint > this.paintLimit) {
                    paint = this.paintLimit;
                }
            } 
            this.paintIndex.put(value, new Integer(paint));
        }
    }

    /**
     * Builds the list of legend entries.  called by getLegendItems in
     * WaferMapPlot to populate the plot legend.
     * 
     * @return The legend items.
     */
    public LegendItemCollection getLegendCollection() {
        LegendItemCollection result = new LegendItemCollection();
        if (this.paintIndex != null && this.paintIndex.size() > 0) {
            if (this.paintIndex.size() <= this.paintLimit) {
                for (Iterator i = this.paintIndex.entrySet().iterator(); 
                     i.hasNext();) {
                    // in this case, every color has a unique value
                    Map.Entry entry =  (Map.Entry) i.next();
                    String label = entry.getKey().toString();
                    String description = label;
                    Shape shape = new Rectangle2D.Double(1d, 1d, 1d, 1d);
                    Paint paint = getSeriesPaint(
                        ((Integer) entry.getValue()).intValue()
                    );
                    Paint outlinePaint = Color.black;
                    Stroke outlineStroke = DEFAULT_STROKE;

                    result.add(new LegendItem(label, description, null, 
                            null, shape, paint, outlineStroke, outlinePaint));
                    
                }               
            }
            else {
                // in this case, every color has a range of values
                Set unique = new HashSet();
                for (Iterator i = this.paintIndex.entrySet().iterator(); 
                     i.hasNext();) {
                    Map.Entry entry = (Map.Entry) i.next();
                    if (unique.add(entry.getValue())) {
                        String label = getMinPaintValue(
                            (Integer) entry.getValue()).toString()
                            + " - " + getMaxPaintValue(
                                (Integer) entry.getValue()).toString();
                        String description = label;
                        Shape shape = new Rectangle2D.Double(1d, 1d, 1d, 1d);
                        Paint paint = getSeriesPaint(
                            ((Integer) entry.getValue()).intValue()
                        );
                        Paint outlinePaint = Color.black;
                        Stroke outlineStroke = DEFAULT_STROKE;

                        result.add(new LegendItem(label, description, 
                                null, null, shape, paint, outlineStroke, 
                                outlinePaint));
                    }
                } // end foreach map entry
            } // end else
        }
        return result;
    }

    /**
     * Returns the minimum chip value assigned to a color
     * in the paintIndex
     * 
     * @param index  the index.
     * 
     * @return The value.
     */
    private Number getMinPaintValue(Integer index) {
        double minValue = Double.POSITIVE_INFINITY;
        for (Iterator i = this.paintIndex.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            if (((Integer) entry.getValue()).equals(index)) {
                if (((Number) entry.getKey()).doubleValue() < minValue) {
                    minValue = ((Number) entry.getKey()).doubleValue();
                }
            }
        }               
        return new Double(minValue);
    }
    
    /**
     * Returns the maximum chip value assigned to a color
     * in the paintIndex
     * 
     * @param index  the index.
     * 
     * @return The value
     */
    private Number getMaxPaintValue(Integer index) {
        double maxValue = Double.NEGATIVE_INFINITY;
        for (Iterator i = this.paintIndex.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            if (((Integer) entry.getValue()).equals(index)) {
                if (((Number) entry.getKey()).doubleValue() > maxValue) {
                    maxValue = ((Number) entry.getKey()).doubleValue();
                }
            }
        }               
        return new Double(maxValue);
    }


} // end class wafermaprenderer

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
性感美女久久精品| 成人av资源在线观看| 国产成人精品www牛牛影视| 一本大道久久a久久精二百| 91精品国产黑色紧身裤美女| 久久精品视频免费| 日本不卡在线视频| 日本韩国欧美一区| 国产日本欧洲亚洲| 日本va欧美va精品| 欧美性色aⅴ视频一区日韩精品| 2017欧美狠狠色| 亚欧色一区w666天堂| 91蝌蚪porny九色| 久久精品一区四区| 久久精品国产99国产| 欧美三级中文字| 亚洲精品综合在线| 波多野结衣一区二区三区| 久久综合av免费| 老司机午夜精品| 欧美一区二区视频在线观看2020| 亚洲欧美色一区| 成人aa视频在线观看| 欧美激情一区在线| 欧美一级高清片| 亚洲国产日韩一区二区| 色就色 综合激情| 中文字幕一区二区在线观看 | 精品嫩草影院久久| 日本不卡高清视频| 日韩一区国产二区欧美三区| 亚洲成人午夜影院| 欧美日韩国产综合草草| 香蕉久久夜色精品国产使用方法| 欧美丝袜第三区| 首页综合国产亚洲丝袜| 6080亚洲精品一区二区| 美女精品自拍一二三四| 欧美电视剧在线观看完整版| 免费不卡在线观看| 久久久久国产精品免费免费搜索| 激情综合网激情| 日本一区二区高清| 色综合久久综合中文综合网| 亚洲欧美日韩小说| 欧美久久久久中文字幕| 免费观看91视频大全| 26uuu色噜噜精品一区| 成人永久免费视频| 一区二区在线观看视频在线观看| 久久青草国产手机看片福利盒子| 麻豆高清免费国产一区| 国产欧美一区二区在线| av一区二区不卡| 亚洲成人在线观看视频| 日韩免费性生活视频播放| 狠狠色丁香久久婷婷综| 欧美高清在线精品一区| 欧洲一区二区av| 久久精品国内一区二区三区| 国产亚洲欧美在线| 91成人免费在线视频| 日韩成人午夜精品| 国产精品久久毛片| 精品视频1区2区3区| 国产真实精品久久二三区| 国产精品久久久久影院色老大| 欧美三级电影在线观看| 国产乱国产乱300精品| 亚洲人妖av一区二区| 日韩欧美你懂的| 成人av电影免费在线播放| 首页亚洲欧美制服丝腿| 国产精品网站一区| 欧美精品日日鲁夜夜添| 国产成人av福利| 日韩高清在线一区| 亚洲色图.com| 精品久久久久久综合日本欧美| 91视频在线观看| 激情小说欧美图片| 亚洲电影欧美电影有声小说| 久久久久久久久99精品| 欧美日韩亚洲综合一区| 成人一区二区三区视频在线观看| 日韩电影在线观看网站| 中文字幕亚洲精品在线观看| 欧美不卡激情三级在线观看| 欧美性一级生活| 成人精品免费网站| 麻豆精品一区二区三区| 亚洲成人tv网| 亚洲激情在线播放| 中文字幕乱码亚洲精品一区| 亚洲图片欧美一区| 中文字幕亚洲电影| 国产偷v国产偷v亚洲高清| 日韩欧美色综合网站| 91精品国产麻豆| 欧美日本乱大交xxxxx| 色香色香欲天天天影视综合网| 国产高清不卡二三区| 九色综合狠狠综合久久| 免费观看30秒视频久久| 丝袜诱惑制服诱惑色一区在线观看| 亚洲人成在线观看一区二区| 国产亚洲精久久久久久| 欧美成va人片在线观看| 欧美成人video| 日韩欧美激情一区| 欧美成va人片在线观看| 欧美成人综合网站| 精品av久久707| 精品电影一区二区三区| 日韩精品一区二区三区中文不卡| 337p亚洲精品色噜噜| 91麻豆精品久久久久蜜臀| 欧美日韩在线不卡| 欧美网站一区二区| 欧美日韩一二三| 欧美精品色一区二区三区| 91精品视频网| 精品日韩在线观看| 久久精品夜色噜噜亚洲a∨| 国产亚洲精品bt天堂精选| 久久久欧美精品sm网站| 国产精品久久久久天堂| 亚洲精品日产精品乱码不卡| 夜夜夜精品看看| 亚洲成a人v欧美综合天堂| 日韩经典一区二区| 久久99精品久久久久婷婷| 国产福利精品一区二区| 成人av在线观| 欧美日韩精品一区二区三区蜜桃 | 欧美精品一区二区蜜臀亚洲| 久久久亚洲精品石原莉奈| 国产欧美一二三区| 亚洲欧洲中文日韩久久av乱码| 亚洲主播在线观看| 蜜桃视频第一区免费观看| 国产成人亚洲综合色影视| 色偷偷一区二区三区| 91精品国产乱| 国产精品不卡一区| 日韩黄色在线观看| 成人一区在线观看| 在线播放/欧美激情| 国产亚洲自拍一区| 亚洲二区在线观看| 国产一区啦啦啦在线观看| 91麻豆精品在线观看| 91精品国产综合久久福利| 欧美国产97人人爽人人喊| 午夜欧美一区二区三区在线播放| 国产一区二区三区在线观看精品| av激情综合网| 精品国产一区久久| 亚洲一区二区欧美激情| 国产·精品毛片| 欧美精品色一区二区三区| 国产精品色哟哟网站| 免费在线成人网| 91免费看`日韩一区二区| 欧美一区二区三区在| 亚洲视频网在线直播| 国产在线精品不卡| 欧美日韩在线播放一区| 国产精品乱子久久久久| 美腿丝袜在线亚洲一区| 91国内精品野花午夜精品| 久久久亚洲精品石原莉奈 | 精品一区二区三区视频| 91久久精品网| 国产精品美女久久久久高潮| 毛片av一区二区| 欧美在线视频全部完| 国产精品久久久久久久久果冻传媒| 免费成人美女在线观看.| 欧美日韩一区二区三区不卡 | 日韩无一区二区| 亚洲国产综合色| 日本高清不卡视频| 国产精品视频在线看| 经典三级在线一区| 日韩午夜精品电影| 丝袜亚洲精品中文字幕一区| 99国产一区二区三精品乱码| 国产精品麻豆99久久久久久| 国产一区二区不卡| 久久久美女毛片| 国产麻豆9l精品三级站| 欧美va亚洲va国产综合| 免费观看久久久4p| 欧美va天堂va视频va在线| 久久国产视频网| 欧美精品一区二| 国产在线不卡一区| 亚洲国产高清在线观看视频|