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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? colorpalette.java

?? 制作圖表的好工具
?? JAVA
字號(hào):
/* ===========================================================
 * 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.]
 *
 * -----------------
 * ColorPalette.java
 * -----------------
 * (C) Copyright 2002-2005, by David M. O'Donnell and Contributors.
 *
 * Original Author:  David M. O'Donnell;
 * Contributor(s):   David Gilbert (for Object Refinery Limited);
 *
 * $Id: ColorPalette.java,v 1.1.2.1 2005/11/24 16:11:49 mungady Exp $
 *
 * Changes
 * -------
 * 26-Nov-2002 : Version 1 contributed by David M. O'Donnell (DG);
 * 26-Mar-2003 : Implemented Serializable (DG);
 * 14-Aug-2003 : Implemented Cloneable (DG);
 *
 */

package org.jfree.chart.plot;

import java.awt.Color;
import java.awt.Paint;
import java.io.Serializable;
import java.util.Arrays;

import org.jfree.chart.axis.ValueTick;

/**
 * Defines palette used in Contour Plots.
 *
 * @author David M. O'Donnell.
 */
public abstract class ColorPalette implements Cloneable, Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -9029901853079622051L;
    
    /** The min z-axis value. */
    protected double minZ = -1;

    /** The max z-axis value. */
    protected double maxZ = -1;

    /** Red components. */
    protected int[] r;

    /** Green components. */
    protected int[] g;

    /** Blue components. */
    protected int[] b;

    /** Tick values are stored for use with stepped palette. */
    protected double[] tickValues = null;

    /** Logscale? */
    protected boolean logscale = false;

    /** Inverse palette (ie, min and max colors are reversed). */
    protected boolean inverse = false;

    /** The palette name. */
    protected String paletteName = null;

    /** Controls whether palette colors are stepped (not continuous). */
    protected boolean stepped = false;

    /** Constant for converting loge to log10. */
    protected static final double log10 = Math.log(10);
    
    /**
     * Default contructor.
     */
    public ColorPalette() {
        super();
    }

    /**
     * Returns the color associated with a value.
     *
     * @param value  the value.
     *
     * @return The color.
     */
    public Paint getColor(double value) {
        int izV = (int) (253 * (value - this.minZ) 
                    / (this.maxZ - this.minZ)) + 2;
        return new Color(this.r[izV], this.g[izV], this.b[izV]);
    }

    /**
     * Returns a color.
     *
     * @param izV  ??.
     *
     * @return The color.
     */
    public Color getColor(int izV) {
        return new Color(this.r[izV], this.g[izV], this.b[izV]);
    }

    /**
     * Returns Color by mapping a given value to a linear palette.
     *
     * @param value  the value.
     *
     * @return The color.
     */
    public Color getColorLinear(double value) {
        int izV = 0;
        if (this.stepped) {
            int index = Arrays.binarySearch(this.tickValues, value);
            if (index < 0) {
                index = -1 * index - 2;
            }

            if (index < 0) { // For the case were the first tick is greater 
                             // than minZ
                value = this.minZ;
            }
            else {
                value = this.tickValues[index];
            }
        }
        izV = (int) (253 * (value - this.minZ) / (this.maxZ - this.minZ)) + 2;
        izV = Math.min(izV, 255);
        izV = Math.max(izV, 2);
        return getColor(izV);
    }

    /**
     * Returns Color by mapping a given value to a common log palette.
     *
     * @param value  the value.
     *
     * @return The color.
     */
    public Color getColorLog(double value) {
        int izV = 0;
        double minZtmp = this.minZ;
        double maxZtmp = this.maxZ;
        if (this.minZ <= 0.0) {
//          negatives = true;
            this.maxZ = maxZtmp - minZtmp + 1;
            this.minZ = 1;
            value = value - minZtmp + 1;
        }
        double minZlog = Math.log(this.minZ) / log10;
        double maxZlog = Math.log(this.maxZ) / log10;
        value = Math.log(value) / log10;
        //  value = Math.pow(10,value);
        if (this.stepped) {
            int numSteps = this.tickValues.length;
            int steps = 256 / (numSteps - 1);
            izV = steps * (int) (numSteps * (value - minZlog) 
                    / (maxZlog - minZlog)) + 2;
            //  izV = steps*numSteps*(int)((value/minZ)/(maxZlog-minZlog)) + 2;
        }
        else {
            izV = (int) (253 * (value - minZlog) / (maxZlog - minZlog)) + 2;
        }
        izV = Math.min(izV, 255);
        izV = Math.max(izV, 2);

        this.minZ = minZtmp;
        this.maxZ = maxZtmp;

        return getColor(izV);
    }

    /**
     * Returns the maximum Z value.
     *
     * @return The value.
     */
    public double getMaxZ() {
        return this.maxZ;
    }

    /**
     * Returns the minimum Z value.
     *
     * @return The value.
     */
    public double getMinZ() {
        return this.minZ;
    }

    /**
     * Returns Paint by mapping a given value to a either a linear or common 
     * log palette as controlled by the value logscale.
     *
     * @param value  the value.
     *
     * @return The paint.
     */
    public Paint getPaint(double value) {
        if (isLogscale()) {
            return getColorLog(value);
        }
        else {
            return getColorLinear(value);
        }
    }

    /**
     * Returns the palette name.
     *
     * @return The palette name.
     */
    public String getPaletteName () {
        return this.paletteName;
    }

    /**
     * Returns the tick values.
     *
     * @return The tick values.
     */
    public double[] getTickValues() {
        return this.tickValues;
    }

    /**
     * Called to initialize the palette's color indexes
     */
    public abstract void initialize();

    /**
     * Inverts Palette
     */
    public void invertPalette() {

        int[] red = new int[256];
        int[] green = new int[256];
        int[] blue = new int[256];
        for (int i = 0; i < 256; i++) {
            red[i] = this.r[i];
            green[i] = this.g[i];
            blue[i] = this.b[i];
        }

        for (int i = 2; i < 256; i++) {
            this.r[i] = red[257 - i];
            this.g[i] = green[257 - i];
            this.b[i] = blue[257 - i];
        }
    }

    /**
     * Returns the inverse flag.
     *
     * @return The flag.
     */
    public boolean isInverse () {
        return this.inverse;
    }

    /**
     * Returns the log-scale flag.
     *
     * @return The flag.
     */
    public boolean isLogscale() {
        return this.logscale;
    }

    /**
     * Returns the 'is-stepped' flag.
     *
     * @return The flag.
     */
    public boolean isStepped () {
        return this.stepped;
    }

    /**
     * Sets the inverse flag.
     *
     * @param inverse  the new value.
     */
    public void setInverse (boolean inverse) {
        this.inverse = inverse;
        initialize();
        if (inverse) {
            invertPalette();
        }
        return;
    }

    /**
     * Sets the 'log-scale' flag.
     *
     * @param logscale  the new value.
     */
    public void setLogscale(boolean logscale) {
        this.logscale = logscale;
    }

    /**
     * Sets the maximum Z value.
     *
     * @param newMaxZ  the new value.
     */
    public void setMaxZ(double newMaxZ) {
        this.maxZ = newMaxZ;
    }

    /**
     * Sets the minimum Z value.
     *
     * @param newMinZ  the new value.
     */
    public void setMinZ(double newMinZ) {
        this.minZ = newMinZ;
    }

    /**
     * Sets the palette name.
     *
     * @param paletteName  the name.
     */
    public void setPaletteName (String paletteName) {
        //String oldValue = this.paletteName;
        this.paletteName = paletteName;
        return;
    }

    /**
     * Sets the stepped flag.
     *
     * @param stepped  the flag.
     */
    public void setStepped (boolean stepped) {
        this.stepped = stepped;
        return;
    }

    /**
     * Sets the tick values.
     *
     * @param newTickValues  the tick values.
     */
    public void setTickValues(double[] newTickValues) {
        this.tickValues = newTickValues;
    }

    /**
     * Store ticks. Required when doing stepped axis
     *
     * @param ticks  the ticks.
     */
    public void setTickValues(java.util.List ticks) {
        this.tickValues = new double[ticks.size()];
        for (int i = 0; i < this.tickValues.length; i++) {
            this.tickValues[i] = ((ValueTick) ticks.get(i)).getValue();
        }
    }

    /**
     * Tests an object for equality with this instance.
     * 
     * @param o  the object to test.
     * 
     * @return A boolean.
     */    
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ColorPalette)) {
            return false;
        }

        ColorPalette colorPalette = (ColorPalette) o;

        if (this.inverse != colorPalette.inverse) {
            return false;
        }
        if (this.logscale != colorPalette.logscale) {
            return false;
        }
        if (this.maxZ != colorPalette.maxZ) {
            return false;
        }
        if (this.minZ != colorPalette.minZ) {
            return false;
        }
        if (this.stepped != colorPalette.stepped) {
            return false;
        }
        if (!Arrays.equals(this.b, colorPalette.b)) {
            return false;
        }
        if (!Arrays.equals(this.g, colorPalette.g)) {
            return false;
        }
        if (this.paletteName != null 
                ? !this.paletteName.equals(colorPalette.paletteName) 
                : colorPalette.paletteName != null) {
            return false;
        }
        if (!Arrays.equals(this.r, colorPalette.r)) {
            return false;
        }
        if (!Arrays.equals(this.tickValues, colorPalette.tickValues)) {
            return false;
        }

        return true;
    }

    /**
     * Returns a hash code.
     * 
     * @return A hash code.
     */
    public int hashCode() {
        int result;
        long temp;
        temp = Double.doubleToLongBits(this.minZ);
        result = (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(this.maxZ);
        result = 29 * result + (int) (temp ^ (temp >>> 32));
        result = 29 * result + (this.logscale ? 1 : 0);
        result = 29 * result + (this.inverse ? 1 : 0);
        result = 29 * result 
                 + (this.paletteName != null ? this.paletteName.hashCode() : 0);
        result = 29 * result + (this.stepped ? 1 : 0);
        return result;
    }

    /**
     * Returns a clone of the palette.
     * 
     * @return A clone.
     * 
     * @throws CloneNotSupportedException never.
     */
    public Object clone() throws CloneNotSupportedException {
        
        ColorPalette clone = (ColorPalette) super.clone();
        return clone;
        
    }

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色爱综合网| 99精品久久久久久| 亚洲天堂福利av| 7777精品伊人久久久大香线蕉| 精品一区二区在线看| 亚洲精品国产a久久久久久| 99久久综合国产精品| 亚洲一区二区综合| 日本一区二区三区久久久久久久久不 | 精品在线免费观看| 亚洲高清中文字幕| 欧美韩国日本综合| 欧美一区二区成人| 欧美日韩亚洲综合| 91日韩在线专区| 国产精品一区专区| 蜜臀av一区二区在线观看 | 国产精品一区免费在线观看| 亚洲国产一二三| 亚洲综合一区二区精品导航| 综合色天天鬼久久鬼色| 亚洲精品一区二区三区精华液| 色国产精品一区在线观看| 亚洲一级片在线观看| 综合色天天鬼久久鬼色| 欧美激情一区二区三区| xfplay精品久久| 日韩视频永久免费| 51精品国自产在线| 91首页免费视频| 黑人巨大精品欧美一区| 日韩av中文在线观看| 五月天精品一区二区三区| 一区二区三区小说| 一区二区三区四区av| 亚洲精品日产精品乱码不卡| 国产精品灌醉下药二区| 亚洲视频 欧洲视频| 制服丝袜亚洲播放| 日本高清免费不卡视频| 欧美视频一区在线| 91精品国产一区二区三区香蕉| 制服丝袜日韩国产| 日韩一级在线观看| 91精品国产免费| 精品三级在线观看| 欧美日韩视频在线第一区| 777久久久精品| 精品国精品自拍自在线| 国产午夜精品久久久久久免费视 | 99vv1com这只有精品| 97se亚洲国产综合自在线不卡| 国产主播一区二区| 色美美综合视频| 91精品在线观看入口| 久久精品免视看| 亚洲国产cao| 丁香亚洲综合激情啪啪综合| 色素色在线综合| 久久精品夜色噜噜亚洲a∨| 国产精品久久久爽爽爽麻豆色哟哟 | 国产美女在线观看一区| 色成年激情久久综合| 精品少妇一区二区三区日产乱码 | 日韩福利电影在线观看| 成人蜜臀av电影| 奇米影视7777精品一区二区| 久久在线观看免费| 亚洲欧美综合在线精品| 国产中文字幕精品| 欧美高清一级片在线| 亚洲欧美综合在线精品| 国产成人自拍在线| 91精品婷婷国产综合久久竹菊| 国产精品青草久久| 激情综合色综合久久| 欧美一级片在线看| 一区二区三区加勒比av| 成人在线一区二区三区| 日韩一级黄色片| 日韩不卡一区二区| 欧美日韩一级黄| 亚洲国产视频在线| 欧美在线视频不卡| 亚洲精品五月天| 一本大道av伊人久久综合| 国产精品三级电影| 国产99久久久国产精品免费看| 精品日韩一区二区三区免费视频| 亚洲精品国产a| 日本精品一区二区三区四区的功能| 久久人人爽人人爽| 成人看片黄a免费看在线| 国产精品二三区| 日本韩国一区二区三区| 国产精品天美传媒| 99国产精品视频免费观看| 一区二区三区四区亚洲| 欧美日韩成人综合在线一区二区| 亚洲国产毛片aaaaa无费看| 欧美另类变人与禽xxxxx| 毛片不卡一区二区| 精品国产一区二区三区av性色| 国产一区二区三区免费播放| 亚洲欧美日韩久久| 日本电影亚洲天堂一区| 精品一区二区在线看| 亚洲精品日日夜夜| 捆绑调教一区二区三区| 91福利在线免费观看| 亚洲成av人片一区二区梦乃| 久久综合久色欧美综合狠狠| 北条麻妃国产九九精品视频| 日韩电影在线免费看| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产一区二区按摩在线观看| 亚洲主播在线播放| 亚洲国产精华液网站w| 91精品国产综合久久久蜜臀粉嫩 | 日韩精品一区二区三区在线| 国产乱码精品一区二区三区五月婷 | 成人h精品动漫一区二区三区| 日韩av一区二区三区| 亚洲女同一区二区| 国产精品美女视频| 日韩欧美国产综合| 欧美精品久久99| 91麻豆国产福利在线观看| 国产乱码精品一区二区三区忘忧草| 天堂成人免费av电影一区| 亚洲一区二区视频在线| 亚洲色欲色欲www| 久久亚洲精华国产精华液| 久久久亚洲综合| 国产精品午夜电影| 亚洲免费资源在线播放| 亚洲第一激情av| 免费观看久久久4p| 国产成人综合网| 色婷婷一区二区三区四区| 91 com成人网| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美日韩综合在线免费观看| 欧美肥妇free| 国产精品美女www爽爽爽| 亚洲国产精品一区二区www| 日本不卡视频在线观看| 从欧美一区二区三区| 欧美性色aⅴ视频一区日韩精品| 欧美一级免费大片| 中文字幕中文字幕一区二区 | 欧美一区二区日韩| 欧美激情艳妇裸体舞| 蜜臀99久久精品久久久久久软件| 成人黄色777网| 精品国产凹凸成av人导航| 亚洲精品日产精品乱码不卡| 九九国产精品视频| 欧洲精品一区二区| 国产欧美精品在线观看| 日本少妇一区二区| 在线免费精品视频| 亚洲欧洲日产国码二区| 国产中文字幕精品| 在线成人小视频| 亚洲国产精品一区二区久久| 东方欧美亚洲色图在线| 26uuu亚洲| 国产一区二区在线免费观看| 欧美日韩三级一区| 亚洲精品写真福利| 色乱码一区二区三区88| 国产精品福利电影一区二区三区四区 | 国产剧情一区二区三区| 日韩欧美色综合网站| 青青草精品视频| 91精品欧美福利在线观看| 午夜激情综合网| 制服丝袜激情欧洲亚洲| 日本sm残虐另类| 欧美mv日韩mv国产网站| 狠狠v欧美v日韩v亚洲ⅴ| 久久久久久久性| 成人午夜av电影| 中文字幕五月欧美| 成人高清伦理免费影院在线观看| 日韩午夜三级在线| 国产精品99久久久久| 中文字幕不卡在线观看| 91久久国产最好的精华液| 亚洲一区二区三区国产| 91精品国产综合久久福利| 天天免费综合色| 久久综合九色综合欧美98 | 一本大道久久a久久精二百| 一区二区三区国产精华| 亚洲精品在线免费播放| 99久久精品99国产精品| 日韩av午夜在线观看| 久久精品一区二区|