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

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

?? islandinfinity.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        Point ret = new Point(bounds.x + rand.nextInt(bounds.width),                              bounds.y + rand.nextInt(bounds.height));        if(new Ellipse2D.Double(bounds.x, bounds.y, bounds.width, bounds.height).contains(ret)) return ret;      }    }    debug("UNKNOWN CONT TYPE");    return null;  }  //find the point on the continent border with the given angle to center.  //we do this by a binary search for the border  private Point getPointOnContinentBorder(Point center, double theta, Rectangle border, int contType) {    if(!border.contains(center)) debug("border doesn't contain center!");    if(contType == CONT_RECT || contType == CONT_ELLIPSE) {      RectangularShape rs = null;      if(contType == CONT_RECT) {        rs = border;      } else if(contType == CONT_ELLIPSE) {        rs = new Ellipse2D.Double(border.x, border.y, border.width, border.height);      }      int radius = 1000;      Point ret = null;      int movement = 500;      for(int i = 0; i < 20; i += 1) {        ret = new Point((int)(center.x + radius*Math.cos(theta)), (int)(center.y + radius*Math.sin(theta)));        if(rs.contains(ret)) {          radius += movement;        } else {          radius -= movement;        }        movement /= 2;      }      return ret;    }    debug("GPOCB: unkown cont type");    return null;  }  //connect up the continents so that any country can reach any other country.  //the algorithm is to make the shortest valid connection at each step until  //all continents are reacheable. we return a Vector of lines that should be  //drawn representing the connections we made  private Vector makeConnectionsBetweenContinents(              int[] contIndices, Point[] contCenters, Rectangle[] contBounds, int numContinents) {    //an array saying whether there is a direct connection between any two continents    boolean[][] contsConnected = new boolean[numContinents][numContinents];    for(int i = 0; i < numContinents; i += 1) {      for(int j = 0; j < numContinents; j += 1) {        contsConnected[i][j] = false;      }    }    Vector lines = new Vector();    //connect continents until they are all connected    while(!allContsReachableFrom(0, contsConnected, numContinents)) {      double shortestGap = 10000;      int contA = -1;      int contB = -1;      for(int i = 0; i < numContinents; i += 1) {        for(int j = 0; j < numContinents; j += 1) {          if(!contsConnected[i][j] && contsConnectable(i, j, contBounds, contCenters, numContinents)) {            double gap = dist(contCenters[i], contCenters[j]);            if(gap < shortestGap) {              shortestGap = gap;              contA = i;              contB = j;            }          }        }      }      contsConnected[contA][contB] = true;      contsConnected[contB][contA] = true;      lines.add(connectContinents(contA, contB, contIndices));    }    for(int i = 0; i < numContinents; i += 1) {      int connectedConts = 0;      for(int j = 0; j < numContinents; j += 1) {        if(contsConnected[i][j]) connectedConts += 1;      }      debug("connectedConts[" + i + "] = " + connectedConts);      if(connectedConts == 2) { //dead end        double shortestGap = 10000;        int contB = -1;        for(int j = 0; j < numContinents; j += 1) {          if(!contsConnected[i][j] && contsConnectable(i, j, contBounds, contCenters, numContinents)) {            double gap = dist(contCenters[i], contCenters[j]);            if(gap < shortestGap) {              shortestGap = gap;              contB = j;            }          }        }        debug("XXXXXXXXXXXX");        if(contB != -1) {          lines.add(connectContinents(i, contB, contIndices));          contsConnected[i][contB] = true;          contsConnected[contB][i] = true;        }      }    }    return lines;  }  //can we connect contA and contB? no if the resulting line would cross another continent  private boolean contsConnectable(int contA , int contB, Rectangle[] contBounds, Point[] contCenters, int numContinents) {    Line2D.Double l = new Line2D.Double(contCenters[contA], contCenters[contB]);    for(int i = 0; i < numContinents; i += 1) {      if(i != contA && i != contB) {        if(l.intersects(contBounds[i])) return false;      }    }    return true;  }  //can all continents be reached from start?  private boolean allContsReachableFrom(int start, boolean[][] contsConnected, int numContinents) {    boolean[] reachedAlready = new boolean[numContinents];    for(int i = 0; i < numContinents; i += 1) {      reachedAlready[i] = false;    }    reachedAlready[start] = true;    int numReached = 1;    for(int i = 0; i < numContinents; i += 1) {      if(contsConnected[start][i] && i != start) {        reachedAlready = whichContsReachableFrom(i, contsConnected, reachedAlready, numContinents);      }    }    for(int i = 0; i < numContinents; i += 1) {      if(!reachedAlready[i]) return false;    }    return true;  }  //which continents can be reached from start?  private boolean[] whichContsReachableFrom(               int start, boolean[][] contsConnected, boolean[] reachedAlready, int numContinents) {    int numReached = 1;    reachedAlready[start] = true;    for(int i = 0; i < numContinents; i += 1) {      if(contsConnected[start][i] && !reachedAlready[i]) {        reachedAlready = whichContsReachableFrom(i, contsConnected, reachedAlready, numContinents);      }    }    return reachedAlready;  }  //connect cont1 and cont2, adding the connection to the connections Vector  //and returning the line to draw on the board  private Line2D.Double connectContinents(int cont1, int cont2, int[] contIndices) {    int bestPolygon1 = -1;    int bestPolygon2 = -1;    double bestLength = 10000;    for(int j = contIndices[cont1]; j < contIndices[cont1+1]; j += 1) {      for(int k = contIndices[cont2]; k < contIndices[cont2+1]; k += 1) {        Point a = polygonCenter((Polygon)countryPolygons.get(j));        Point b = polygonCenter((Polygon)countryPolygons.get(k));        double dist = dist(a, b);        if(dist < bestLength) {          bestLength = dist;          bestPolygon1 = j;          bestPolygon2 = k;        }      }    }    ((Vector)connections.get(bestPolygon1)).add(new Integer(bestPolygon2));    ((Vector)connections.get(bestPolygon2)).add(new Integer(bestPolygon1));    return drawLineBetween((Polygon)countryPolygons.get(bestPolygon1),                           (Polygon)countryPolygons.get(bestPolygon2));  }  //write the xml representation of a country polygon  private void writePolygon(PrintWriter out, Polygon p) {    out.write("<polygon>");    for(int i = 0; i < p.npoints; i += 1) {      out.write("" + p.xpoints[i] + "," + p.ypoints[i] + " ");    }    out.write("</polygon>\n");  }  //write the xml representation of a country's adjoining list  private void writeConnections(PrintWriter out, Vector conns) {    out.write("<adjoining>");    for(int i = 0; i < conns.size()-1; i += 1) {      out.write("" + (Integer)conns.get(i) + ",");    }    if(conns.size() > 0) out.write("" + (Integer)conns.get(conns.size()-1));    out.write("</adjoining>\n");  }  //write the xml representation of a line  private void writeLine(PrintWriter out, Line2D.Double l) {    out.write("<line><position>" + (int)l.x1 + "," + (int)l.y1 + " " +                                   (int)l.x2 + "," + (int)l.y2 + "</position></line>\n");  }  //distance between two points  private double dist(Point a, Point b) {    return Math.sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));  }  //find the center of gravity of a polygon  private Point polygonCenter(Polygon p) {    double x = 0;    double y = 0;    for(int i = 0; i < p.npoints; i += 1) {      x += p.xpoints[i];      y += p.ypoints[i];    }    x /= p.npoints;    y /= p.npoints;    return new Point((int)x, (int)y);  }  //draw a line between the polygons with endpoints on their perimeters  //we do this through a binary search for their boundaries  private Line2D.Double drawLineBetween(Polygon a, Polygon b) {    Point ca = polygonCenter(a);    Point cb = polygonCenter(b);    double theta = Math.atan2(ca.y - cb.y, ca.x - cb.x);    double radius = dist(ca, cb);    double movement = radius/2;    for(int i = 0; i < 20; i += 1) {      ca = new Point((int)(cb.x + radius*Math.cos(theta)), (int)(cb.y + radius*Math.sin(theta)));      if(a.contains(ca)) {        radius -= movement;      } else {        radius += movement;      }      movement /= 2;    }    radius += 5; //make sure the line isn't detached    ca = new Point((int)(cb.x + radius*Math.cos(theta)), (int)(cb.y + radius*Math.sin(theta)));    theta += Math.PI;    radius = dist(ca, cb);    movement = radius/2;    for(int i = 0; i < 20; i += 1) {      cb = new Point((int)(ca.x + radius*Math.cos(theta)), (int)(ca.y + radius*Math.sin(theta)));      if(b.contains(cb)) {        radius -= movement;      } else {        radius += movement;      }      movement /= 2;    }    radius += 5; //make sure the line isn't detached    cb = new Point((int)(ca.x + radius*Math.cos(theta)), (int)(ca.y + radius*Math.sin(theta)));    return new Line2D.Double(ca, cb);  }  //interface function. should be true on release  public boolean canCache() {    return true;  }  public String description() {    return "Makes maps consisting of island continents.";  }  //user size choices  static final String CHOICE_NORMAL = "IslandInfinity - Hawaii";  static final String CHOICE_BIG = "IslandInfinity - normal";  static final String CHOICE_HUGE = "IslandInfinity - big";  static final String CHOICE_REALLYHUGE = "IslandInfinity - huge";  public java.util.List getChoices() {    Vector v = new Vector();    v.add(CHOICE_NORMAL);    v.add(CHOICE_BIG);    v.add(CHOICE_HUGE);    v.add(CHOICE_REALLYHUGE);    return v;  }  //interface function; unused  public String message(String message, Object data) {    return "";  }  public String name() {    return "IslandInfinity";  }  public float version() {    return 1.0f;  }  private void debug(String s) {//    System.out.println(":" + s);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩区在线观看| 欧美亚洲精品一区| 国产日产精品1区| 91一区二区在线| 欧美日韩国产高清一区二区三区| 国产欧美1区2区3区| 欧美午夜影院一区| 国产超碰在线一区| 国产大陆精品国产| 亚洲高清视频的网址| 国产日韩欧美电影| 欧美伊人久久大香线蕉综合69 | 欧美成人女星排行榜| 成人免费视频一区| 国产乱国产乱300精品| 亚洲国产视频在线| 亚洲成人福利片| 欧美成人三级在线| 6080午夜不卡| 欧美剧情电影在线观看完整版免费励志电影| 精品久久久久久久一区二区蜜臀| 欧美片网站yy| 日韩午夜av一区| 日韩欧美一区二区不卡| 欧美喷潮久久久xxxxx| 欧美亚洲自拍偷拍| 在线观看免费视频综合| 欧美精品vⅰdeose4hd| 香蕉久久夜色精品国产使用方法| 樱花草国产18久久久久| 樱桃视频在线观看一区| 天天综合天天做天天综合| 人人精品人人爱| 九九国产精品视频| 99精品在线观看视频| 在线观看日韩国产| 欧美电影免费提供在线观看| 精品国产青草久久久久福利| 国产日韩影视精品| 亚洲精品乱码久久久久| 亚洲国产欧美一区二区三区丁香婷| 亚洲高清在线视频| 国产精品99久久不卡二区| 欧美无砖砖区免费| 中文字幕免费不卡| 日韩福利视频网| 91福利视频网站| 国产校园另类小说区| 一区二区三区四区不卡在线| 国产成人精品一区二区三区网站观看| 91丨九色丨蝌蚪丨老版| 久久久夜色精品亚洲| 亚洲成人动漫在线免费观看| 成人看片黄a免费看在线| 久久精品999| 日韩欧美电影一区| 欧美日本乱大交xxxxx| 久久久久久久国产精品影院| 一区二区三区波多野结衣在线观看| 国内成人精品2018免费看| 欧美精品v日韩精品v韩国精品v| 亚洲欧美日韩中文字幕一区二区三区 | 国产精品进线69影院| 国产69精品一区二区亚洲孕妇 | 欧美va亚洲va香蕉在线| 欧美日韩精品一区二区天天拍小说| 久久精品欧美一区二区三区不卡 | 亚洲午夜电影在线观看| 色婷婷亚洲一区二区三区| 亚洲美女偷拍久久| 欧美在线免费视屏| 婷婷一区二区三区| 精品国产青草久久久久福利| 国产美女精品在线| 国产精品成人免费| 91麻豆文化传媒在线观看| 亚洲午夜精品久久久久久久久| 欧美精品日韩综合在线| 国产乱理伦片在线观看夜一区 | 久久久综合九色合综国产精品| 寂寞少妇一区二区三区| 国产精品日韩成人| 91精品麻豆日日躁夜夜躁| 国产一区二区视频在线| 一区二区三区中文字幕在线观看| 欧美精品精品一区| 国产精品系列在线播放| 亚洲1区2区3区4区| 国产欧美日韩麻豆91| 欧美日韩国产另类不卡| 国产99久久久国产精品潘金| 日本欧美一区二区三区乱码| 2021久久国产精品不只是精品| 亚洲图片自拍偷拍| 精品国产一二三区| 欧美日韩国产首页在线观看| 日本一区二区三区电影| 日韩欧美的一区| 日韩欧美色电影| 欧美在线观看视频在线| 91丨九色丨黑人外教| 成人av手机在线观看| 精品在线一区二区三区| 青椒成人免费视频| 日韩国产在线观看| 午夜精品福利在线| 婷婷国产在线综合| 亚洲va在线va天堂| 日韩精品电影在线| 亚洲综合免费观看高清完整版在线| 国产精品第五页| 一区二区三区在线看| 亚洲精品乱码久久久久久黑人| 日韩理论片中文av| 亚洲一区二区在线视频| 亚洲妇熟xx妇色黄| 日本不卡1234视频| 麻豆国产一区二区| 不卡免费追剧大全电视剧网站| 成人丝袜18视频在线观看| 色婷婷av一区二区三区软件| 精品婷婷伊人一区三区三| 欧美男女性生活在线直播观看| 日韩精品在线一区二区| 欧美激情在线一区二区三区| 一区二区三区日韩在线观看| 日韩电影在线观看一区| 国产成人综合视频| 欧美性生交片4| 国产精品入口麻豆原神| 日日噜噜夜夜狠狠视频欧美人| 国产综合久久久久久鬼色| 这里只有精品免费| 国产精品伦理一区二区| 日本va欧美va瓶| 色婷婷av一区二区三区大白胸 | 国产精品自拍在线| 日韩女优av电影| 五月激情综合网| 99精品视频在线免费观看| 2020国产精品| 亚洲不卡av一区二区三区| av在线播放不卡| 26uuuu精品一区二区| 日本免费在线视频不卡一不卡二| 91麻豆蜜桃一区二区三区| 136国产福利精品导航| 国产高清久久久| 国产女人aaa级久久久级 | 成人在线一区二区三区| 久久久久久久综合| 美女看a上一区| 亚洲精品在线观看视频| 国内精品免费**视频| 久久久久99精品一区| 国产一区美女在线| 国产午夜精品一区二区三区视频| 国产一区二区三区免费看| 国产欧美在线观看一区| 国产精品久久久一本精品| 国产精品九色蝌蚪自拍| 日本韩国一区二区三区视频| 亚洲精品网站在线观看| 欧美蜜桃一区二区三区| 精品在线你懂的| 亚洲人一二三区| 日韩欧美一级二级三级久久久| 国产一区二区免费在线| 色综合色狠狠天天综合色| 91.com在线观看| 99久久国产综合精品色伊| 亚洲小说春色综合另类电影| 日韩你懂的在线播放| 色噜噜狠狠色综合欧洲selulu| 乱一区二区av| 午夜电影一区二区| 一区二区三区四区中文字幕| 精品va天堂亚洲国产| 91黄色免费看| 成人国产精品免费网站| 麻豆精品在线播放| 日韩中文字幕区一区有砖一区 | 日本午夜精品一区二区三区电影| 国产亚洲精品福利| 日韩三级伦理片妻子的秘密按摩| 色域天天综合网| 色综合天天综合网天天狠天天| 麻豆成人久久精品二区三区红| 亚洲国产视频一区二区| 亚洲六月丁香色婷婷综合久久 | 亚洲免费av在线| 高清成人免费视频| 成人免费视频国产在线观看| 国产精品香蕉一区二区三区| 国产一区二区三区视频在线播放| 九一九一国产精品| 老司机免费视频一区二区三区| 蜜臀久久久99精品久久久久久| 午夜免费欧美电影| 秋霞成人午夜伦在线观看|