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

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

?? navmousemode.java

?? openmap java寫的開源數(shù)字地圖程序. 用applet實(shí)現(xiàn),可以像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/event/NavMouseMode.java,v $// $RCSfile: NavMouseMode.java,v $// $Revision: 1.5.2.4 $// $Date: 2005/08/09 17:38:50 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.event;import java.awt.Cursor;import java.awt.Graphics;import java.awt.Point;import java.awt.event.MouseEvent;import com.bbn.openmap.LatLonPoint;import com.bbn.openmap.MapBean;import com.bbn.openmap.proj.Proj;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.Debug;/** * The Navigation Mouse Mode interprets mouse clicks and mouse drags * to recenter and rescale the map. The map is centered on the * location where a click occurs. If a box is drawn by clicking down * and dragging the mouse, the map is centered on the dot in the * center of the box, and the scale is adjusted so the screen fills * the area designated by the box. * <p> * You MUST add this MouseMode as a ProjectionListener to the MapBean * to get it to work. If you use a MouseDelegator with the bean, it * will take care of that for you. */public class NavMouseMode extends CoordMouseMode {    /**     * Mouse Mode identifier, which is "Navigation".     */    public final static transient String modeID = "Navigation";    protected Point point1, point2;    protected boolean autoZoom = false;    /**     * Construct a NavMouseMode. Sets the ID of the mode to the     * modeID, the consume mode to true, and the cursor to the     * crosshair.     */    public NavMouseMode() {        this(true);    }    /**     * Construct a NavMouseMode. Lets you set the consume mode. If the     * events are consumed, then a MouseEvent is sent only to the     * first MapMouseListener that successfully processes the event.     * If they are not consumed, then all of the listeners get a     * chance to act on the event.     *      * @param shouldConsumeEvents the mode setting.     */    public NavMouseMode(boolean shouldConsumeEvents) {        super(modeID, shouldConsumeEvents);        // override the default cursor        setModeCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));    }    /**     * Handle a mousePressed MouseListener event. Erases the old     * navigation rectangle if there is one, and then keeps the press     * point for reference later.     *      * @param e MouseEvent to be handled     */    public void mousePressed(MouseEvent e) {        if (Debug.debugging("mousemode")) {            Debug.output(getID() + "|NavMouseMode.mousePressed()");        }        e.getComponent().requestFocus();        if (!mouseSupport.fireMapMousePressed(e)                && e.getSource() instanceof MapBean) {            // set the new first point            point1 = e.getPoint();            // ensure the second point isn't set.            point2 = null;            autoZoom = true;        }    }    /**     * Handle a mouseReleased MouseListener event. If there was no     * drag events, or if there was only a small amount of dragging     * between the occurence of the mousePressed and this event, then     * recenter the map. Otherwise we get the second corner of the     * navigation rectangle and try to figure out the best scale and     * location to zoom in to based on that rectangle.     *      * @param e MouseEvent to be handled     */    public void mouseReleased(MouseEvent e) {        if (Debug.debugging("mousemode")) {            Debug.output(getID() + "|NavMouseMode.mouseReleased()");        }        Object obj = e.getSource();        mouseSupport.fireMapMouseReleased(e);        if (!(obj instanceof MapBean) || !autoZoom || point1 == null)            return;        MapBean map = (MapBean) obj;        Projection projection = map.getProjection();        Proj p = (Proj) projection;        synchronized (this) {            point2 = e.getPoint();            int dx = Math.abs(point2.x - point1.x);            int dy = Math.abs(point2.y - point1.y);            // Don't bother redrawing if the rectangle is too small            if ((dx < 5) || (dy < 5)) {                // clean up the rectangle, since point2 has the old                // value.                paintRectangle(map, point1, point2);                // If rectangle is too small in both x and y then                // recenter the map                if ((dx < 5) && (dy < 5)) {                    LatLonPoint llp = projection.inverse(e.getPoint());                    boolean shift = e.isShiftDown();                    boolean control = e.isControlDown();                    if (control) {                        if (shift) {                            p.setScale(p.getScale() * 2.0f);                        } else {                            p.setScale(p.getScale() / 2.0f);                        }                    }                    // reset the points here so the point doesn't get                    // rendered on the repaint.                    point1 = null;                    point2 = null;                    p.setCenter(llp);                    map.setProjection(p);                }                return;            }            // Figure out the new scale            float newScale = com.bbn.openmap.proj.ProjMath.getScale(point1,                    point2,                    projection);            // Figure out the center of the rectangle            int centerx = Math.min(point1.x, point2.x) + dx / 2;            int centery = Math.min(point1.y, point2.y) + dy / 2;            com.bbn.openmap.LatLonPoint center = projection.inverse(centerx,                    centery);            // Fire events on main map to change view to match rect1            //    Debug.output("point1: " +point1);            //    Debug.output("point2: " +point2);            //        Debug.output("Centerx: " +centerx +            //             " Centery: " + centery);            //          Debug.output("New Scale: " + newScale);            //          Debug.output("New Center: " +center);            // Set the parameters of the projection and then set            // the projection of the map. This way we save having            // the MapBean fire two ProjectionEvents.            p.setScale(newScale);            p.setCenter(center);            // reset the points here so the point doesn't get rendered            // on the repaint.            point1 = null;            point2 = null;            map.setProjection(p);        }    }    /**     * Handle a mouseEntered MouseListener event. The boolean autoZoom     * is set to true, which will make the delegate ask the map to     * zoom in to a box that is drawn.     *      * @param e MouseEvent to be handled     */    public void mouseEntered(MouseEvent e) {        if (Debug.debugging("mousemodedetail")) {            Debug.output(getID() + "|NavMouseMode.mouseEntered()");        }        super.mouseEntered(e);        autoZoom = true;    }    /**     * Handle a mouseExited MouseListener event. The boolean autoZoom     * is set to false, which will cause the delegate to NOT ask the     * map to zoom in on a box. If a box is being drawn, it will be     * erased. The point1 is kept in case the mouse comes back on the     * screen with the button still down. Then, a new box will be     * drawn with the original mouse press position.     *      * @param e MouseEvent to be handled     */    public void mouseExited(MouseEvent e) {        if (Debug.debugging("mousemodedetail")) {            Debug.output(getID() + "|NavMouseMode.mouseExited()");        }        super.mouseExited(e);        if (e.getSource() instanceof MapBean) {            // don't zoom in, because the mouse is off the window.            autoZoom = false;            // clean up the last box drawn            paintRectangle((MapBean) e.getSource(), point1, point2);            // set the second point to null so that a new box will be            // drawn if the mouse comes back, and the box will use the            // old            // starting point, if the mouse button is still down.            point2 = null;        }    }    // Mouse Motion Listener events    ///////////////////////////////    /**     * Handle a mouseDragged MouseMotionListener event. A rectangle is     * drawn from the mousePressed point, since I'm assuming that I'm     * drawing a box to zoom the map to. If a previous box was drawn,     * it is erased.     *      * @param e MouseEvent to be handled     */    public void mouseDragged(MouseEvent e) {        if (Debug.debugging("mousemodedetail")) {            Debug.output(getID() + "|NavMouseMode.mouseDragged()");        }        super.mouseDragged(e);        if (e.getSource() instanceof MapBean) {            if (!autoZoom)                return;            // clean up the old rectangle, since point2 has the old            // value.            paintRectangle((MapBean) e.getSource(), point1, point2);            // paint new rectangle            //          point2 = e.getPoint();            point2 = getRatioPoint((MapBean) e.getSource(),                    point1,                    e.getPoint());            paintRectangle((MapBean) e.getSource(), point1, point2);        }    }    /**     * Given a MapBean, which provides the projection, and the     * starting point of a box (pt1), look at pt2 to see if it     * represents the ratio of the projection map size. If it doesn't,     * provide a point that does.     */    protected Point getRatioPoint(MapBean map, Point pt1, Point pt2) {        Projection proj = map.getProjection();        float mapRatio = (float) proj.getHeight() / (float) proj.getWidth();        float boxHeight = (float) (pt1.y - pt2.y);        float boxWidth = (float) (pt1.x - pt2.x);        float boxRatio = Math.abs(boxHeight / boxWidth);        int isNegative = -1;        if (boxRatio > mapRatio) {            // box is too tall, adjust boxHeight            if (boxHeight < 0)                isNegative = 1;            boxHeight = Math.abs(mapRatio * boxWidth);            pt2.y = pt1.y + (isNegative * (int) boxHeight);        } else if (boxRatio < mapRatio) {            // box is too wide, adjust boxWidth            if (boxWidth < 0)                isNegative = 1;            boxWidth = Math.abs(boxHeight / mapRatio);            pt2.x = pt1.x + (isNegative * (int) boxWidth);        }        return pt2;    }    /**     * Draws or erases boxes between two screen pixel points. The     * graphics from the map is set to XOR mode, and this method uses     * two colors to make the box disappear if on has been drawn at     * these coordinates, and the box to appear if it hasn't.     *      * @param pt1 one corner of the box to drawn, in window pixel     *        coordinates.     * @param pt2 the opposite corner of the box.     */    protected void paintRectangle(MapBean map, Point pt1, Point pt2) {        if (map != null) {            paintRectangle(map.getGraphics(), pt1, pt2);        }    }    /**     * Draws or erases boxes between two screen pixel points. The     * graphics from the map is set to XOR mode, and this method uses     * two colors to make the box disappear if on has been drawn at     * these coordinates, and the box to appear if it hasn't.     *      * @param pt1 one corner of the box to drawn, in window pixel     *        coordinates.     * @param pt2 the opposite corner of the box.     */    protected void paintRectangle(Graphics g, Point pt1, Point pt2) {        g.setXORMode(java.awt.Color.lightGray);        g.setColor(java.awt.Color.darkGray);        if (pt1 != null && pt2 != null) {            int width = Math.abs(pt2.x - pt1.x);            int height = Math.abs(pt2.y - pt1.y);            if (width == 0)                width++;            if (height == 0)                height++;            g.drawRect(pt1.x < pt2.x ? pt1.x : pt2.x, pt1.y < pt2.y ? pt1.y                    : pt2.y, width, height);            g.drawRect(pt1.x < pt2.x ? pt1.x + (pt2.x - pt1.x) / 2 - 1 : pt2.x                    + (pt1.x - pt2.x) / 2 - 1,                    pt1.y < pt2.y ? pt1.y + (pt2.y - pt1.y) / 2 - 1 : pt2.y                            + (pt1.y - pt2.y) / 2 - 1,                    2,                    2);        }    }    /**     * Called by the MapBean when it repaints, to let the MouseMode     * know when to update itself on the map. PaintListener interface.     */    public void listenerPaint(java.awt.Graphics g) {        // will be properly rejected of point1, point2 == null        paintRectangle(g, point1, point2);    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
东方aⅴ免费观看久久av| 26uuu欧美日本| 亚洲天堂2014| 欧洲一区在线电影| 韩国欧美国产一区| 亚洲女子a中天字幕| 日韩欧美在线网站| 91啦中文在线观看| 激情欧美一区二区| 蜜臀a∨国产成人精品| 日韩美女视频一区| 亚洲特黄一级片| 一区二区三区四区在线| 久久久亚洲精品一区二区三区| 色婷婷综合久久久久中文| 日本亚洲免费观看| 亚洲一级二级三级在线免费观看| 国产欧美日本一区视频| 91精品国产aⅴ一区二区| 99久久精品国产导航| 久久超级碰视频| 亚洲大片免费看| 亚洲欧美日韩国产成人精品影院| 最新高清无码专区| 日韩激情一区二区| 亚洲精品精品亚洲| 国产精品成人午夜| 国产婷婷色一区二区三区在线| 69堂亚洲精品首页| 欧美日韩www| 欧美午夜精品久久久| 不卡欧美aaaaa| 粉嫩av一区二区三区在线播放| 成人丝袜高跟foot| 国产福利91精品一区二区三区| 日韩电影在线免费看| 国产毛片精品视频| 国产成人免费网站| 日本高清成人免费播放| 成人精品国产免费网站| 欧美性大战久久久久久久蜜臀| 欧美一区二区啪啪| 中文字幕一区二区三区视频| 中文字幕 久热精品 视频在线| 久久蜜臀中文字幕| 亚洲国产综合在线| 丝袜美腿亚洲一区二区图片| 国产一区二区三区久久悠悠色av| 91性感美女视频| 精品久久免费看| 国产婷婷色一区二区三区| 一区二区欧美视频| jvid福利写真一区二区三区| 91猫先生在线| 久久久久99精品一区| 亚欧色一区w666天堂| 成年人网站91| 久久女同精品一区二区| 日韩在线一区二区| 欧美主播一区二区三区美女| 国产精品区一区二区三| 亚洲国产毛片aaaaa无费看| 成人精品视频网站| 久久一区二区三区国产精品| 日本sm残虐另类| 成人三级伦理片| 久久久亚洲精品石原莉奈| 日本一道高清亚洲日美韩| 欧美中文字幕久久| 亚洲久本草在线中文字幕| www.久久久久久久久| 日本一区二区在线不卡| 国产成人免费在线观看不卡| 久久久蜜桃精品| 极品少妇xxxx精品少妇| 91免费国产视频网站| 国产精品国产三级国产普通话蜜臀 | jlzzjlzz欧美大全| 国产日韩欧美a| 成人一区二区三区视频在线观看| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美自拍偷拍一区| 一区二区三区欧美亚洲| 91福利小视频| 亚洲成人免费看| 欧美一级欧美三级在线观看| 午夜精品免费在线| 成人综合激情网| 国产精品久久久久久久久晋中 | 亚洲精选在线视频| 欧美日韩中字一区| 国产精品美女久久久久aⅴ| 丁香激情综合五月| 亚洲欧美日韩国产综合在线| 欧美午夜一区二区| 日韩av不卡在线观看| 精品国产乱子伦一区| 日日夜夜免费精品| 欧美大片国产精品| 日韩**一区毛片| 久久久久久影视| 91视视频在线观看入口直接观看www | 在线观看亚洲精品视频| 婷婷久久综合九色综合伊人色| 91精品国产综合久久香蕉的特点 | 成人国产精品免费观看| 亚洲综合一区二区| 日韩一级完整毛片| 99亚偷拍自图区亚洲| 日韩国产精品久久久| 国产网红主播福利一区二区| 色综合中文字幕| 国产精品国产馆在线真实露脸 | 亚洲人成网站色在线观看| 欧美日韩在线播放三区四区| 美国精品在线观看| 亚洲欧美一区二区三区国产精品 | 欧美日韩国产色站一区二区三区| 精品中文字幕一区二区| 亚洲免费观看高清完整版在线 | 欧美综合色免费| 国产一区二区h| 亚洲第一搞黄网站| 国产欧美精品国产国产专区| 欧美丰满一区二区免费视频| 天天爽夜夜爽夜夜爽精品视频 | 91麻豆.com| 久久爱www久久做| 亚洲韩国精品一区| 一区在线观看免费| 久久久亚洲国产美女国产盗摄| 在线观看一区不卡| 91玉足脚交白嫩脚丫在线播放| 精品一区二区三区免费播放| 一区二区三区欧美亚洲| ㊣最新国产の精品bt伙计久久| 欧美成人官网二区| 欧美巨大另类极品videosbest| 99久久综合国产精品| 国产成人av电影| 久久se精品一区精品二区| 亚洲午夜精品在线| 亚洲影视在线播放| 日韩理论片网站| 国产精品国产三级国产有无不卡| 久久日韩粉嫩一区二区三区 | www..com久久爱| 国产伦精品一区二区三区视频青涩 | 在线观看欧美黄色| 色哟哟欧美精品| 91浏览器在线视频| 91精品福利在线| 日本丰满少妇一区二区三区| 99久久精品免费精品国产| 懂色av中文一区二区三区| 韩国一区二区在线观看| 久久精品国产第一区二区三区| 男男成人高潮片免费网站| 日韩国产精品久久久| 免费不卡在线视频| 看电影不卡的网站| 国产又黄又大久久| 国产盗摄精品一区二区三区在线| 国产综合色产在线精品| 国产成人免费视频一区| www.亚洲色图| 91麻豆6部合集magnet| 欧美日韩一级大片网址| 欧美一区二区三区四区高清| 日韩欧美国产高清| 国产亚洲精品aa午夜观看| 国产精品动漫网站| 亚洲国产一二三| 日韩av二区在线播放| 国产一区二区精品久久99| eeuss鲁片一区二区三区在线看| 91看片淫黄大片一级在线观看| 欧美日韩一级二级| 精品国精品自拍自在线| 亚洲欧洲日本在线| 午夜不卡av在线| 国产激情视频一区二区在线观看| 不卡的av电影在线观看| 欧美绝品在线观看成人午夜影视| 精品福利视频一区二区三区| 亚洲欧美影音先锋| 日韩av电影天堂| av成人动漫在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 成人国产精品免费网站| 欧美另类一区二区三区| 欧美国产精品中文字幕| 日日夜夜一区二区| 91蜜桃在线观看| www国产成人| 亚洲va欧美va国产va天堂影院| 国产福利一区二区三区视频在线| 在线观看视频一区二区 | 6080日韩午夜伦伦午夜伦| 欧美激情中文字幕|