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

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

?? arrow2d.java

?? 基于jxta的P2P框架的系統
?? JAVA
字號:
/**
 * Copyright (C) 2004 C. Schalkwijk, Response B.V.
 *
 * info@response.nl
 * Response B.V
 * Jagersbosstraat 26
 * 5241 JT Rosmalen
 * THE NETHERLANDS
 *
 * 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
 *
 * Response B.V., hereby disclaims all copyright interest in the library 'DeSL'
 * (a developer support library) written by Coen Schalkwijk.
 *
 * H. Houet, Director of Response B.V.
 * 27th April 2004
 * (hard copy of the disclaimer in possession of C. Schalkwijk)
 *
 */


package desl.graphic.geom;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Line2D;

import java.io.Serializable;

/**
 * Line ending with an arrow.</P>
 *
 * <b>TODO</b> Add arrow to both sides, includes dynamic iterator (point count differs if arrow has two heads).<BR>
 * <b>TODO</b> Add settings for arrow stile<BR>
 * <b>TODO</b> Add double/float precision implementations.<BR>
 * <BR>
 * <b>Change history</b><br>
 * [ 2004-09-27 ] C. Schalkwijk	- Initial setup.<BR>
 * [ 2004-09-28 ] C. Schalkwijk	- Shape is a full polygon, removed final identifier<BR>
 * <BR>
 * @author C. Schalkwijk
 * @version 0.2
 *
 */
public class Arrow2D
    implements Shape, java.io.Serializable {

  private double x1 = 0;
  private double y1 = 0;
  private double x2 = 0;
  private double y2 = 0;
  public Shape head = null;
  public Shape tail = null;
   public Shape head2 = null;
  private Shape arrow = null;

  /**
   *
   */
  public Arrow2D(Point2D begin, Point2D end) {
    this.x1 = begin.getX();
    this.y1 = begin.getY();
    this.x2 = end.getX();
    this.y2 = end.getY();
    this.initArrow();

  }

  /**
   *
   * @param x1
   * @param y1
   * @param x2
   * @param y2
   * @return
   */
  protected double calcAngle(float x1, float y1, float x2, float y2) {
    double rad = 0.0d;
    float dx = x2 - x1;
    float dy = y2 - y1;

    if (dx == 0.0) {
      if (dy == 0.0) {
        rad = 0.0;
      }
      else if (dy > 0.0) {
        rad = Math.PI / 2.0;
      }
      else {
        rad = Math.PI * 3.0 / 2.0;
      }
    }
    else if (dy == 0.0) {
      if (dx > 0.0) {
        rad = 0.0;
      }
      else {
        rad = Math.PI;
      }
    }
    else {
      if (dx < 0.0) {
        rad = Math.atan(dy / dx) + Math.PI;
      }
      else if (dy < 0.0) {
        rad = Math.atan(dy / dx) + (2 * Math.PI);
      }
      else {
        rad = Math.atan(dy / dx);
      }
    }

    return rad;
  }

  /**
   *
   *
   */
  private void initArrow() {
    int length = (int) Math.sqrt(Math.pow(Math.abs(x1 - x2), 2) +
                                 Math.pow(Math.abs(y1 - y2), 2));

    Polygon poly = new Polygon();
    poly.addPoint( (int) x1, (int) y1);
    poly.addPoint( (int) x1 + length, (int) y1);
    Polygon poly2 = new Polygon();
    poly2.addPoint( (int) x1 + length - 10, (int) y1 - 5);
    poly2.addPoint( (int) x1 + length, (int) y1);
    poly2.addPoint( (int) x1 + length - 10, (int) y1 + 5);
    poly2.addPoint( (int) x1 + length - 10, (int) y1 - 5);
    Polygon poly3 = new Polygon();
    poly2.addPoint( (int) x1 + 10, (int) y1 - 5);
    poly2.addPoint( (int) x1 , (int) y1);
    poly2.addPoint( (int) x1 + 10, (int) y1 + 5);
    poly2.addPoint( (int) x1 + 10, (int) y1 - 5);

    double rad = this.calcAngle( (float)this.x1, (float)this.y1, (float)this.x2, (float)this.y2);
    AffineTransform tx = AffineTransform.getRotateInstance(rad, x1, y1);

    this.arrow = tx.createTransformedShape( (Shape) poly);
    this.tail = tx.createTransformedShape( (Shape) poly);
    this.head = tx.createTransformedShape( (Shape) poly2);
    this.head2 = tx.createTransformedShape( (Shape) poly3);
  }

  /**
   *
   * @return
   */
  public Shape getArrow() {
    return this.arrow;
  }

  /**
   *
   */
  public Rectangle2D getBounds2D() {
    double x, y, w, h;

    if (x1 < x2) {
      x = x1;
      w = x2 - x1;
    }
    else {
      x = x2;
      w = x1 - x2;
    }
    if (y1 < y2) {
      y = y1;
      h = y2 - y1;
    }
    else {
      y = y2;
      h = y1 - y2;
    }
    return new Rectangle2D.Double(x, y, w, h);
  }

  /**
   *
   */
  public Rectangle getBounds() {
    return this.getBounds2D().getBounds();
  }

  /**
   *
   */
  public boolean contains(double x, double y) {
    return this.tail.contains(x, y) || this.head.contains(x, y)|| this.head2.contains(x, y);
  }

  /**
   *
   */
  public boolean contains(double x, double y, double w, double h) {
    return this.tail.contains(x, y, w, h) || this.head.contains(x, y, w, h)|| this.head2.contains(x, y, w, h);
  }

  /**
   *
   */
  public boolean intersects(double x, double y, double w, double h) {
    return this.tail.intersects(x, y, w, h) || this.head.intersects(x, y, w, h)||this.head2.intersects(x, y, w, h);
  }

  /**
   *
   */
  public boolean contains(Point2D p) {
    return this.tail.contains(p) || this.head.contains(p)|| this.head2.contains(p);
  }

  /**
   *
   */
  public boolean contains(Rectangle2D r) {

    return this.tail.contains(r) || this.head.contains(r)|| this.head2.contains(r);
  }

  /**
   *
   */
  public boolean intersects(Rectangle2D r) {
    return this.tail.intersects(r) || this.head.intersects(r)|| this.head2.intersects(r);
  }

  /**
   *
   */
  public PathIterator getPathIterator(AffineTransform at) {
    return new ArrowIterator(this, at);
  }

  /**
   *
   */
  public PathIterator getPathIterator(AffineTransform at, double flatness) {
    return new ArrowIterator(this, at);
  }

  public double getX1() {
    return this.x1;
  }

  public double getY1() {
    return this.y1;
  }

  public Point2D getP1() {
    return null;
  }

  public double getX2() {
    return this.x2;
  }

  public double getY2() {
    return this.y2;
  }

  public Point2D getP2() {
    return null;
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re这里都是精品| 久久se这里有精品| 三级久久三级久久久| 裸体健美xxxx欧美裸体表演| 国产精品一二一区| 欧美综合天天夜夜久久| 91精品国产色综合久久ai换脸| 亚洲乱码国产乱码精品精小说 | 偷窥少妇高潮呻吟av久久免费 | 久久欧美一区二区| 亚洲色大成网站www久久九九| 亚洲国产精品视频| 韩国三级电影一区二区| 91欧美激情一区二区三区成人| 欧美日韩专区在线| 国产调教视频一区| 亚洲午夜免费视频| 国产制服丝袜一区| 欧美色图一区二区三区| 久久精品欧美一区二区三区麻豆| 亚洲女同一区二区| 国产乱码精品一区二区三区忘忧草| 在线观看成人免费视频| 精品国产精品网麻豆系列| 亚洲精品欧美激情| 国内精品伊人久久久久影院对白| 欧美性猛片aaaaaaa做受| 国产亚洲综合色| 午夜精品免费在线观看| 成人av电影免费在线播放| 日韩一区二区电影网| 亚洲精品欧美专区| 高潮精品一区videoshd| 4438x成人网最大色成网站| 一区在线播放视频| 韩国av一区二区三区在线观看| 色老汉av一区二区三区| 久久久久久久久免费| 日韩精品三区四区| 9i看片成人免费高清| 精品乱人伦一区二区三区| 一级中文字幕一区二区| 大胆欧美人体老妇| 日韩欧美一区二区视频| 亚洲高清免费观看| 99久久婷婷国产综合精品| 日韩一区二区三区免费看| 自拍偷拍亚洲欧美日韩| 国产福利一区二区三区视频| 91精品国产一区二区| 夜夜爽夜夜爽精品视频| 成人黄色免费短视频| 精品国产免费视频| 蜜桃视频免费观看一区| 欧美午夜精品久久久久久孕妇| 国产精品久久久久久亚洲伦| 欧美精品久久久久久久久老牛影院| 国产清纯在线一区二区www| 久久精品国产精品亚洲精品| 欧美日韩在线播| 自拍偷拍亚洲综合| www.日韩大片| 国产精品女同互慰在线看| 国产一区二区中文字幕| 2017欧美狠狠色| 六月丁香综合在线视频| 日韩三级av在线播放| 蜜臀av一级做a爰片久久| 欧美一区二区三区影视| 五月激情六月综合| 7777精品伊人久久久大香线蕉最新版| 一区二区三区高清| 色噜噜狠狠成人网p站| 亚洲三级久久久| 在线观看亚洲一区| 又紧又大又爽精品一区二区| 色网站国产精品| 亚洲美女一区二区三区| 色婷婷久久综合| 樱花影视一区二区| 欧美日韩一区二区三区在线| 图片区小说区国产精品视频| 欧美日韩国产一级二级| 日韩精品免费专区| 欧美一区二区成人| 久久精品国产亚洲一区二区三区 | 免费在线一区观看| 精品欧美一区二区在线观看| 久久99精品久久久久婷婷| 久久先锋影音av| 国产suv精品一区二区883| 国产精品青草久久| 一本久久综合亚洲鲁鲁五月天| 亚洲老妇xxxxxx| 欧美日韩亚洲综合一区| 轻轻草成人在线| 精品国产91亚洲一区二区三区婷婷| 狠狠色综合播放一区二区| 精品国产一区二区三区av性色| 国产精品一区在线观看乱码| 国产精品家庭影院| 91免费视频大全| 亚洲成va人在线观看| 精品国产一区a| 国产91高潮流白浆在线麻豆| 一区二区三区四区不卡在线| 91精品久久久久久久91蜜桃| 狠狠色丁香久久婷婷综合丁香| 欧美国产激情二区三区 | 亚洲精品国产一区二区三区四区在线| 欧美亚洲国产一区二区三区va| 免费视频一区二区| 国产精品夫妻自拍| 欧美性极品少妇| 精品无人码麻豆乱码1区2区| 中文字幕佐山爱一区二区免费| 欧美亚洲综合另类| 国产一区二区在线视频| 一区二区三区久久| 精品美女在线观看| 一本到三区不卡视频| 日韩高清一区在线| 国产精品美日韩| 欧美日韩在线直播| 成人午夜精品一区二区三区| 亚洲国产成人porn| 国产日韩欧美高清| 欧美男人的天堂一二区| 懂色av一区二区三区免费观看 | 欧美日韩激情一区| 国产电影一区二区三区| 亚洲午夜激情av| 国产亚洲精品资源在线26u| 91黄色免费版| 国产在线精品一区二区| 樱花影视一区二区| 欧美极品xxx| 欧美一区二区日韩| 95精品视频在线| 韩国理伦片一区二区三区在线播放| 亚洲老妇xxxxxx| 国产丝袜欧美中文另类| 4hu四虎永久在线影院成人| 91色视频在线| 国产在线播放一区二区三区| 亚洲sss视频在线视频| 国产精品乱码一区二三区小蝌蚪| 欧美一级专区免费大片| 在线免费观看视频一区| 成人18视频日本| 国产尤物一区二区| 奇米影视一区二区三区| 亚洲大型综合色站| 国产精品初高中害羞小美女文| 久久伊人蜜桃av一区二区| 在线播放中文一区| 91国偷自产一区二区三区成为亚洲经典| 国产在线播放一区三区四| 青青国产91久久久久久| 亚洲精品免费在线| 国产精品婷婷午夜在线观看| 精品久久一区二区| 69堂精品视频| 欧美天堂一区二区三区| a亚洲天堂av| 国产成人亚洲综合色影视| 久久精品国产免费| 青青草精品视频| 亚洲不卡av一区二区三区| 亚洲综合色自拍一区| 亚洲视频免费观看| 中文字幕综合网| 国产精品情趣视频| 国产精品成人网| 国产精品日韩成人| 中文字幕中文字幕中文字幕亚洲无线| 久久久久久97三级| 国产视频一区二区在线| 精品欧美久久久| 精品处破学生在线二十三| 日韩视频在线一区二区| 日韩一区二区免费电影| 欧美一二三区在线| 日韩三级中文字幕| 欧美电影免费观看高清完整版在线| 欧美人妖巨大在线| 欧美日本一区二区三区四区| 欧美福利电影网| 欧美精品18+| 欧美精品久久一区二区三区| 91精品国产手机| 日韩精品中文字幕一区二区三区 | 美女网站一区二区| 奇米精品一区二区三区四区 | 2020日本不卡一区二区视频| 精品久久久久99| 国产调教视频一区| 亚洲欧洲日韩女同| 亚洲最新视频在线观看| 亚洲成av人综合在线观看|