?? zoomevent.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 + -