⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projectionsupport.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/event/ProjectionSupport.java,v $// $RCSfile: ProjectionSupport.java,v $// $Revision: 1.4.2.3 $// $Date: 2005/08/09 17:38:50 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.event;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.Debug;import java.util.Iterator;/** * This is a utility class that can be used by beans that need support * for handling ProjectionListeners and firing ProjectionEvents. You * can use an instance of this class as a member field of your bean * and delegate work to it. */public class ProjectionSupport extends ListenerSupport {    /**     * Construct a ProjectionSupport.     */    public ProjectionSupport() {        this(null);    }    /**     * Construct a ProjectionSupport.     *      * @param aSource source Object     */    public ProjectionSupport(Object aSource) {        super(aSource);    }    /**     * Add a ProjectionListener.     *      * @param l ProjectionListener     */    public void addProjectionListener(ProjectionListener l) {        addListener(l);    }    /**     * Remove a ProjectionListener.     *      * @param l ProjectionListener     */    public void removeProjectionListener(ProjectionListener l) {        removeListener(l);    }    /**     * Send a center event to all registered listeners.     *      * @param proj Projection     */    public void fireProjectionChanged(Projection proj) {        if (size() == 0)            return;        ProjectionEvent evt = new ProjectionEvent(getSource(), proj);        ProjectionChangedRunnable pcr = new ProjectionChangedRunnable(evt);        new Thread(pcr).start();    }    /**     * A Runnable class that disperses the projection, instead of     * letting the Swing thread do it. A new one is created for every     * projection change, so the current ProjectionEvent object is     * getting delivered with it.     */    protected class ProjectionChangedRunnable implements Runnable {        protected ProjectionEvent projEvent;        public ProjectionChangedRunnable(ProjectionEvent pe) {            projEvent = pe;        }        public void run() {            ProjectionListener target = null;            Iterator it = iterator();            while (it.hasNext()) {                target = (ProjectionListener) it.next();                if (Debug.debugging("mapbean")) {                    Debug.output("ProjectionChangeRunnable: firing projection change, target is: "                            + target);                }                target.projectionChanged(projEvent);            }        }    };}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -