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

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

?? projectionstack.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/proj/ProjectionStack.java,v $// $RCSfile: ProjectionStack.java,v $// $Revision: 1.3.2.2 $// $Date: 2004/10/14 18:27:38 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.proj;import java.awt.Container;import java.awt.Point;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.Stack;import com.bbn.openmap.LatLonPoint;import com.bbn.openmap.MapBean;import com.bbn.openmap.OMComponent;import com.bbn.openmap.event.ProjectionEvent;import com.bbn.openmap.event.ProjectionListener;import com.bbn.openmap.util.Debug;/** *  Provides Projection Stack, to listen for projection changes and *  remember them as they pass by.  As a Tool, it provides a GUI so *  that past projections can be retrieved, and, if a past projection *  is being displayed, a forward projection stack is activated to *  provide a path to get to the last projection set in the MapBean. *  ProjectionStackTriggers should hook themselves up to the *  ProjectionStack.  The ProjectionStack is responsible for finding *  and connecting to the MapBean. */public class ProjectionStack extends OMComponent    implements ActionListener, ProjectionListener {    public final static int DEFAULT_MAX_SIZE = 10;    public final static int REMEMBER_ALL = -1;    /**     * The currentProjection should be the top item on the backStack.     */    protected transient ProjHolder currentProjection;    protected transient String currentProjectionID;    protected transient Container face;    protected transient MapBean mapBean;    protected int stackSize = DEFAULT_MAX_SIZE;    public final static transient String BackProjCmd = "backProjection";    public final static transient String ForwardProjCmd = "forwardProjection";    public final static transient String ClearBackStackCmd = "clearBackStack";    public final static transient String ClearForwardStackCmd = "clearForwardStack";    public final static transient String ClearStacksCmd = "clearStacks";    protected Stack backStack;    protected Stack forwardStack;    protected ProjectionStackSupport triggers;    /**     * Create the projection submenu.     */    public ProjectionStack() {}    public void setMapBean(MapBean map) {        if (mapBean != null) {            mapBean.removeProjectionListener(this);        }        if (map != null) {            map.addProjectionListener(this);        }        mapBean = map;    }    public MapBean getMapBean() {        return mapBean;    }    public void actionPerformed(ActionEvent ae) {        String command = ae.getActionCommand().intern();                Debug.message("projectionstack",                       "ProjectionStack.actionPerformed(): " + command);        boolean changeProjection = false;        //  This is important.  We need to set the current projection        //  before setting the projection in the MapBean.  That way,        //  the projectionChanged method actions won't get fired        if (command == BackProjCmd &&             backStack != null &&             backStack.size() > 1) {            pop();            currentProjection = (ProjHolder)backStack.peek();            changeProjection = true;        } else if (command == ForwardProjCmd &&                   forwardStack != null &&                    !forwardStack.empty()) {                        currentProjection = backPop();            changeProjection = true;        } else {            clearStacks((command == ClearBackStackCmd || command == ClearStacksCmd),                        (command == ClearForwardStackCmd || command == ClearStacksCmd));            // fireStackStatus is called in clearStacks        }        if (changeProjection && mapBean != null) {            if (Debug.debugging("projectionstack")) {                Debug.output("ProjectionStack.actionPerformed() changing mapbean projection to : " + currentProjection);            }            Projection currProj =                 currentProjection.create(mapBean.getWidth(),                                         mapBean.getHeight());            mapBean.setProjection(currProj);            fireStackStatus();        }    }      //------------------------------------------------------------    // ProjectionListener interface    //------------------------------------------------------------        /**     * The Map projection has changed.      * @param e ProjectionEvent     */    public void projectionChanged(ProjectionEvent e) {        if (Debug.debugging("projectionstack")) {            System.out.println("ProjectionStack.projectionChanged()");        }        Projection newProj = e.getProjection();        // If the ProjectionStack doesn't already know about the        // projection change, that means that it didn't instigate it,        // and the new projection needs to get added to the stack,        // with the forwardStack cleared.        if (currentProjection == null || !currentProjection.equals(newProj)) {            Debug.message("projectionstack", "ProjectionStack.projectionChanged() pushing projection on backStack");            // push on the backStack, clear the forwardStack;            currentProjection = push(new ProjHolder(newProj));            if (forwardStack != null) {                forwardStack.clear();            }            fireStackStatus();        } else {            Debug.message("projectionstack", "ProjectionStack.projectionChanged() new projection matches current projection, no action.");        }    }        /**     * Clear out the chosen projection stacks and fire an event to     * update the triggers on stack status.     * @param clearBackStack clear out the backward projection stack.     * @param clearForwardStack clear out the forward projection stack.     */    public synchronized void clearStacks(boolean clearBackStack,                                          boolean clearForwardStack) {        if (clearBackStack && backStack != null) {            ProjHolder currentProj = pop(); // current projection            backStack.clear();            push(currentProj);        }        if (clearForwardStack && forwardStack != null) {            forwardStack.clear();        }        fireStackStatus();    }    /**     * Take a ProjHolder off the backStack, and push it on the forward     * stack.     * @return the ProjHolder pushed onto the forwardStack.      */    protected synchronized ProjHolder pop() {        ProjHolder proj = (ProjHolder)backStack.pop();        if (forwardStack == null) {            forwardStack = new Stack();        }        while (forwardStack.size() >= stackSize) {            forwardStack.removeElementAt(0);        }        forwardStack.push(proj);        return proj;    }    /**     * Take a ProjHolder off the forwardStack, and push it on the backStack.     * @return the ProjHolder pushed on the backStack.     */    protected synchronized ProjHolder backPop() {        ProjHolder proj = (ProjHolder)forwardStack.pop();        // This has almost no chance of happening...        if (backStack == null) {            backStack = new Stack();        }        while (backStack.size() >= stackSize) {            backStack.removeElementAt(0);        }        backStack.push(proj);        return proj;    }        /**     * Put a new ProjHolder on the backStack, to remember for later in     * case we need to back up.     * @param proj ProjHolder.     * @return the ProjHolder pushed on the backStack.     */    protected synchronized ProjHolder push(ProjHolder proj) {        if (backStack == null) {            backStack = new Stack();        }        if (backStack.size() >= stackSize) {            backStack.removeElementAt(0);        }        return (ProjHolder)backStack.push(proj);    }    public void fireStackStatus() {        fireStackStatus((backStack != null && backStack.size() > 1),                        (forwardStack != null && !forwardStack.empty()));    }    public void fireStackStatus(boolean enableBackButton,                                 boolean enableForwardButton) {        if (triggers != null) {            if (Debug.debugging("projectionstack")) {                Debug.output("ProjectionStack.fireStackStatus(" +                              enableBackButton +                             ", " + enableForwardButton + ")");            }            triggers.fireStackStatus(enableBackButton, enableForwardButton);        }    }    /**     * ProjectionStackTriggers should call this method, and all will be well.     */    public void addProjectionStackTrigger(ProjectionStackTrigger trigger) {        trigger.addActionListener(this);        if (triggers == null) {            triggers = new ProjectionStackSupport();        }        triggers.add(trigger);        trigger.updateProjectionStackStatus((backStack != null && backStack.size() > 1), (forwardStack != null && !forwardStack.empty()));    }    /**     * ProjectionStackTriggers should call this method, and all will be well.     */    public void removeProjectionStackTrigger(ProjectionStackTrigger trigger) {        trigger.removeActionListener(this);        if (triggers != null) {            triggers.remove(trigger);            if (triggers.size() == 0) {                triggers = null;            }        }    }    //------------------------------------------------------------    // BeanContextMembershipListener and BeanContextChild interface    //------------------------------------------------------------    /**     * Look at the object received in a MapHandler status message and     * disconnect from it if necessary.       */    public void findAndUndo(Object someObj) {        if (someObj instanceof com.bbn.openmap.MapBean) {            Debug.message("projectionstack","ProjectionStack removing a MapBean.");            MapBean map = getMapBean();            if (map != null && map == (MapBean)someObj) {                setMapBean(null);            }        }    }      /**     * Look at the object received in a MapHandler status message and     * connect to it if necessary.       */    public void findAndInit(Object someObj) {        if (someObj instanceof com.bbn.openmap.MapBean) {            Debug.message("projectionstack","ProjectionStack found a MapBean.");            setMapBean((MapBean)someObj);        }    }    public class ProjHolder {        public Class projClass;        public float scale;        public LatLonPoint center;        protected Point tmpPoint1;        protected Point tmpPoint2;        public ProjHolder(Projection proj) {            projClass = proj.getClass();            scale = proj.getScale();            center = proj.getCenter();        }        public boolean equals(Projection proj) {            // For some reason, the ProjectionFactory can mess up the            // center lat/lons, so that the center isn't EXACTLY what            // they were when the projection was created.  It's almost            // like it decides what map it can draw, and then figures            // out what the coordinate of the center pixel of the            // projection it created was.  Doing this projection hack            // seems to accurately determine what projections are            // acutally identical visually, which is what you want to            // know anyway.            Point tmpPoint1 = proj.forward(proj.getCenter());            Point tmpPoint2 = proj.forward(center);            boolean same = (projClass == proj.getClass() &&                            scale == proj.getScale() &&                            // NOT GOOD ENOUGH!  Sometimes, the                            // slighest difference causes a false                            // false.//                          MoreMath.approximately_equal(center.getLatitude(), //                                                       proj.getCenter().getLatitude(), //                                                       .00001f) &&//                          MoreMath.approximately_equal(center.getLongitude(), //                                                       proj.getCenter().getLongitude(), //                                                       .00001f)                            // This seems to work...                            tmpPoint1.x == tmpPoint2.x && tmpPoint1.y == tmpPoint2.y                            );            return same;        }        public Projection create(int width, int height) {            return ProjectionFactory.makeProjection(projClass,                                                     center.getLatitude(),                                                    center.getLongitude(),                                                    scale, width, height);        }        public String toString() {            return ("[ProjHolder: class(" + projClass.getName() + "), scale(" +                    scale + "), center(" + center + ")]");        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线精品一区二区不卡了| 一区二区三区在线观看动漫| 91麻豆精品久久久久蜜臀| 99re这里只有精品6| va亚洲va日韩不卡在线观看| 成人高清视频在线观看| 99免费精品在线| 91视频.com| 欧洲亚洲国产日韩| 欧美日韩国产美女| 欧美一区二区三区视频在线| 精品成人一区二区| 国产亚洲成av人在线观看导航| ww亚洲ww在线观看国产| 国产亚洲精品aa| 亚洲欧洲中文日韩久久av乱码| 亚洲丝袜自拍清纯另类| 一区二区三区四区不卡在线 | 欧美一区二区精品| 久久亚洲精品小早川怜子| 日本一区二区三区国色天香| 国产精品免费丝袜| 亚洲不卡一区二区三区| 麻豆精品在线观看| 成人网页在线观看| 欧美亚洲一区三区| ...av二区三区久久精品| 中文字幕日韩一区| 精品国产欧美一区二区| 国产精品网站在线观看| 亚洲国产乱码最新视频 | 日本欧美在线看| 国产一区二区电影| 在线欧美一区二区| 精品国产91洋老外米糕| 综合久久久久综合| 久久综合综合久久综合| 99精品久久久久久| 91精品国产综合久久香蕉麻豆| 欧美精品一区二区不卡 | 欧美日本一道本| 国产喂奶挤奶一区二区三区| 亚洲一区中文日韩| 豆国产96在线|亚洲| 国产精品沙发午睡系列990531| 午夜精品免费在线| eeuss影院一区二区三区| 欧美一区二区三区在线视频| 亚洲欧美怡红院| 国产精品中文字幕日韩精品| 欧美精品亚洲二区| 亚洲人成人一区二区在线观看| 激情五月激情综合网| 欧美性受xxxx| 亚洲精品一卡二卡| www.久久精品| 久久一区二区三区四区| 五月综合激情婷婷六月色窝| www.成人在线| 国产精品第四页| 国产精品一级在线| 精品国产一区二区三区忘忧草| 午夜av一区二区三区| 一本大道av伊人久久综合| 国产欧美日本一区二区三区| 日本欧美大码aⅴ在线播放| 欧美特级限制片免费在线观看| 中文字幕视频一区| fc2成人免费人成在线观看播放| 精品国产一区二区精华| 蜜臀av亚洲一区中文字幕| 欧美精品视频www在线观看| 亚洲va在线va天堂| 欧美日韩日日夜夜| 亚洲成人在线免费| 欧美日韩精品电影| 日韩精品亚洲一区二区三区免费| 日本韩国一区二区三区视频| 亚洲欧美日韩国产综合| 一本色道**综合亚洲精品蜜桃冫| 日韩美女久久久| 色综合天天综合网天天看片| 久久免费电影网| 国精产品一区一区三区mba视频 | 亚洲欧美偷拍三级| 色偷偷88欧美精品久久久| 亚洲伦理在线精品| 欧美在线|欧美| 日本不卡一区二区三区高清视频| 欧美一区二区在线免费播放| 久久99精品久久久久婷婷| 日韩欧美电影一区| 懂色av中文字幕一区二区三区| 国产精品美女久久久久高潮| 一本在线高清不卡dvd| 日日噜噜夜夜狠狠视频欧美人| 欧美大黄免费观看| 成人黄色777网| 一个色在线综合| 欧美成人女星排名| eeuss鲁一区二区三区| 首页综合国产亚洲丝袜| 久久午夜老司机| 色狠狠综合天天综合综合| 日本女优在线视频一区二区| 国产精品无人区| 欧美人伦禁忌dvd放荡欲情| 激情伊人五月天久久综合| 亚洲婷婷在线视频| 日韩三级在线免费观看| www.日韩大片| 天天色天天爱天天射综合| 欧美激情综合网| 91精品国产色综合久久不卡蜜臀| 国产精品1区二区.| 天堂影院一区二区| 国产精品区一区二区三区| 7777精品伊人久久久大香线蕉的 | 欧美在线一区二区| 国模冰冰炮一区二区| 亚洲国产日产av| 中文字幕乱码亚洲精品一区| 欧美日韩免费一区二区三区| 国产成a人亚洲精品| 日韩电影网1区2区| 亚洲男人的天堂网| 欧美激情在线一区二区三区| 91精品欧美一区二区三区综合在 | 午夜精品久久久久久久久久久| 国产日韩欧美a| 日韩欧美成人午夜| 欧美性受xxxx| 日本大香伊一区二区三区| 国产v日产∨综合v精品视频| 日本欧美韩国一区三区| 丝袜亚洲另类欧美综合| 亚洲综合在线观看视频| 一区精品在线播放| 国产欧美日韩综合| www亚洲一区| 日韩欧美国产午夜精品| 欧美男生操女生| 欧美色倩网站大全免费| 91在线精品一区二区三区| 成人午夜视频网站| 成人性视频免费网站| 国产河南妇女毛片精品久久久| 青青青爽久久午夜综合久久午夜| 亚洲成人动漫在线免费观看| 亚洲综合无码一区二区| 亚洲影院久久精品| 午夜精品久久久| 天堂成人免费av电影一区| 天天av天天翘天天综合网 | 午夜久久久久久| 亚洲观看高清完整版在线观看| 自拍视频在线观看一区二区| 亚洲人成小说网站色在线| 亚洲欧美日韩久久精品| 亚洲国产婷婷综合在线精品| 亚洲国产一区二区视频| 婷婷中文字幕综合| 麻豆视频观看网址久久| 国产精品一线二线三线精华| 粉嫩在线一区二区三区视频| 成人av电影在线播放| 日本黄色一区二区| 91精品综合久久久久久| 久久综合九色综合97婷婷女人| 国产欧美视频在线观看| 亚洲天堂成人在线观看| 五月天激情小说综合| 精油按摩中文字幕久久| 成人av免费在线观看| 欧美天天综合网| 欧美成人在线直播| 国产精品国产三级国产普通话三级 | 日韩电影免费在线看| 国产麻豆精品一区二区| 91麻豆精品秘密| 欧美一区二区三区四区高清| 久久精品夜夜夜夜久久| 成人免费小视频| 日韩高清不卡一区| 福利一区福利二区| 欧美日韩精品欧美日韩精品一综合| 欧美一级淫片007| 亚洲嫩草精品久久| 国产永久精品大片wwwapp | 日韩福利电影在线| www.99精品| 欧美成人女星排名| 亚洲精品videosex极品| 国内精品第一页| 欧美日本韩国一区二区三区视频| 久久久影院官网| 日韩国产欧美三级| 在线亚洲免费视频| 国产日韩欧美精品一区| 日韩精品亚洲专区|