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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mappanel.java

?? Myjxta的源代碼 基于JXTA的P2P即時(shí)通信系統(tǒng)
?? JAVA
字號(hào):
/* *  Copyright (c) 2001 Sun Microsystems, Inc.  All rights *  reserved. * *  Redistribution and use in source and binary forms, with or without *  modification, are permitted provided that the following conditions *  are met: * *  1. Redistributions of source code must retain the above copyright *  notice, this list of conditions and the following disclaimer. * *  2. Redistributions in binary form must reproduce the above copyright *  notice, this list of conditions and the following disclaimer in *  the documentation and/or other materials provided with the *  distribution. * *  3. The end-user documentation included with the redistribution, *  if any, must include the following acknowledgment: *  "This product includes software developed by the *  Sun Microsystems, Inc. for Project JXTA." *  Alternately, this acknowledgment may appear in the software itself, *  if and wherever such third-party acknowledgments normally appear. * *  4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" *  must not be used to endorse or promote products derived from this *  software without prior written permission. For written *  permission, please contact Project JXTA at http://www.jxta.org. * *  5. Products derived from this software may not be called "JXTA", *  nor may "JXTA" appear in their name, without prior written *  permission of Sun. * *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF *  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *  SUCH DAMAGE. *  ==================================================================== * *  This software consists of voluntary contributions made by many *  individuals on behalf of Project JXTA.  For more *  information on Project JXTA, please see *  <http://www.jxta.org/>. * *  This license is based on the BSD license adopted by the Apache Foundation. * *  $Id: MapPanel.java,v 1.2 2006/07/13 05:26:37 nano Exp $ */package net.jxta.myjxta.misc.beam;import javax.swing.*;import java.awt.*;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import java.awt.event.MouseMotionListener;import java.net.URL;import java.util.Enumeration;import java.util.Hashtable;import java.util.Properties;public class MapPanel extends JPanel implements MouseMotionListener, MouseListener {    private Image img;    private JLabel status = null;    private double gpsx0 = 0.0;    private double gpsy0 = 0.0;    private double gpsx1 = 0.0;    private double gpsy1 = 0.0;    private Hashtable<String, Hashtable<String, Properties>> locations = null;    private Hashtable<String, String> iconloc = null;    private Image simg = null; //support one icon resource currently    private JPopupMenu popup = null;    private boolean popupIsVisible = false;    private String currloc = null;    public MapPanel(URL imgurl, JLabel status) {        System.out.println("MapPanel imgurl = " + imgurl.toString());        this.status = status;        locations = new Hashtable<String, Hashtable<String, Properties>>();        iconloc = new Hashtable<String, String>();        ImageIcon icon = new ImageIcon(imgurl);        img = icon.getImage();        addMouseMotionListener(this);        addMouseListener(this);        try {            URL iconurl = getClass().getResource("resources/sensorIcon.gif");            ImageIcon sicon = new ImageIcon(iconurl);            simg = sicon.getImage();        } catch (Exception exc) {            exc.printStackTrace();        }    }    public Image getImage() {        return img;    }    public void setImage(Image img) {        this.img = img;    }    public void setGPSUpperLeft(double x, double y) {        System.out.println("set upper left gps");        this.gpsx0 = x;        this.gpsy0 = y;    }    public void setGPSLowerRight(double x, double y) {        System.out.println("set lower right gps");        this.gpsx1 = x;        this.gpsy1 = y;    }    /**     * method to add a sensor.  The way MapPanel draws must be fast     * and what we will do is to take the properties file for a sensor     * and extract the gps coordinates and insert into a hashtable     * using the combined gpsx and gpsy coordinate to two decimal     * places as the hash.  At each hash key, we store a Hashtable of     * Properties representing 1 or more sensors at that relative     * GPS location.  The nested Hashtable is indexed by sensorID.     * The MapPanel will show only one icon for a location     * on the map, but post a popup display of all SIDs.     */    public void addSensor(Properties p) {        try {            // reduce gpsx and gpsy coordinate to 1 decimal place            // then generate a locationkey            double gpsx = Double.parseDouble(p.getProperty("gpsx"));            double gpsy = Double.parseDouble(p.getProperty("gpsy"));            //System.out.println("addSensor: longitude = " + gpsx + ", latitude = " + gpsy);            String lochash = getGPSLocationKey(gpsx, gpsy, 2);            String lochash2 = getGPSLocationKey(gpsx, gpsy, 1);            String sid = p.getProperty("sid");            System.out.println("MapPanel added sid [" + sid + "] at: " + lochash);            // see if current location already exists and            // if not, create a new hashtable and nest into            // locations            Hashtable<String, Properties> sensors = (locations.get(lochash));            if (sensors == null) {                sensors = new Hashtable<String, Properties>();                locations.put(lochash, sensors); // high res location sensor                iconloc.put(lochash2, lochash); // low res for icon mouseover            }            // add the specific sensor properties into specific hashtable            // of sensors at this specific location            sensors.put(sid, p);        } catch (Exception exc) {            exc.printStackTrace();        }    }    private String getGPSLocationKey(double x, double y, int decplaces) {        if (decplaces <= 0) decplaces = 2;        double divisor = 1.0;        for (int i = 0; i < decplaces; i++) {            divisor *= 10.0;        }        double xd = ((int) (x * divisor - 0.5)) / divisor;        double yd = ((int) (y * divisor + 0.5)) / divisor;        String key = Double.toString(xd) + "|" + Double.toString(yd);        return key;    }    public void paintComponent(Graphics g) {        super.paintComponent(g);        Dimension dim = getSize();        int x0 = 0;        int y0 = 0;        int imgW = 0;        int imgH = 0;        if (img != null) {            imgW = img.getWidth(this);            imgH = img.getHeight(this);            x0 = (dim.width - imgW) / 2;            y0 = (dim.height - imgH) / 2;            g.drawImage(img, x0, y0, this);            // now draw the sensor icon at each location            Enumeration<String> loc = locations.keys();            while (loc.hasMoreElements() && simg != null) {                String pos = loc.nextElement();                String lon = pos.substring(0, pos.indexOf("|"));                String lat = pos.substring(pos.indexOf("|") + 1);                double gpsx = Double.parseDouble(lon);                double gpsy = Double.parseDouble(lat);                //System.out.println("Paint Icon: longitude = " + gpsx + ", latitude = " + gpsy);                double fractionx = (gpsx - gpsx0) / (gpsx1 - gpsx0);                double fractiony = (gpsy - gpsy0) / (gpsy1 - gpsy0);                int x1 = x0 + (int) (fractionx * imgW) - 10;                int y1 = y0 + (int) (fractiony * imgH) - 10;                g.drawImage(simg, x1, y1, this);            }        }    }    public void mouseDragged(MouseEvent e) {        mouseMoved(e);    }    public void mouseMoved(MouseEvent e) {        if (img != null) {            Dimension dim = getSize();            int imgw = img.getWidth(this);            int imgh = img.getHeight(this);            int x0 = (dim.width - imgw) / 2;            int y0 = (dim.height - imgh) / 2;            int x = e.getX();            int y = e.getY();            double diffgpsx = gpsx1 - gpsx0;            double diffgpsy = gpsy1 - gpsy0;            double currgpsx = ((int) (10000 * (gpsx0 + diffgpsx * (x - x0) / imgw) + 0.5)) / 10000.0;            double currgpsy = ((int) (10000 * (gpsy0 + diffgpsy * (y - y0) / imgh) + 0.5)) / 10000.0;            status.setText("GPS coordinates:  Long. = " + currgpsx + ",  Lat. = " + currgpsy);            //System.out.println("GPS coordinates:  Lat = " + currgpsy + ",  Long. = " + currgpsx);            // now create a popup menu if inside a sensor - may need to reduce            // accuracy for this map to 1 decimal place            String lochash = getGPSLocationKey(currgpsx, currgpsy, 1);            String sensor = (iconloc.get(lochash));            if (sensor != null) { // location exists, make popup visible                if (currloc != null && currloc.equals(lochash)) { // is same popup                    if (!popupIsVisible) {                        popup.show(e.getComponent(), e.getX(), e.getY());                    }                } else {                    // hide and dispose of old popup                    if (popup != null) {                        popup.setVisible(false);                        popup = null;                    }                    // create new popup                    Hashtable sensors = locations.get(sensor);                    Enumeration keys = sensors.keys();                    popup = new JPopupMenu();                    while (keys.hasMoreElements()) {                        Properties p = (Properties) (sensors.get(keys.nextElement()));                        if (p != null) {                            String sid = p.getProperty("sid");                            String desc = p.getProperty("desc");                            popup.add(new JMenuItem(sid + ": " + desc));                        }                    }                    popup.show(e.getComponent(), e.getX(), e.getY());                    popupIsVisible = true;                    currloc = lochash;                }            } else { // make sure nothing shows                if (popup != null) popup.setVisible(false);                popup = null;                popupIsVisible = false;                currloc = null;            }        }    }    public void mouseClicked(MouseEvent e) {    }    public void mousePressed(MouseEvent e) {    }    public void mouseReleased(MouseEvent e) {    }    public void mouseEntered(MouseEvent e) {    }    public void mouseExited(MouseEvent e) {        // make sure to hide the popup.        if (popup != null) {            popup.setVisible(false);            popup = null;            currloc = null;            popupIsVisible = false;        }    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费高清视频在线观看| 在线播放91灌醉迷j高跟美女| 亚洲激情av在线| 91麻豆精品国产91久久久久久| 国产成人精品三级麻豆| 亚洲一区在线电影| 国产精品免费网站在线观看| 欧美一区二区视频在线观看| 91麻豆免费观看| 国产精品91xxx| 日本不卡视频在线| 一区二区三区在线播放| 国产欧美一区二区三区网站| 91精品国产综合久久久久久久久久| 97精品电影院| 福利电影一区二区三区| 轻轻草成人在线| 午夜欧美一区二区三区在线播放 | 欧美大片日本大片免费观看| 91一区二区三区在线观看| 国产老妇另类xxxxx| 日韩国产精品大片| 亚洲电影中文字幕在线观看| 一区二区三区在线观看国产| 亚洲日本在线观看| 国产精品久99| 国产精品狼人久久影院观看方式| 久久久久久影视| 久久午夜色播影院免费高清| 精品第一国产综合精品aⅴ| 欧美一区二区视频观看视频| 欧美顶级少妇做爰| 宅男噜噜噜66一区二区66| 欧美午夜一区二区三区| 色8久久精品久久久久久蜜| 91网站黄www| 97久久超碰国产精品| 91在线云播放| 色诱视频网站一区| 色综合一区二区三区| 色综合久久中文综合久久97| 色哟哟日韩精品| 色av综合在线| 欧美视频在线不卡| 91精品综合久久久久久| 欧美一区二区在线播放| 欧美tickling挠脚心丨vk| 欧美成人猛片aaaaaaa| 欧美变态tickling挠脚心| 久久综合久久久久88| 国产欧美一区二区精品秋霞影院 | 中文字幕av一区二区三区| 久久精品一区四区| 国产精品久久久久久亚洲伦 | 亚洲香肠在线观看| 午夜视频一区二区三区| 久久99精品久久久久婷婷| 韩国av一区二区三区| 成人精品小蝌蚪| 99国产精品国产精品毛片| 欧美视频一区二区三区| 日韩欧美精品在线视频| 欧美激情一区二区| 亚洲精品成人天堂一二三| 日韩精品电影在线| 国产在线一区二区| 91免费观看在线| 欧美日韩国产高清一区二区| 日韩视频免费直播| 久久久www成人免费毛片麻豆| 国产精品久久久久久久岛一牛影视| 最新日韩av在线| 亚洲v中文字幕| 激情小说欧美图片| 99re这里只有精品首页| 欧美一区二区大片| 国产精品大尺度| 午夜一区二区三区视频| 国产乱码精品一区二区三区忘忧草| 99久久综合精品| 91精品免费在线观看| 国产精品久久毛片| 男人的天堂亚洲一区| 99在线视频精品| 欧美成人欧美edvon| 亚洲欧美日韩小说| 久久精品国产99久久6| 一本一道波多野结衣一区二区| 欧美一区二区三区在线| 国产精品美女久久久久久久久 | 一本大道av一区二区在线播放| 欧美一级黄色录像| 亚洲柠檬福利资源导航| 激情六月婷婷综合| 欧美性猛片aaaaaaa做受| 久久夜色精品国产噜噜av| 亚洲一区二区三区小说| 成人一二三区视频| 日韩三区在线观看| 一区二区三区成人在线视频| 国产成人8x视频一区二区| 欧美一区二区三区不卡| 亚洲黄色av一区| 国产精品白丝av| 日韩欧美国产综合在线一区二区三区| 亚洲日本乱码在线观看| 国产91对白在线观看九色| 欧美一区二区在线免费播放| 亚洲综合一二三区| 成人激情文学综合网| 欧美www视频| 日韩成人一级大片| 在线欧美日韩精品| 亚洲欧美综合网| 国产成人午夜精品影院观看视频| 制服丝袜中文字幕亚洲| 亚洲第一成年网| 在线看国产一区| 亚洲黄色av一区| 色偷偷88欧美精品久久久| 中文字幕+乱码+中文字幕一区| 国产一区二区伦理| 精品福利视频一区二区三区| 日韩电影在线免费| 欧美日韩免费在线视频| 一区二区三区av电影| 一本大道久久精品懂色aⅴ| 椎名由奈av一区二区三区| 99久久精品国产网站| 国产精品午夜免费| 成人精品免费看| 国产精品天天看| 成人一区二区在线观看| 日本一区二区在线不卡| 丁香另类激情小说| 中文字幕精品综合| 成人精品在线视频观看| 亚洲欧洲另类国产综合| 色综合久久久网| 夜夜精品视频一区二区| 在线观看不卡一区| 三级亚洲高清视频| 日韩天堂在线观看| 久久成人18免费观看| 日韩免费观看高清完整版| 久久草av在线| 国产亚洲污的网站| av一区二区三区四区| 一区二区三区**美女毛片| 欧美精品九九99久久| 蜜桃视频一区二区| 久久久亚洲精品石原莉奈| 成人av在线一区二区三区| 亚洲精选一二三| 欧美日韩激情在线| 久久aⅴ国产欧美74aaa| 国产欧美日韩精品a在线观看| www.av精品| 亚洲一区二区免费视频| 欧美一卡2卡3卡4卡| 国产原创一区二区三区| 中文字幕一区二区三区在线播放 | 久久亚洲精品国产精品紫薇| 国产黄色精品视频| 专区另类欧美日韩| 7777精品伊人久久久大香线蕉的| 精品一区二区av| 国产精品蜜臀在线观看| 欧美日韩国产高清一区二区三区 | 欧美日韩国产片| 国内精品久久久久影院一蜜桃| 国产精品女主播av| 337p亚洲精品色噜噜狠狠| 国产成人综合在线播放| 亚洲午夜久久久久久久久电影网 | 综合中文字幕亚洲| 7777精品久久久大香线蕉| 国产一区二区美女诱惑| 亚洲一级二级三级在线免费观看| 精品国产一二三| 在线观看国产日韩| 国产馆精品极品| 亚洲成人你懂的| 国产精品每日更新| 69堂成人精品免费视频| 99精品国产99久久久久久白柏| 久久精品国产色蜜蜜麻豆| 亚洲黄色在线视频| 久久久精品黄色| 欧美日韩精品高清| 99re视频精品| 蓝色福利精品导航| 一区二区在线观看免费视频播放| 欧美成人性福生活免费看| 欧美视频一区二区在线观看| 国产91精品免费| 免费亚洲电影在线| 亚洲国产一二三| 国产精品美女久久久久久久久| 精品免费国产一区二区三区四区|