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

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

?? xypointerannotation.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.]
 *
 * ------------------------
 * XYPointerAnnotation.java
 * ------------------------
 * (C) Copyright 2003-2005, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: XYPointerAnnotation.java,v 1.4.2.1 2005/10/25 16:51:15 mungady Exp $
 *
 * Changes:
 * --------
 * 21-May-2003 : Version 1 (DG);
 * 10-Jun-2003 : Changed BoundsAnchor to TextAnchor (DG);
 * 02-Jul-2003 : Added accessor methods and simplified constructor (DG);
 * 19-Aug-2003 : Implemented Cloneable (DG);
 * 13-Oct-2003 : Fixed bug where arrow paint is not set correctly (DG);
 * 21-Jan-2004 : Update for renamed method in ValueAxis (DG);
 * 29-Sep-2004 : Changes to draw() method signature (DG);
 *
 */

package org.jfree.chart.annotations;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Stroke;
import java.awt.geom.GeneralPath;
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.axis.ValueAxis;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.PlotRenderingInfo;
import org.jfree.chart.plot.XYPlot;
import org.jfree.io.SerialUtilities;
import org.jfree.text.TextUtilities;
import org.jfree.ui.RectangleEdge;
import org.jfree.util.PublicCloneable;

/**
 * An arrow and label that can be placed on an 
 * {@link org.jfree.chart.plot.XYPlot}.  The arrow is drawn at a user-definable 
 * angle so that it points towards the (x, y) location for the annotation.  
 * <p>
 * The arrow length (and its offset from the (x, y) location) is controlled by 
 * the tip radius and the base radius attributes.  Imagine two circles around 
 * the (x, y) coordinate: the inner circle defined by the tip radius, and the 
 * outer circle defined by the base radius.  Now, draw the arrow starting at 
 * some point on the outer circle (the point is determined by the angle), with 
 * the arrow tip being drawn at a corresponding point on the inner circle.
 * <p>
 * See the <code>MarkerDemo1.java</code> source file in the JFreeChart 
 * distribution for an example.
 *
 */

public class XYPointerAnnotation extends XYTextAnnotation 
                                 implements Cloneable, PublicCloneable, 
                                            Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -4031161445009858551L;
    
    /** The default tip radius (in Java2D units). */
    public static final double DEFAULT_TIP_RADIUS = 10.0;
    
    /** The default base radius (in Java2D units). */
    public static final double DEFAULT_BASE_RADIUS = 30.0;
    
    /** The default label offset (in Java2D units). */
    public static final double DEFAULT_LABEL_OFFSET = 3.0;
    
    /** The default arrow length (in Java2D units). */
    public static final double DEFAULT_ARROW_LENGTH = 5.0;

    /** The default arrow width (in Java2D units). */
    public static final double DEFAULT_ARROW_WIDTH = 3.0;
    
    /** The angle of the arrow's line (in radians). */
    private double angle;

    /** 
     * The radius from the (x, y) point to the tip of the arrow (in Java2D 
     * units). 
     */
    private double tipRadius;

    /** 
     * The radius from the (x, y) point to the start of the arrow line (in 
     * Java2D units). 
     */
    private double baseRadius;

    /** The length of the arrow head (in Java2D units). */
    private double arrowLength;

    /** The arrow width (in Java2D units, per side). */
    private double arrowWidth;
    
    /** The arrow stroke. */
    private transient Stroke arrowStroke;

    /** The arrow paint. */
    private transient Paint arrowPaint;
    
    /** The radius from the base point to the anchor point for the label. */
    private double labelOffset;

    /**
     * Creates a new label and arrow annotation.
     *
     * @param label  the label (<code>null</code> permitted).
     * @param x  the x-coordinate (measured against the chart's domain axis).
     * @param y  the y-coordinate (measured against the chart's range axis).
     * @param angle  the angle of the arrow's line (in radians).
     */
    public XYPointerAnnotation(String label, double x, double y, double angle) {

        super(label, x, y);
        this.angle = angle;
        this.tipRadius = DEFAULT_TIP_RADIUS;
        this.baseRadius = DEFAULT_BASE_RADIUS;
        this.arrowLength = DEFAULT_ARROW_LENGTH;
        this.arrowWidth = DEFAULT_ARROW_WIDTH;
        this.labelOffset = DEFAULT_LABEL_OFFSET;
        this.arrowStroke = new BasicStroke(1.0f);
        this.arrowPaint = Color.black;

    }
    
    /**
     * Returns the angle of the arrow.
     * 
     * @return The angle (in radians).
     */
    public double getAngle() {
        return this.angle;
    }
    
    /**
     * Sets the angle of the arrow.
     * 
     * @param angle  the angle (in radians).
     */
    public void setAngle(double angle) {
        this.angle = angle;
    }
    
    /**
     * Returns the tip radius.
     * 
     * @return The tip radius (in Java2D units).
     */
    public double getTipRadius() {
        return this.tipRadius;
    }
    
    /**
     * Sets the tip radius.
     * 
     * @param radius  the radius (in Java2D units).
     */
    public void setTipRadius(double radius) {
        this.tipRadius = radius;
    }
    
    /**
     * Sets the base radius.
     * 
     * @return The base radius (in Java2D units).
     */
    public double getBaseRadius() {
        return this.baseRadius;
    }
    
    /**
     * Sets the base radius.
     * 
     * @param radius  the radius (in Java2D units).
     */
    public void setBaseRadius(double radius) {
        this.baseRadius = radius;
    }

    /**
     * Sets the label offset.
     * 
     * @return The label offset (in Java2D units).
     */
    public double getLabelOffset() {
        return this.labelOffset;
    }
    
    /**
     * Sets the label offset (from the arrow base, continuing in a straight 
     * line, in Java2D units).
     * 
     * @param offset  the offset (in Java2D units).
     */
    public void setLabelOffset(double offset) {
        this.labelOffset = offset;
    }
    
    /**
     * Returns the arrow length.
     * 
     * @return The arrow length.
     */
    public double getArrowLength() {
        return this.arrowLength;
    }
    
    /**
     * Sets the arrow length.
     * 
     * @param length  the length.
     */
    public void setArrowLength(double length) {
        this.arrowLength = length;
    }

    /**
     * Returns the arrow width.
     * 
     * @return The arrow width (in Java2D units).
     */
    public double getArrowWidth() {
        return this.arrowWidth;
    }
    
    /**
     * Sets the arrow width.
     * 
     * @param width  the width (in Java2D units).
     */
    public void setArrowWidth(double width) {
        this.arrowWidth = width;
    }
    
    /** 
     * Returns the stroke used to draw the arrow line.
     * 
     * @return The arrow stroke (never <code>null</code>).
     */
    public Stroke getArrowStroke() {
        return this.arrowStroke;
    }

    /** 
     * Sets the stroke used to draw the arrow line.
     * 
     * @param stroke  the stroke (<code>null</code> not permitted).
     */
    public void setArrowStroke(Stroke stroke) {
        if (stroke == null) {
            throw new IllegalArgumentException("Null 'stroke' not permitted.");
        }
        this.arrowStroke = stroke;
    }
    
    /**
     * Sets the paint used for the arrow.
     * 
     * @return The arrow paint (never <code>null</code>).
     */
    public Paint getArrowPaint() {
        return this.arrowPaint;
    }
    
    /**
     * Sets the paint used for the arrow.
     * 
     * @param paint  the arrow paint (<code>null</code> not permitted).
     */
    public void setArrowPaint(Paint paint) {
        this.arrowPaint = paint;
    }
    
    /**
     * Draws the annotation.
     *
     * @param g2  the graphics device.
     * @param plot  the plot.
     * @param dataArea  the data area.
     * @param domainAxis  the domain axis.
     * @param rangeAxis  the range axis.
     * @param rendererIndex  the renderer index.
     * @param info  the plot rendering info.
     */
    public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                     ValueAxis domainAxis, ValueAxis rangeAxis, 
                     int rendererIndex,
                     PlotRenderingInfo info) {

        PlotOrientation orientation = plot.getOrientation();
        RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
            plot.getDomainAxisLocation(), orientation
        );
        RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
            plot.getRangeAxisLocation(), orientation
        );
        double j2DX = domainAxis.valueToJava2D(getX(), dataArea, domainEdge);
        double j2DY = rangeAxis.valueToJava2D(getY(), dataArea, rangeEdge);

        double startX = j2DX + Math.cos(this.angle) * this.baseRadius;
        double startY = j2DY + Math.sin(this.angle) * this.baseRadius;

        double endX = j2DX + Math.cos(this.angle) * this.tipRadius;
        double endY = j2DY + Math.sin(this.angle) * this.tipRadius;

        double arrowBaseX = endX + Math.cos(this.angle) * this.arrowLength;
        double arrowBaseY = endY + Math.sin(this.angle) * this.arrowLength;

        double arrowLeftX = arrowBaseX 
            + Math.cos(this.angle + Math.PI / 2.0) * this.arrowWidth;
        double arrowLeftY = arrowBaseY 
            + Math.sin(this.angle + Math.PI / 2.0) * this.arrowWidth;

        double arrowRightX = arrowBaseX 
            - Math.cos(this.angle + Math.PI / 2.0) * this.arrowWidth;
        double arrowRightY = arrowBaseY 
            - Math.sin(this.angle + Math.PI / 2.0) * this.arrowWidth;

        GeneralPath arrow = new GeneralPath();
        arrow.moveTo((float) endX, (float) endY);
        arrow.lineTo((float) arrowLeftX, (float) arrowLeftY);
        arrow.lineTo((float) arrowRightX, (float) arrowRightY);
        arrow.closePath();

        g2.setStroke(this.arrowStroke);
        g2.setPaint(this.arrowPaint);
        Line2D line = new Line2D.Double(startX, startY, endX, endY);
        g2.draw(line);
        g2.fill(arrow);

        // draw the label
        g2.setFont(getFont());
        g2.setPaint(getPaint());
        double labelX = j2DX 
            + Math.cos(this.angle) * (this.baseRadius + this.labelOffset);
        double labelY = j2DY 
            + Math.sin(this.angle) * (this.baseRadius + this.labelOffset);
        Rectangle2D hotspot = TextUtilities.drawAlignedString(
            getText(), 
            g2, 
            (float) labelX, 
            (float) labelY,
            getTextAnchor()
        );

        String toolTip = getToolTipText();
        String url = getURL();
        if (toolTip != null || url != null) {
            addEntity(info, hotspot, rendererIndex, toolTip, url);
        }
        
    }
    
    /**
     * Tests this annotation for equality with an object.
     * 
     * @param object  the object to test against.
     * 
     * @return <code>true</code> or <code>false</code>.
     */
    public boolean equals(Object object) {
        
        if (object == null) {
            return false;
        }
        
        if (object == this) {
            return true;
        }
        
        if (object instanceof XYPointerAnnotation) {
        
            XYPointerAnnotation a = (XYPointerAnnotation) object;
            boolean b0 = (this.angle == a.angle);
            boolean b1 = (this.tipRadius == a.tipRadius);
            boolean b2 = (this.baseRadius == a.baseRadius);
            boolean b3 = (this.arrowLength == a.arrowLength);
            boolean b4 = (this.arrowWidth == a.arrowWidth);
            boolean b5 = (this.arrowPaint.equals(a.arrowPaint));
            boolean b6 = (this.arrowStroke.equals(a.arrowStroke));
            boolean b7 = (this.labelOffset == a.labelOffset);
            return b0 && b1 && b2 && b3 && b4 && b5 && b6 && b7;
        }
       
        return false;
        
    }
    
    /**
     * Returns a clone of the annotation.
     * 
     * @return A clone.
     * 
     * @throws CloneNotSupportedException  if the annotation can't be cloned.
     */
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    /**
     * Provides serialization support.
     *
     * @param stream  the output stream.
     *
     * @throws IOException if there is an I/O error.
     */
    private void writeObject(ObjectOutputStream stream) throws IOException {
        stream.defaultWriteObject();
        SerialUtilities.writePaint(this.arrowPaint, stream);
        SerialUtilities.writeStroke(this.arrowStroke, stream);
    }

    /**
     * Provides serialization support.
     *
     * @param stream  the input stream.
     *
     * @throws IOException  if there is an I/O error.
     * @throws ClassNotFoundException  if there is a classpath problem.
     */
    private void readObject(ObjectInputStream stream) 
        throws IOException, ClassNotFoundException {
        stream.defaultReadObject();
        this.arrowPaint = SerialUtilities.readPaint(stream);
        this.arrowStroke = SerialUtilities.readStroke(stream);
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
8v天堂国产在线一区二区| 精品久久一区二区| 精品一区二区久久久| 中文字幕一区二区三区在线观看| 欧美精品日日鲁夜夜添| 色屁屁一区二区| av中文字幕在线不卡| 国产精品综合网| 免费在线观看视频一区| 日韩精品亚洲专区| 亚洲成在线观看| 午夜免费久久看| 韩国成人在线视频| 成人动漫视频在线| 色综合天天性综合| 一本久久a久久免费精品不卡| 26uuu欧美日本| 久久久久久久久久久久久女国产乱| 精品久久久久久久久久久久久久久 | 成人av高清在线| 精品少妇一区二区三区在线播放 | 成人一级片在线观看| 国产精品亚洲午夜一区二区三区 | 欧美精品一区二区三| 中文字幕欧美区| 国产精品久久久久久久久动漫| 亚洲欧美成人一区二区三区| 一个色在线综合| 日本一区中文字幕| 丁香亚洲综合激情啪啪综合| 在线视频亚洲一区| 91麻豆精品久久久久蜜臀| 一区二区三区欧美| 在线免费不卡电影| 亚洲欧美一区二区三区极速播放| jlzzjlzz国产精品久久| 一区二区三区在线视频免费观看| 欧美怡红院视频| 国产精品免费人成网站| 日日噜噜夜夜狠狠视频欧美人 | 欧美日韩免费一区二区三区视频| 欧美一卡2卡三卡4卡5免费| 久久久久亚洲综合| 粉嫩aⅴ一区二区三区四区五区| 久久久久久夜精品精品免费| 国产精品综合一区二区| 国产精品超碰97尤物18| 在线区一区二视频| 视频一区二区中文字幕| 精品国产一区二区三区四区四 | 色综合天天做天天爱| 亚洲一区精品在线| 国产凹凸在线观看一区二区| 中文一区二区在线观看| 色欧美日韩亚洲| 日韩电影免费一区| 欧美激情在线观看视频免费| 色婷婷av一区二区三区软件| 免费成人你懂的| 欧美韩日一区二区三区| 欧美日韩在线不卡| 国产馆精品极品| 日韩精品中文字幕一区| 亚洲成a人v欧美综合天堂下载 | 欧美美女一区二区| 日本不卡一区二区三区| 久久精品无码一区二区三区| 青草国产精品久久久久久| 精品国产免费人成电影在线观看四季| 国产精品白丝jk黑袜喷水| 亚洲专区一二三| 久久日韩精品一区二区五区| 一本大道久久a久久精二百| 老汉av免费一区二区三区| 欧美日韩黄色影视| 亚洲线精品一区二区三区| 91麻豆文化传媒在线观看| 中文字幕一区二区不卡| 欧美人狂配大交3d怪物一区| 国产白丝精品91爽爽久久| 三级不卡在线观看| 亚洲免费资源在线播放| 久久久噜噜噜久久中文字幕色伊伊| 9色porny自拍视频一区二区| 黑人巨大精品欧美黑白配亚洲| 亚洲激情自拍视频| 欧美日韩国产天堂| 成人在线视频一区二区| 久久国产综合精品| 亚洲国产精品自拍| 中文字幕一区二区不卡| 欧美日韩大陆在线| 99久久伊人精品| 一区二区三区国产| 欧美高清在线视频| 精品毛片乱码1区2区3区| 欧美视频在线一区| av午夜一区麻豆| 国产乱人伦精品一区二区在线观看 | 在线播放91灌醉迷j高跟美女 | 在线中文字幕一区| 亚洲www啪成人一区二区麻豆| 国产精品网站在线观看| 精品女同一区二区| 日韩欧美国产系列| 欧美日韩dvd在线观看| 欧美性做爰猛烈叫床潮| 91蜜桃婷婷狠狠久久综合9色| 国产成人精品免费看| 国产美女主播视频一区| 亚洲人123区| 亚洲日本韩国一区| 91麻豆精品国产91久久久久久久久| 一本色道综合亚洲| 99精品视频一区二区| 99精品视频在线观看| 91丨九色丨黑人外教| 色综合天天性综合| 欧洲精品一区二区| 欧美三级资源在线| 欧美肥妇bbw| 日韩小视频在线观看专区| 成人成人成人在线视频| 成人性视频网站| av电影在线观看不卡| 在线观看一区不卡| 欧美日韩小视频| 91精品国产综合久久久久久 | 久久精品国产一区二区三| 视频一区二区三区入口| 久久狠狠亚洲综合| 成人午夜大片免费观看| 99久久精品国产毛片| 欧洲精品视频在线观看| 欧美电影免费观看完整版| 精品国产1区二区| 国产精品嫩草久久久久| 亚洲成在人线免费| 久久99国内精品| 成人高清在线视频| 欧美色成人综合| 久久久一区二区三区| 国产精品不卡一区| 视频一区在线视频| 懂色av中文字幕一区二区三区| 91免费精品国自产拍在线不卡| 51精品视频一区二区三区| 久久夜色精品一区| 一区二区三区四区激情| 久久国产精品99久久人人澡| 风间由美性色一区二区三区| 在线精品观看国产| 久久久午夜电影| 亚洲一区二区av在线| 国产一区二区三区免费在线观看| 99精品欧美一区二区三区小说| 7777精品伊人久久久大香线蕉经典版下载| 日韩免费视频一区| 亚洲男人的天堂一区二区| 丝袜诱惑制服诱惑色一区在线观看| 国产麻豆精品95视频| 欧美日韩1234| 亚洲免费观看高清完整| 精品一区二区精品| 欧美在线不卡视频| 欧美韩日一区二区三区四区| 日本美女视频一区二区| 91影院在线免费观看| 欧美一区二区三区在线视频| 亚洲桃色在线一区| 国产综合久久久久久鬼色| 在线观看免费视频综合| 国产亚洲欧美一区在线观看| 爽好久久久欧美精品| 91亚洲精华国产精华精华液| 久久久精品免费网站| 轻轻草成人在线| 欧美在线免费观看视频| 国产精品你懂的| 国产在线播放一区二区三区| 日韩一级视频免费观看在线| 一区二区在线观看不卡| 成人动漫一区二区三区| 国产亚洲1区2区3区| 极品少妇xxxx偷拍精品少妇| 欧美久久一二区| 亚洲午夜激情网站| 本田岬高潮一区二区三区| 久久夜色精品国产欧美乱极品| 日韩黄色免费电影| 6080日韩午夜伦伦午夜伦| 一区二区三区成人| 91老师国产黑色丝袜在线| 久久久欧美精品sm网站| 国模套图日韩精品一区二区 | 国产成人综合在线播放| 日韩精品专区在线| 麻豆一区二区99久久久久| 不卡av免费在线观看| 国产精品无遮挡|