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

📄 zoomevent.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/ZoomEvent.java,v $// $RCSfile: ZoomEvent.java,v $// $Revision: 1.2.2.2 $// $Date: 2005/08/09 17:38:50 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.event;/** * An event to request that the map zoom in or out. Event specifies * the type and amount of zoom of the map. */public class ZoomEvent extends java.util.EventObject implements        java.io.Serializable {    /**     * Type that specifies that the amount should be used as a multiplier to the     * current scale.     */    public transient static final int RELATIVE = 301;    /**     * Type that specifies that the amount should be used as the new scale.     */    public transient static final int ABSOLUTE = 302;    /**     * The type of zooming.     */    protected int type;    /**     * The zoom factor.     */    protected float amount;    /**     * Construct a ZoomEvent.     *      * @param source the creator of the ZoomEvent.     * @param type the type of the event, refering to how to use the     *        amount.     * @param amount the value of the ZoomEvent.     */    public ZoomEvent(Object source, int type, float amount) {        super(source);        switch (type) {        case RELATIVE:        case ABSOLUTE:            break;        default:            throw new IllegalArgumentException("Invalid type: " + type);        }        this.type = type;        this.amount = amount;    }    /**     * Check if the type is RELATIVE.     *      * @return boolean     */    public boolean isRelative() {        return (type == RELATIVE);    }    /**     * Check if the type is ABSOLUTE.     *      * @return boolean     */    public boolean isAbsolute() {        return (type == ABSOLUTE);    }    /**     * Get the amount of zoom.     *      * @return float     */    public float getAmount() {        return amount;    }    /**     * Stringify the object.     *      * @return String     */    public String toString() {        return "#<ZoomEvent " + (isRelative() ? "Relative " : "")                + (isAbsolute() ? "Absolute " : "") + amount + ">";    }}

⌨️ 快捷键说明

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