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

📄 mifpoint.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/layer/mif/MIFPoint.java,v $// $RCSfile: MIFPoint.java,v $// $Revision: 1.2.2.2 $// $Date: 2005/08/11 21:03:25 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.mif;import java.awt.Graphics;import com.bbn.openmap.omGraphics.OMPoint;import com.bbn.openmap.proj.Projection;/** * Extension of OMPoint to provide basic support to ensure that the * screen will not become cluttered This extension of OMPoint defines * a property visibleScale. visibleScale is the OpenMap maximum scale * at which the point will be rendered all scale values after the * visibleScale value will result in the point to be rendered. * <P> *  * if visible scale is set to -1 the point will be rendered all all * scale levels. *  * @author Simon Bowen */public class MIFPoint extends OMPoint implements MIFGraphic,        java.io.Serializable {    /**     * default visibleScale value is -1     */    private float visibleScale = -1;    private boolean renderPoint = true;    /**     * @param lat the latitude to display the text string     * @param lon the longitude to display the text string     * @param visibleScale if visible scale is set to -1 the text will     *        be rendered all all scale levels.     */    public MIFPoint(float lat, float lon, float visibleScale) {        super(lat, lon);        this.visibleScale = visibleScale;    }    /**     * sets the scale at which the graphic becomes visible, if set to     * -1 the graphic is viaible at all scale levels.     *      * @param visibleScale     */    public void setVisibleScale(float visibleScale) {        this.visibleScale = visibleScale;    }    public float getVisibleScale() {        return this.visibleScale;    }    /**     * Overriden from OMPoint so that we can handle a flag     * <code>renderPoint</code> to signal to the render method if     * the scale is appropiate to render the point or not.     */    public synchronized boolean generate(Projection proj) {        if ((proj.getScale() <= getVisibleScale()) || (getVisibleScale() == -1)) {            this.renderPoint = true;        } else {            this.renderPoint = false;        }        return super.generate(proj);    }    /**     * Overriden from OMPoint so that we can handle a flag     * <code>renderPoint</code> to determine if the point should be     * rendered or not.     */    public synchronized void render(Graphics g) {        if (renderPoint) {            super.render(g);        }    }}/** Last line of file * */

⌨️ 快捷键说明

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