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

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

?? scattergraph.java

?? openmap java寫的開源數字地圖程序. 用applet實現,可以像google map 那樣放大縮小地圖.
?? JAVA
字號:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// // $Source:// /cvs/distapps/openmap/src/openmap/com/bbn/openmap/layer/plotLayer/ScatterGraph.java,v// $// $RCSfile: ScatterGraph.java,v $// $Revision: 1.2.2.3 $// $Date: 2005/08/09 21:17:54 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.plotLayer;import java.awt.Color;import java.awt.Font;import java.awt.Paint;import java.text.SimpleDateFormat;import java.util.Date;import java.util.Enumeration;import java.util.Vector;import com.bbn.openmap.omGraphics.OMCircle;import com.bbn.openmap.omGraphics.OMGraphic;import com.bbn.openmap.omGraphics.OMGraphicList;import com.bbn.openmap.omGraphics.OMLine;import com.bbn.openmap.omGraphics.OMRect;import com.bbn.openmap.omGraphics.OMText;import com.bbn.openmap.util.Debug;public class ScatterGraph {    // Color to display the plot in.    private final Paint plot_color_ = Color.black;    private final Paint graph_bg_color = Color.white;    private final Paint select_color_ = Color.red;    protected OMGraphicList plot_graphics_ = null;    protected OMGraphicList plot_points_ = null;    protected OMGraphicList plot_background_ = null;    // pixels from edge of frame to the Plot itself    private final int border_width_ = 50;    private boolean axes_displayed_ = false;    private float temp_scale_ = Float.NaN;    private float year_scale_ = Float.NaN;    private float max_year_ = Float.NaN;    private float min_year_ = Float.NaN;    private float max_temp_ = Float.NaN;    private float min_temp_ = Float.NaN;    // A Vector of the GLOBESites that are currently displayed on the    // map.    private Vector sites_displayed_ = null;    // the size and position of the available drawing area    private int frame_x, frame_y;    private int frame_height_, frame_width_;    private int plot_height_, plot_width_;//    private int frame_xoffset_, frame_yoffset_;//    private static final byte[] datapoint_bits_ = { (byte) 0x0e, (byte) 0x1f,//            (byte) 0x1b, (byte) 0x1f, (byte) 0x0e };    private void initialize(int height, int width, int xoffset, int yoffset,                            Vector sites, float minyear, float maxyear,                            float mintemp, float maxtemp) {        plot_graphics_ = new OMGraphicList();        plot_points_ = new OMGraphicList();        plot_background_ = new OMGraphicList();        plot_graphics_.setTraverseMode(OMGraphicList.LAST_ADDED_ON_TOP);        plot_points_.setTraverseMode(OMGraphicList.LAST_ADDED_ON_TOP);        plot_background_.setTraverseMode(OMGraphicList.LAST_ADDED_ON_TOP);//        max_year_ = maxyear;        min_year_ = minyear;        max_temp_ = maxtemp;        min_temp_ = mintemp;        resizeGraph(frame_x, frame_y, height, width);        setDataPoints(sites);        resetScale();        plotData();    }    /**     * Set up the size of the graph, and scale all the axes correctly.     */    public ScatterGraph(int height, int width, Vector sites, float minyear,            float maxyear, float mintemp, float maxtemp) {        initialize(height,                width,                0,                0,                sites,                minyear,                maxyear,                mintemp,                maxtemp);    }    public ScatterGraph(int height, int width, int xoffset, int yoffset,            Vector sites, float minyear, float maxyear, float mintemp,            float maxtemp) {        initialize(height,                width,                xoffset,                yoffset,                sites,                minyear,                maxyear,                mintemp,                maxtemp);    }    public void resize(int x, int y, int newwidth, int newheight) {        plot_graphics_.clear();        plot_points_.clear();        plot_background_.clear();        resizeGraph(x, y, newheight, newwidth);        axes_displayed_ = false;        // replot everything on the graph        plotData();    }    // If the window changes size, we need to resize the graph, and    // replot.    private void resizeGraph(int x, int y, int height, int width) {        // Setup the sizes.        frame_x = x;        frame_y = y;        frame_width_ = width;        frame_height_ = height;        plot_width_ = frame_width_ - 2 * border_width_;        plot_height_ = frame_height_ - 2 * border_width_;        resetScale();    }    /**     * Set the max and min points (as well as the scale factors) for     * the plot.     *      * @param minyear lowest year     * @param maxyear highest year     * @param mintemp lowest temperature     * @param maxtemp highest temperature     */    private void setScale(float minyear, float maxyear, float mintemp,                          float maxtemp) {        min_year_ = minyear;        max_year_ = maxyear;        min_temp_ = mintemp;        max_temp_ = maxtemp;        temp_scale_ = ((float) plot_height_ / (maxtemp - mintemp));        year_scale_ = ((float) plot_width_ / (maxyear - minyear));    }    private void resetScale() {        setScale(min_year_, max_year_, min_temp_, max_temp_);    }    /**     * Give us new data points to plot.     *      * @param sites the sites     */    public void setDataPoints(Vector sites) {        if (sites != null) {            sites_displayed_ = sites;        } else {            sites_displayed_ = new Vector();        }    }    /**     * Returns the location of the plot point for this value. This is     * just (value - offset) * scale     *      * @param value the value     * @param scale the scale     * @param offset the offset     * @return the pixel position on the plot (not on the whole     *         frame).     */    private int findPointOnScale(float value, float scale, float offset) {        float newvalue = (value - offset) * scale;        return (int) newvalue;    }    // gets the Y coordinate of the plot    private int findTempPoint(float value) {        return frame_y                + frame_height_                - (border_width_ + findPointOnScale(value,                        temp_scale_,                        min_temp_));    }    // gets the Y coordinate of the plot    private int findYearPoint(float value) {        return frame_x + border_width_                + findPointOnScale(value, year_scale_, min_year_);    }    /**     * This is used primarily for drawing the axes of the plot.     *      * @param x1 x coordinate     * @param y1 y coordinate     * @param x2 x coordinate     * @param y2 y coordinate     * @param color color     * @return an OMLine object, suitable for displaying on the map.     */    private OMLine createPlotLine(int x1, int y1, int x2, int y2, Paint color) {        OMLine line = new OMLine(x1, y1, x2, y2);        line.setLinePaint(color);        line.setSelectPaint(Color.white);        return line;    }    private OMLine createGraphLine(float year1, float temp1, float year2,                                   float temp2) {        int x1 = findYearPoint(year1);        int y1 = findTempPoint(temp1);        int x2 = findYearPoint(year2);        int y2 = findTempPoint(temp2);        OMLine line = createPlotLine(x1, y1, x2, y2, plot_color_);        line.setLinePaint(plot_color_);        line.setSelectPaint(select_color_);        return line;    }    private OMText createLabel(String text, int x, int y, Paint color,                               int justification) {        Font default_font = new Font("TimesRoman", Font.PLAIN, 10);        OMText label = new OMText(x, y, text, default_font, justification);        label.setLinePaint(color);        label.setSelectPaint(Color.white);        return label;    }    private OMText createLabel(String text, int x, int y) {        return createLabel(text, x, y, plot_color_, OMText.JUSTIFY_LEFT);    }    private Date GetDateFromFloat(float fdate) {        long mseconds = (long) ((fdate - 1970) * 365.25 // days per                                                        // year                * 24 // hours per day                * 60 // minutes per hour                * 60 // seconds per minute        * 1000); // milliseconds per second        Date date = new Date(mseconds);        return date;    }    private String GetStringDateFromFloat(float fdate) {        Date date = GetDateFromFloat(fdate);        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm MM/dd/yyyy");        String datestring = sdf.format(date);        return datestring;    }    /**     * Draw the axes of the Graph, and label them where appropriate     */    private void drawGraphAxes() {        //      System.out.println("Plotting Axes");        int top = frame_y + border_width_;        int bottom = frame_y + frame_height_ - border_width_;        int left = frame_x + border_width_;        int right = frame_x + frame_width_ - border_width_;        String min_year_string = GetStringDateFromFloat(min_year_);        String max_year_string = GetStringDateFromFloat(max_year_);        OMLine year_axis = createPlotLine(left,                bottom,                right,                bottom,                plot_color_);        OMLine temp_axis = createPlotLine(left, top, left, bottom, plot_color_);        OMText year_min_label = createLabel(min_year_string + " ",                left,                bottom + 10);        OMText year_max_label = createLabel(max_year_string + " ",                right - 30,                bottom + 10);        OMText temp_min_label = createLabel(min_temp_ + " ",                left,                bottom,                plot_color_,                OMText.JUSTIFY_RIGHT);        OMText temp_max_label = createLabel(max_temp_ + " ",                left,                top,                plot_color_,                OMText.JUSTIFY_RIGHT);        OMText temp_axis_label = createLabel("Temp", left, frame_y                + (frame_height_ / 2), plot_color_, OMText.JUSTIFY_RIGHT);        OMText year_axis_label = createLabel("Year", frame_x                + (frame_width_ / 2), bottom + 15);        // The background that the plot is drawn on.        OMRect background = new OMRect(frame_x, frame_y, frame_x + frame_width_, frame_y                + frame_height_);        background.setFillPaint(graph_bg_color);        background.setLinePaint(graph_bg_color);        year_axis.setAppObject(this);        temp_axis.setAppObject(this);        plot_background_.addOMGraphic(background);        plot_background_.addOMGraphic(year_axis);        plot_background_.addOMGraphic(temp_axis);        plot_background_.addOMGraphic(temp_axis_label);        plot_background_.addOMGraphic(year_axis_label);        plot_background_.addOMGraphic(year_min_label);        plot_background_.addOMGraphic(year_max_label);        plot_background_.addOMGraphic(temp_min_label);        plot_background_.addOMGraphic(temp_max_label);        // add the result to the plot        plot_graphics_.addOMGraphic(plot_background_);        axes_displayed_ = true;    }    public OMGraphicList getPlotGraphics() {        return plot_graphics_;    }    private OMGraphic plotPoint(float year, float temp) {        int x = findYearPoint(year);        int y = findTempPoint(temp);        String yearstring = GetStringDateFromFloat(year);        String name = "Time: " + yearstring + ", Temperature: " + temp + "C ("                + (int) ((9.0 / 5.0) * temp + 32) + "F)";        OMGraphic graphic = new OMCircle(x, y, 2, 2);        graphic.setLinePaint(plot_color_);        graphic.setFillPaint(plot_color_);        graphic.setSelectPaint(select_color_);        graphic.setAppObject(name);        return graphic;    }    private Enumeration sortEnumerationOfFloats(Enumeration enumeration) {        Vector vec = new Vector();        while (enumeration.hasMoreElements()) {            vec.addElement(enumeration.nextElement());        }        Float[] result = new Float[vec.size()];        vec.copyInto(result);        Vector resultvec = new Vector(vec.size());        for (int i = 0; i < vec.size(); i++) {            for (int j = i + 1; j < vec.size(); j++) {                if (result[i].floatValue() > result[j].floatValue()) {                    Float t = result[i];                    result[i] = result[j];                    result[j] = t;                }            }            // We now know that i contains the smallest element            // in the remaining vector.            resultvec.addElement(result[i]);        }        return resultvec.elements();    }    /**     * Create OMGraphics for all the data points on the plot     */    public void plotData() {        Debug.message("basic", "ScatterGraph.plotData()");        Enumeration all_sites = sites_displayed_.elements();        int num_elements = 0;        int num_sites = 0;        plot_points_.clear();        // Do the Axes:        if (!axes_displayed_) {            drawGraphAxes();        }        while (all_sites.hasMoreElements()) {            GLOBESite site = (GLOBESite) all_sites.nextElement();            Enumeration years = sortEnumerationOfFloats(site.getAllYears());            float last_year = Float.NaN;            float last_temp = Float.NaN;            num_sites++;            while (years.hasMoreElements()) {                float year = ((Float) years.nextElement()).floatValue();                float temp = site.getValueForYear(year);                OMGraphic point = plotPoint(year, temp);                plot_points_.addOMGraphic(point);                if (!Float.isNaN(last_year)) {                    // Connect all the rest with a line.                    OMGraphic line = createGraphLine(last_year,                            last_temp,                            year,                            temp);                    plot_points_.addOMGraphic(line);                }                // remember the last point we looked at.                last_year = year;                last_temp = temp;                // plot a data point                num_elements++;            }        }        plot_graphics_.addOMGraphic(plot_points_);        //              System.out.println("Data plotted: " +        //                         num_sites + " sites, " +        //                         num_elements + " datapoints");    }    public OMGraphic selectPoint(int x, int y, float range) {        OMGraphic selection;        selection = plot_points_.selectClosest(x, y, range);        return selection;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美韩国一区二区| 欧美极品美女视频| 成人国产精品免费观看| 亚洲丶国产丶欧美一区二区三区| 久久视频一区二区| 欧美日韩午夜在线视频| 粉嫩嫩av羞羞动漫久久久| 免费高清成人在线| 樱花影视一区二区| 中文字幕制服丝袜成人av| 这里只有精品电影| 精品视频一区三区九区| 91丨porny丨户外露出| 国产成a人亚洲精品| 久久不见久久见免费视频7| 亚洲国产精品久久久久秋霞影院 | 日韩欧美久久一区| 欧美日韩精品一区二区三区| 色综合久久天天| av在线一区二区| 国产91在线观看丝袜| 国产在线播放一区三区四| 日韩精品一二区| 亚洲永久免费av| 亚洲激情在线激情| 一区二区三区免费网站| 亚洲精选视频在线| 亚洲精品五月天| 亚洲视频免费在线| 亚洲免费在线视频| 亚洲天堂a在线| 亚洲色图欧美在线| 国产日韩精品一区二区浪潮av| 欧美丝袜丝交足nylons| 色综合一个色综合亚洲| 99久久精品国产导航| 成人99免费视频| 99国产欧美另类久久久精品| 99久久精品久久久久久清纯| 不卡视频免费播放| 岛国精品在线观看| 成人一区二区三区在线观看| 成人免费毛片嘿嘿连载视频| 成人av在线播放网址| 成人看片黄a免费看在线| aaa国产一区| 在线观看日韩av先锋影音电影院| 91久久精品一区二区三| 欧美亚洲一区二区三区四区| 欧美色老头old∨ideo| 91精品国产综合久久精品| 日韩一区二区在线看片| 久久久国产午夜精品| 综合自拍亚洲综合图不卡区| 一区二区在线观看免费视频播放 | 国产精品三级在线观看| 国产精品欧美综合在线| 亚洲欧美色综合| 亚洲一区二区三区影院| 日本女优在线视频一区二区| 久久国产尿小便嘘嘘尿| 成人网在线播放| 色婷婷亚洲婷婷| 在线电影院国产精品| 久久亚洲二区三区| 亚洲少妇最新在线视频| 亚洲r级在线视频| 久久99精品久久只有精品| 成人免费va视频| 欧美日韩一区二区三区免费看| 日韩女优毛片在线| 国产精品久久久久久户外露出 | 欧美亚洲高清一区| 精品美女被调教视频大全网站| 国产欧美日韩精品一区| 亚洲国产人成综合网站| 国产在线视视频有精品| jlzzjlzz亚洲女人18| 欧美日韩一本到| 久久婷婷久久一区二区三区| 亚洲日本在线视频观看| 久久精品国产网站| 一本色道久久综合狠狠躁的推荐| 欧美大片在线观看一区二区| 成人免费在线观看入口| 麻豆成人av在线| 成人福利视频在线| 欧美精品成人一区二区三区四区| 欧美激情在线一区二区| 日韩在线一区二区三区| 99这里只有久久精品视频| 日韩欧美一二区| 洋洋成人永久网站入口| 成人一区二区三区视频在线观看| 欧美一区二区视频观看视频| 亚洲精品免费在线| 国产成人av一区二区| 欧美一级淫片007| 一区二区三区四区不卡视频| 国产高清在线观看免费不卡| 91精品欧美久久久久久动漫| 一区二区三区四区五区视频在线观看 | 亚洲综合在线视频| 成人午夜大片免费观看| 日韩欧美中文字幕公布| 婷婷六月综合亚洲| 在线免费不卡电影| 日韩美女精品在线| 国产91精品入口| 精品国产免费视频| 日韩二区在线观看| 欧美日韩国产在线观看| 亚洲欧美日韩国产中文在线| 成人午夜视频在线观看| 精品盗摄一区二区三区| 日韩专区在线视频| 欧美少妇bbb| 亚洲一区二区高清| 在线免费观看日本一区| 亚洲黄色小视频| 色婷婷综合中文久久一本| 亚洲视频免费观看| 91亚洲精品久久久蜜桃网站| 欧美激情一区在线观看| 国产成人亚洲综合a∨猫咪| 久久精品视频免费| 国产成人av电影在线观看| 国产日韩精品一区| 成人高清视频在线| 国产精品短视频| 99re热这里只有精品免费视频| 中文字幕第一区二区| 成人在线综合网| 成人欧美一区二区三区| 一本一道综合狠狠老| 亚洲国产色一区| 在线播放91灌醉迷j高跟美女| 亚洲一二三区视频在线观看| 欧美在线一区二区| 日韩黄色小视频| 日韩一级完整毛片| 国产一区二区三区久久悠悠色av| 精品不卡在线视频| 国产成人免费视频一区| 亚洲天堂成人在线观看| 欧美性大战久久| 日韩精品成人一区二区在线| 日韩欧美国产一区二区在线播放| 激情综合色播激情啊| 国产日韩欧美精品在线| 色综合天天综合网天天狠天天| 亚洲精品国产a久久久久久| 欧美色爱综合网| 美女视频黄 久久| 欧美经典三级视频一区二区三区| 99r精品视频| 婷婷综合五月天| 精品999久久久| 99在线精品一区二区三区| 亚洲mv在线观看| 久久中文娱乐网| 99久久久精品免费观看国产蜜| 亚洲国产欧美在线人成| 日韩欧美黄色影院| aaa欧美色吧激情视频| 五月婷婷激情综合| 国产亚洲综合色| 在线观看欧美日本| 激情综合色综合久久| 亚洲伦理在线精品| 欧美成人vps| 91浏览器在线视频| 麻豆91在线看| 一区二区在线看| 久久久美女毛片| 欧美性猛交xxxx乱大交退制版| 久久精品国产免费| 亚洲男人都懂的| 久久综合九色综合欧美98| 色狠狠av一区二区三区| 久久精品国产色蜜蜜麻豆| 亚洲柠檬福利资源导航| 精品国产免费人成电影在线观看四季 | 久久精品国产**网站演员| 一区精品在线播放| 日韩小视频在线观看专区| 一本久道久久综合中文字幕| 美女尤物国产一区| 亚洲精品国产视频| 久久久久久久久97黄色工厂| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 狠狠色综合播放一区二区| 一区二区三区四区乱视频| 国产精品午夜在线| 日韩视频永久免费| 91福利在线播放| 成人自拍视频在线观看| 加勒比av一区二区| 亚洲国产婷婷综合在线精品| 国产亚洲一区字幕|