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

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

?? colorpalette.java

?? jfreechart1.0.1 jsp繪制圖表的開發(fā)包
?? 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.]
 *
 * -----------------
 * 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;
        
    }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久se精品一区二区| 成人美女视频在线观看| 久久久久国产精品麻豆ai换脸| 成人app在线| 久久国产精品露脸对白| 亚洲一区二区不卡免费| 欧美国产精品中文字幕| 日韩亚洲欧美在线观看| 在线视频欧美精品| 成人aa视频在线观看| 九九热在线视频观看这里只有精品| 亚洲女与黑人做爰| 国产精品久久综合| 精品国产网站在线观看| 欧美精品精品一区| 91浏览器在线视频| 成人午夜激情片| 韩国精品主播一区二区在线观看 | 亚洲免费看黄网站| 国产欧美日韩麻豆91| 精品国产一二三区| 69av一区二区三区| 欧美日韩不卡一区二区| 在线区一区二视频| 91黄色在线观看| 色婷婷激情一区二区三区| 成人丝袜18视频在线观看| 国产精品 日产精品 欧美精品| 美女国产一区二区三区| 日韩高清在线一区| 日韩精彩视频在线观看| 亚洲成av人片在线观看| 亚洲国产你懂的| 亚洲激情综合网| 亚洲欧美偷拍三级| 亚洲精品福利视频网站| 亚洲麻豆国产自偷在线| 日韩毛片视频在线看| 最新国产成人在线观看| 国产精品乱人伦一区二区| 欧美经典一区二区三区| 中文字幕不卡三区| 中文字幕精品综合| 国产精品色在线| 国产精品久久久久精k8| 亚洲人123区| 亚洲国产精品一区二区久久| 亚洲综合激情另类小说区| 亚洲成人资源在线| 久久aⅴ国产欧美74aaa| 国产一区二区电影| 成人永久免费视频| 99久久精品久久久久久清纯| 99久久免费视频.com| 色综合久久综合网欧美综合网| 91亚洲精华国产精华精华液| 色拍拍在线精品视频8848| 欧美午夜精品久久久久久超碰 | 日韩**一区毛片| 久久99久国产精品黄毛片色诱| 激情综合色综合久久| 国产1区2区3区精品美女| 99在线视频精品| 91福利区一区二区三区| 欧美二区三区91| 久久亚洲春色中文字幕久久久| 国产精品理论片| 亚洲综合一区二区| 看片的网站亚洲| 成人午夜电影网站| 欧美日韩在线综合| 久久综合久久综合久久综合| 亚洲欧美成aⅴ人在线观看| 日韩精品一二三| 国产一区视频网站| 一本到三区不卡视频| 亚洲精品一区二区三区影院 | 蜜桃视频第一区免费观看| 精品亚洲porn| 91片在线免费观看| 日韩三级电影网址| 亚洲欧洲精品一区二区三区不卡| 亚洲国产精品久久人人爱| 久国产精品韩国三级视频| 91网上在线视频| 欧美mv和日韩mv国产网站| 亚洲欧美日韩国产综合| 免费高清成人在线| 一本一道综合狠狠老| 精品国产乱码久久久久久免费 | 亚洲午夜激情网页| 国产成a人亚洲| 91精品国产一区二区人妖| 国产精品久久久久aaaa| 日本中文字幕不卡| 99久久精品免费看国产免费软件| 日韩欧美国产精品| 亚洲一区二区综合| 成人永久免费视频| 精品国产乱码久久| 午夜视频一区二区三区| 99久久综合色| 久久久精品国产免大香伊| 日本va欧美va瓶| 亚洲你懂的在线视频| 喷水一区二区三区| 欧美午夜精品理论片a级按摩| 日本一区免费视频| 麻豆极品一区二区三区| 欧美在线你懂的| 国产精品久久久久久久久动漫| 久久国产乱子精品免费女| 91精品免费在线| 夜夜亚洲天天久久| 成人av资源在线观看| 中文字幕精品在线不卡| 国产一区二区在线电影| 51久久夜色精品国产麻豆| 亚洲韩国一区二区三区| 色综合久久中文字幕| 国产精品久久久久影院老司| 韩国一区二区在线观看| 欧美成人乱码一区二区三区| 免费看日韩a级影片| 欧美日本国产一区| 亚洲v中文字幕| 91高清在线观看| 亚洲图片欧美视频| 欧美日韩在线一区二区| 亚洲成人久久影院| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 欧美三区免费完整视频在线观看| **性色生活片久久毛片| 成人app网站| 99免费精品在线观看| 国产精品福利一区二区| 成人国产精品免费观看动漫| 日本一区二区在线不卡| 成人午夜精品在线| 中文字幕在线观看一区| 97久久人人超碰| 亚洲欧美日韩中文播放 | 99国产精品国产精品久久| 国产精品伦理在线| 91片在线免费观看| 亚洲电影中文字幕在线观看| 欧美三级电影在线观看| 欧美aaaaaa午夜精品| 欧美成人video| 粗大黑人巨茎大战欧美成人| 日韩伦理电影网| 欧美主播一区二区三区| 日韩成人一级大片| 久久久亚洲精华液精华液精华液| 成人免费av网站| 一区二区三区四区国产精品| 欧美亚洲高清一区| 午夜视黄欧洲亚洲| 2020国产精品久久精品美国| 成人午夜精品在线| 亚洲一二三四区| 精品国产髙清在线看国产毛片| 国产米奇在线777精品观看| 亚洲欧美综合网| 5566中文字幕一区二区电影| 国产原创一区二区| 亚洲欧洲制服丝袜| 91精品国产综合久久久久久久久久| 国产一区二区主播在线| 亚洲欧美电影院| 日韩欧美国产综合| 91在线精品秘密一区二区| 丝袜美腿亚洲综合| 国产喷白浆一区二区三区| 91国产免费看| 国产精品一区二区视频| 一区二区三区在线视频免费观看 | 欧美一级片在线看| 国产福利精品一区| 亚洲bt欧美bt精品| 日本一区二区三区dvd视频在线| 欧美日韩国产综合视频在线观看| 2024国产精品视频| 99精品视频在线免费观看| 男男gaygay亚洲| 亚洲免费观看在线视频| 久久女同精品一区二区| 在线一区二区视频| 国产精品综合在线视频| 亚洲成人自拍网| 国产精品久久久久久久第一福利 | 欧美激情一区在线观看| 欧美精品久久天天躁| 成人性生交大片免费看视频在线| 性做久久久久久久久| 国产精品久久久久久久久晋中| 欧美成人三级在线| 精品视频123区在线观看| 99久久夜色精品国产网站| 激情小说欧美图片|