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

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

?? candlestickrenderer.java

?? Web圖形化的Java庫
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* ======================================
 * JFreeChart : a free Java chart library
 * ======================================
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 * Project Lead:  David Gilbert (david.gilbert@object-refinery.com);
 *
 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors.
 *
 * 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., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * ------------------------
 * CandlestickRenderer.java
 * ------------------------
 * (C) Copyright 2001-2003, by Object Refinery Limited.
 *
 * Original Authors:  David Gilbert (for Object Refinery Limited);
 *                    Sylvain Vieujot;
 * Contributor(s):    Richard Atkinson;
 *                    Christian W. Zuckschwerdt;
 *
 * $Id: CandlestickRenderer.java,v 1.18 2003/09/08 16:49:46 mungady Exp $
 *
 * Changes
 * -------
 * 13-Dec-2001 : Version 1.  Based on code in the CandlestickPlot class, written by Sylvain
 *               Vieujot, which now is redundant (DG);
 * 23-Jan-2002 : Added DrawInfo parameter to drawItem(...) method (DG);
 * 28-Mar-2002 : Added a property change listener mechanism so that renderers no longer need to be
 *               immutable.  Added properties for up and down colors (DG);
 * 04-Apr-2002 : Updated with new automatic width calculation and optional volume display,
 *               contributed by Sylvain Vieujot (DG);
 * 09-Apr-2002 : Removed translatedRangeZero from the drawItem(...) method, and changed the return
 *               type of the drawItem method to void, reflecting a change in the XYItemRenderer
 *               interface.  Added tooltip code to drawItem(...) method (DG);
 * 25-Jun-2002 : Removed redundant code (DG);
 * 05-Aug-2002 : Small modification to drawItem method to support URLs for HTML image maps (RA);
 * 19-Sep-2002 : Fixed errors reported by Checkstyle (DG);
 * 25-Mar-2003 : Implemented Serializable (DG);
 * 01-May-2003 : Modified drawItem(...) method signature (DG);
 * 30-Jun-2003 : Added support for PlotOrientation (for completeness, this renderer is unlikely
 *               to be used with a HORIZONTAL orientation) (DG);
 * 30-Jul-2003 : Modified entity constructor (CZ);
 * 20-Aug-2003 : Implemented Cloneable and PublicCloneable (DG);
 * 29-Aug-2003 : Moved maxVolume calculation to initialise method (see bug report 796619) (DG);
 * 02-Sep-2003 : Added maxCandleWidthInMilliseconds as workaround for bug 796621 (DG);
 * 08-Sep-2003 : Changed ValueAxis API (DG);
 * 
 */

package org.jfree.chart.renderer;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.CrosshairInfo;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.entity.EntityCollection;
import org.jfree.chart.entity.XYItemEntity;
import org.jfree.chart.labels.HighLowToolTipGenerator;
import org.jfree.chart.labels.XYToolTipGenerator;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.HighLowDataset;
import org.jfree.data.XYDataset;
import org.jfree.io.SerialUtilities;
import org.jfree.ui.RectangleEdge;
import org.jfree.util.PublicCloneable;

/**
 * A renderer that draws candlesticks on an {@link XYPlot} (requires a {@link HighLowDataset}).
 *
 * @author Sylvain Vieujot
 */
public class CandlestickRenderer extends AbstractXYItemRenderer implements XYItemRenderer, 
                                                                           Cloneable,
                                                                           PublicCloneable,
                                                                           Serializable {

    /** The candle width. */
    private double candleWidth;
    
    /** The maximum candlewidth in milliseconds. */
    private double maxCandleWidthInMilliseconds = 1000.0 * 60.0 * 60.0 * 20.0;
    
    /** Temporary storage for the maximum candle width. */
    private double maxCandleWidth;

    /** The paint used to fill the candle when the price moved up from open to close. */
    private transient Paint upPaint;

    /** The paint used to fill the candle when the price moved down from open to close. */
    private transient Paint downPaint;

    /** A flag controlling whether or not volume bars are drawn on the chart. */
    private boolean drawVolume;
    
    /** Temporary storage for the maximum volume. */
    private double maxVolume;

    /**
     * Creates a new renderer for candlestick charts.
     */
    public CandlestickRenderer() {
        this(-1.0);
    }

    /**
     * Creates a new renderer for candlestick charts.
     * <P>
     * Use -1 for the candle width if you prefer the width to be calculated automatically.
     *
     * @param candleWidth  The candle width.
     */
    public CandlestickRenderer(double candleWidth) {

        this(candleWidth, true, new HighLowToolTipGenerator());

    }

    /**
     * Creates a new renderer for candlestick charts.
     * <P>
     * Use -1 for the candle width if you prefer the width to be calculated automatically.
     *
     * @param candleWidth  The candle width.
     * @param drawVolume  A flag indicating whether or not volume bars should be drawn.
     * @param toolTipGenerator  The tool tip generator. <code>null</code> is none.
     */
    public CandlestickRenderer(double candleWidth, boolean drawVolume,
                               XYToolTipGenerator toolTipGenerator) {

        super();
        setToolTipGenerator(toolTipGenerator);
        this.candleWidth = candleWidth;
        this.drawVolume = drawVolume;
        this.upPaint = Color.green;
        this.downPaint = Color.red;

    }

    /**
     * Returns the width of each candle.
     *
     * @return The candle width.
     */
    public double getCandleWidth() {
        return this.candleWidth;
    }

    /**
     * Sets the candle width.
     * <P>
     * If you set the width to a negative value, the renderer will calculate
     * the candle width automatically based on the space available on the chart.
     *
     * @param width  The width.
     */
    public void setCandleWidth(double width) {

        if (width != this.candleWidth) {
            Double old = new Double(this.candleWidth);
            this.candleWidth = width;
            firePropertyChanged("CandleStickRenderer.candleWidth", old, new Double(width));
        }

    }

    /**
     * Returns the maximum width (in milliseconds) of each candle.
     *
     * @return The maximum candle width in milliseconds.
     */
    public double getMaxCandleWidthInMilliseconds() {
        return this.maxCandleWidthInMilliseconds;
    }

    /**
     * Sets the maximum candle width (in milliseconds).  
     *
     * @param millis  The maximum width.
     */
    public void setMaxCandleWidthInMilliseconds(double millis) {

        this.maxCandleWidthInMilliseconds = millis;
        firePropertyChanged("CandlestickRenderer.maxCandleWidthInMilliseconds", 
                            null, new Double(millis));

    }

    /**
     * Returns the paint used to fill candles when the price moves up from open
     * to close.
     *
     * @return The paint.
     */
    public Paint getUpPaint() {
        return this.upPaint;
    }

    /**
     * Sets the paint used to fill candles when the price moves up from open
     * to close.
     * <P>
     * Registered property change listeners are notified that the
     * "CandleStickRenderer.upPaint" property has changed.
     *
     * @param paint The paint.
     */
    public void setUpPaint(Paint paint) {

        Paint old = this.upPaint;
        this.upPaint = paint;
        firePropertyChanged("CandleStickRenderer.upPaint", old, paint);

    }

    /**
     * Returns the paint used to fill candles when the price moves down from
     * open to close.
     *
     * @return The paint.
     */
    public Paint getDownPaint() {
        return this.downPaint;
    }

    /**
     * Sets the paint used to fill candles when the price moves down from open
     * to close.
     * <P>
     * Registered property change listeners are notified that the
     * "CandleStickRenderer.downPaint" property has changed.
     *
     * @param paint  The paint.
     */
    public void setDownPaint(Paint paint) {

        Paint old = this.downPaint;
        this.downPaint = paint;
        firePropertyChanged("CandleStickRenderer.downPaint", old, paint);

    }

    /**
     * Returns a flag indicating whether or not volume bars are drawn on the
     * chart.
     *
     * @return <code>true</code> if volume bars are drawn on the chart.
     */
    public boolean drawVolume() {
        return this.drawVolume;
    }

    /**
     * Sets a flag that controls whether or not volume bars are drawn in the
     * background.
     *
     * @param flag The flag.
     */
    public void setDrawVolume(boolean flag) {

        if (this.drawVolume != flag) {
            this.drawVolume = flag;
            firePropertyChanged("CandlestickRenderer.drawVolume", null, new Boolean(flag));
        }

    }

    /**
     * Initialises the renderer then returns the number of 'passes' through the data that the
     * renderer will require (usually just one).  This method will be called before the first
     * item is rendered, giving the renderer an opportunity to initialise any
     * state information it wants to maintain.  The renderer can do nothing if it chooses.
     *
     * @param g2  the graphics device.
     * @param dataArea  the area inside the axes.
     * @param plot  the plot.
     * @param dataset  the data.
     * @param info  an optional info collection object to return data back to the caller.
     *
     * @return The number of passes the renderer requires.
     */
    public int initialise(Graphics2D g2,
                          Rectangle2D dataArea,
                          XYPlot plot,
                          XYDataset dataset,
                          ChartRenderingInfo info) {
          
        // calculate the maximum allowed candle width from the axis...
        ValueAxis axis = plot.getDomainAxis();
        double x1 = axis.getLowerBound();
        double x2 = x1 + this.maxCandleWidthInMilliseconds;
        RectangleEdge edge = plot.getDomainAxisEdge();
        double xx1 = axis.translateValueToJava2D(x1, dataArea, edge);
        double xx2 = axis.translateValueToJava2D(x2, dataArea, edge);
        this.maxCandleWidth = (xx2 - xx1);
        
        // calculate the highest volume in the dataset... 
        if (this.drawVolume) {
            HighLowDataset highLowDataset = (HighLowDataset) dataset;
            this.maxVolume = 0.0;
            for (int series = 0; series < highLowDataset.getSeriesCount(); series++) {
                for (int item = 0; item < highLowDataset.getItemCount(series); item++) {
                    double volume = highLowDataset.getVolumeValue(series, item).doubleValue();
                    if (volume > this.maxVolume) {
                        this.maxVolume = volume;
                    }
                    
                }    
            }
        }
        
        return 1;
                              
    }

    /**
     * Draws the visual representation of a single data item.
     *
     * @param g2  the graphics device.
     * @param dataArea  the area within which the plot is being drawn.
     * @param info  collects info about the drawing.
     * @param plot  the plot (can be used to obtain standard color information etc).
     * @param domainAxis  the domain axis.
     * @param rangeAxis  the range axis.
     * @param dataset  the dataset.
     * @param series  the series index (zero-based).
     * @param item  the item index (zero-based).
     * @param crosshairInfo  information about crosshairs on a plot.
     * @param pass  the pass index.
     */
    public void drawItem(Graphics2D g2, Rectangle2D dataArea,
                         ChartRenderingInfo info,
                         XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis,
                         XYDataset dataset, int series, int item,
                         CrosshairInfo crosshairInfo,
                         int pass) {
                             
        PlotOrientation orientation = plot.getOrientation();
        if (orientation == PlotOrientation.HORIZONTAL) {
            drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                               dataset, series, item, 
                               crosshairInfo, pass);
        }
        else if (orientation == PlotOrientation.VERTICAL) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91老师片黄在线观看| 91性感美女视频| 性做久久久久久免费观看| 亚洲黄色av一区| 一区二区三区91| 午夜影视日本亚洲欧洲精品| 亚洲综合成人在线| 天天综合天天综合色| 偷拍日韩校园综合在线| 日本强好片久久久久久aaa| 日韩二区在线观看| 捆绑紧缚一区二区三区视频| 老司机免费视频一区二区三区| 美女mm1313爽爽久久久蜜臀| 国产乱码精品一区二区三| 国产福利精品导航| 91精彩视频在线| 日韩三级中文字幕| 国产精品嫩草久久久久| 亚洲欧美精品午睡沙发| 亚洲成人资源网| 久久精品国产亚洲a| 成人中文字幕电影| 欧美在线观看禁18| 欧美va日韩va| 亚洲欧美日韩中文播放| 日韩专区欧美专区| 国产一区二区导航在线播放| 91在线精品一区二区三区| 在线电影一区二区三区| 日本一区二区三区四区在线视频 | 国产精品久久久久久久久免费桃花 | 成人av综合在线| 色婷婷av一区| 欧美刺激午夜性久久久久久久| 久久久综合网站| 亚洲国产另类av| 国产精品18久久久| 91精品久久久久久久91蜜桃| 国产精品福利在线播放| 奇米色一区二区三区四区| 不卡一卡二卡三乱码免费网站| 777亚洲妇女| 亚洲综合无码一区二区| 国产成人亚洲精品青草天美| 91麻豆精品国产无毒不卡在线观看| 国产精品久久久久久户外露出 | 中文字幕一区二| 美腿丝袜亚洲色图| 在线看国产一区| 国产亚洲欧美中文| 麻豆国产精品视频| 欧美男男青年gay1069videost| 国产精品青草久久| 国产精品一区二区你懂的| 欧美日韩精品欧美日韩精品一| 欧美国产丝袜视频| 国产精品正在播放| 日韩三级精品电影久久久| 亚洲国产视频a| 91国内精品野花午夜精品| 国产精品免费丝袜| 国产综合久久久久久久久久久久| 欧美日韩国产片| 亚洲综合在线第一页| 色琪琪一区二区三区亚洲区| 国产精品美女久久久久久| 国产精品538一区二区在线| 精品三级在线观看| 日本v片在线高清不卡在线观看| 91搞黄在线观看| 亚洲影院在线观看| 欧美系列一区二区| 午夜不卡av免费| 91精品国产手机| 美洲天堂一区二卡三卡四卡视频| 在线观看91av| 美女视频网站黄色亚洲| 日韩一区二区在线看| 老司机精品视频一区二区三区| 欧美成人三级在线| 久久av中文字幕片| 国产日韩欧美高清| 成人av一区二区三区| 日韩毛片精品高清免费| 色婷婷久久久综合中文字幕 | 国产精品麻豆欧美日韩ww| 国产成人综合亚洲91猫咪| 国产精品欧美精品| 日本电影欧美片| 视频在线在亚洲| 精品久久人人做人人爰| 国产成人在线视频免费播放| 亚洲欧洲精品一区二区精品久久久 | 国产成人精品免费| 亚洲欧美成aⅴ人在线观看| 欧美三级电影在线看| 蜜臀av一区二区在线观看| 久久日一线二线三线suv| 成人午夜电影网站| 亚洲一区二区偷拍精品| 日韩一区二区精品葵司在线| 国产一区二区三区香蕉| 1000部国产精品成人观看| 欧美色男人天堂| 狠狠色综合播放一区二区| 亚洲人成网站影音先锋播放| 欧美一区二区三区四区高清| 国产成人免费视频精品含羞草妖精| 亚洲欧美电影院| 精品国产乱码久久久久久久久| 成人国产精品免费观看动漫| 亚洲r级在线视频| 国产亚洲婷婷免费| 91麻豆精品国产91久久久使用方法 | 国产综合色产在线精品| 亚洲精品乱码久久久久久黑人| 欧美成人video| 91麻豆国产精品久久| 国产麻豆精品视频| 日韩1区2区3区| 亚洲日本在线天堂| 国产亚洲一本大道中文在线| 91精品在线观看入口| 91麻豆福利精品推荐| 国产精品亚洲第一| 九色porny丨国产精品| 亚洲va在线va天堂| 亚洲欧美日韩综合aⅴ视频| 国产午夜亚洲精品不卡| 日韩欧美高清dvd碟片| 欧美日韩国产a| 欧美优质美女网站| 99综合影院在线| 国产成人啪免费观看软件| 国产尤物一区二区| 免费在线观看不卡| 日本成人在线网站| 视频一区二区三区在线| 亚洲国产成人av| 亚洲自拍偷拍网站| 亚洲资源中文字幕| 亚洲精品乱码久久久久久久久| 国产精品福利电影一区二区三区四区| 26uuu另类欧美| 日韩免费电影一区| 精品成人私密视频| 久久久国产精品午夜一区ai换脸| 欧美zozozo| 久久久一区二区三区捆绑**| 精品国产亚洲在线| 久久久久久免费毛片精品| 久久久久久一二三区| 国产日韩av一区| 欧美激情综合网| 亚洲日本韩国一区| 亚洲成人黄色小说| 五月天亚洲精品| 蜜臀av一区二区三区| 韩国女主播一区| 韩国女主播成人在线观看| 国产99久久久国产精品潘金网站| 国产精品一区二区在线观看不卡| 懂色av中文一区二区三区| 成人免费的视频| 一本高清dvd不卡在线观看| 欧美亚洲国产bt| 日韩丝袜情趣美女图片| 久久亚洲综合av| 国产精品久久久久久久久免费樱桃| 成人欧美一区二区三区1314| 亚洲免费色视频| 免费在线观看不卡| 波波电影院一区二区三区| 在线一区二区三区四区五区| 91麻豆精品国产综合久久久久久 | 中文字幕+乱码+中文字幕一区| 中文字幕一区二区三区在线观看| 亚洲精品成人悠悠色影视| 日本一道高清亚洲日美韩| 国产精品1区2区| 欧美无砖专区一中文字| 久久综合中文字幕| 亚洲精品美腿丝袜| 日本va欧美va精品| www.激情成人| 精品日韩成人av| 亚洲乱码中文字幕| 国产专区综合网| 欧美日韩一区二区电影| 国产午夜久久久久| 天堂一区二区在线| 成人av免费网站| 日韩欧美第一区| 亚洲综合丝袜美腿| 国产一区二区伦理片| 欧美日韩国产一区| 国产精品久久久久一区| 日韩av一区二区在线影视| 波多野洁衣一区|