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

📄 rpfcoverage.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
// **********************************************************************// // <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/rpf/RpfCoverage.java,v $// $RCSfile: RpfCoverage.java,v $// $Revision: 1.4.2.3 $// $Date: 2005/02/11 22:51:25 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.rpf;/*  Java Core  */import java.awt.Color;import java.awt.Component;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.Properties;import java.util.Vector;import javax.swing.Box;import javax.swing.BoxLayout;import javax.swing.JCheckBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.ScrollPaneConstants;import com.bbn.openmap.Environment;import com.bbn.openmap.I18n;import com.bbn.openmap.Layer;import com.bbn.openmap.PropertyConsumer;import com.bbn.openmap.omGraphics.OMGraphicList;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.ColorFactory;import com.bbn.openmap.util.Debug;import com.bbn.openmap.util.PropUtils;/** * This is a tool that provides coverage information on the Rpf data. * It is supposed to be a simple tool that lets you see the general * location of data, to guide you to the right place and scale of * coverage. The layer really uses the properties passed in to it to * determine which RPF/A.TOC should be scanned for the data. There is * a palette for this layer, that lets you turn off the coverage for * different levels of Rpf. Right now, only City Graphics, TLM, JOG, * TPC, ONC, JNC, GNC and 5/10 meter CIB scales are are handled. All * other scales are tossed together under the misc setting. The City * Graphics setting shows all charts for scales greater than than * 1:15k. * <P> *  * <pre> *  *   *    *     *      *       *       The properties for this file are: *        # Java Rpf properties *        # Number between 0-255: 0 is transparent, 255 is opaque *        jrpf.coverageOpaque=255 *        #Default is true, don't need this entry if you like it... *        jrpf.CG.showcov=true *        #Default colors don't need this entry *        jrpf.CG.color=CE4F3F *        # Other types can be substituted for CG (TLM, JOG, TPC, ONC, JNC, GNC, CIB10, CIB5, MISC) *        # Fill the rectangle, default is true *        jrpf.coverageFill=true *        *        *       *      *     *    *   * </pre> */public class RpfCoverage implements ActionListener, RpfConstants,        PropertyConsumer {    /** The graphic list of objects to draw. */    protected Vector omGraphics;    /**     * Set when the projection has changed while a swing worker is     * gathering graphics, and we want him to stop early.     */    protected boolean cancelled = false;    protected RpfCoverageManager coverageManager = null;    protected String propertyPrefix = null;    /**     * Flag to tell the cache to return the coverage for city     * graphics.     */    protected boolean showCG = true;    /** Flag to tell the cache to return the coverage for tlm. */    protected boolean showTLM = true;    /** Flag to tell the cache to return the coverage for jog. */    protected boolean showJOG = true;    /** Flag to tell the cache to return the coverage for jog. */    protected boolean showTPC = true;    /** Flag to tell the cache to return the coverage for jog. */    protected boolean showONC = true;    /** Flag to tell the cache to return the coverage for jog. */    protected boolean showJNC = true;    /** Flag to tell the cache to return the coverage for jog. */    protected boolean showGNC = true;    /** Flag to tell the cache to return the coverage for 10M CIB. */    protected boolean showCIB10 = true;    /** Flag to tell the cache to return the coverage for 5M CIB. */    protected boolean showCIB5 = true;    /** Flag to tell the cache to return the coverage for others. */    protected boolean showMISC = true;    /** The default color int value. */    public final static int defaultCGColorInt = 0xAC4853;    /** The default color int value. */    public final static int defaultTLMColorInt = 0xCE4F3F;    /** The default color int value. */    public final static int defaultJOGColorInt = 0xAC7D74;    /** The default color int value. */    public final static int defaultTPCColorInt = 0xACCD10;    /** The default color int value. */    public final static int defaultONCColorInt = 0xFCCDE5;    /** The default color int value. */    public final static int defaultJNCColorInt = 0x7386E5;    /** The default color int value. */    public final static int defaultGNCColorInt = 0x55866B;    /** The default color int value. */    public final static int defaultCIB10ColorInt = 0x07516B;    /** The default color int value. */    public final static int defaultCIB5ColorInt = 0x071CE0;    /** The default color int value. */    public final static int defaultMISCColorInt = 0xF2C921;    /** The color to outline the shapes. */    protected Color CGColor = new Color(defaultCGColorInt);    /** The color to outline the shapes. */    protected Color TLMColor = new Color(defaultTLMColorInt);    /** The color to outline the shapes. */    protected Color JOGColor = new Color(defaultJOGColorInt);    /** The color to outline the shapes. */    protected Color TPCColor = new Color(defaultTPCColorInt);    /** The color to outline the shapes. */    protected Color ONCColor = new Color(defaultONCColorInt);    /** The color to outline the shapes. */    protected Color JNCColor = new Color(defaultJNCColorInt);    /** The color to outline the shapes. */    protected Color GNCColor = new Color(defaultGNCColorInt);    /** The color to outline the shapes. */    protected Color CIB10Color = new Color(defaultCIB10ColorInt);    /** The color to outline the shapes. */    protected Color CIB5Color = new Color(defaultCIB5ColorInt);    /** The color to outline the shapes. */    protected Color MISCColor = new Color(defaultMISCColorInt);    /**     * A setting for how transparent to make the images. The default     * is 255, which is totally opaque. Not used right now.     */    protected int opaqueness = RpfColortable.DEFAULT_OPAQUENESS;    /** Flag to fill the coverage rectangles. */    protected boolean fillRects;    /** Property to use for filled rectangles (when java supports it). */    public static final String CoverageOpaquenessProperty = "coverageOpaque";    /** Property to use to fill rectangles. */    public static final String FillProperty = "coverageFill";    /** The parent layer. */    protected Layer layer;    /** Flag to track when the RpfCoverage is active. */    protected boolean inUse = false;    /**     * Show the palette when showing coverage. Probably not needed for     * layers limiting chart seriestypes for display.     */    protected boolean showPalette = true;    protected I18n i18n = Environment.getI18n();    /**     * The default constructor for the Layer. All of the attributes     * are set to their default values.     */    public RpfCoverage(Layer l) {        layer = l;    }    /** Method that sets all the variables to the default values. */    protected void setDefaultValues() {        allCoveragesOn();        opaqueness = RpfColortable.DEFAULT_OPAQUENESS;        fillRects = true;    }    public boolean isInUse() {        return inUse;    }    public void setInUse(boolean iu) {        inUse = iu;        if (showPalette || !inUse) {            // Always want it hidden if not in use.            getPaletteWindow().setVisible(inUse);        }    }    public boolean isShowPalette() {        return showPalette;    }    public void setShowPalette(boolean sp) {        showPalette = sp;        if (!showPalette) {            allCoveragesOn();        }    }    public void allCoveragesOn() {        showCG = true;        showTLM = true;        showJOG = true;        showTPC = true;        showONC = true;        showJNC = true;        showGNC = true;        showCIB10 = true;        showCIB5 = true;        showMISC = true;    }    public void setProperties(java.util.Properties props) {        setProperties(null, props);    }    /**     * Set all the Rpf properties from a properties object.     *      * @param prefix string prefix used in the properties file for     *        this layer.     * @param properties the properties set in the properties file.     */    public void setProperties(String prefix, java.util.Properties properties) {        setPropertyPrefix(prefix);        setDefaultValues();        prefix = PropUtils.getScopedPropertyPrefix(prefix);        fillRects = PropUtils.booleanFromProperties(properties, prefix                + FillProperty, fillRects);        showPalette = PropUtils.booleanFromProperties(properties, prefix                + CoverageProperty, showPalette);        opaqueness = PropUtils.intFromProperties(properties, prefix                + CoverageOpaquenessProperty, opaqueness);        CGColor = (Color) PropUtils.parseColorFromProperties(properties, prefix                + CGColorProperty, CGColor);        TLMColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + TLMColorProperty,                TLMColor);        JOGColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + JOGColorProperty,                JOGColor);        TPCColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + TPCColorProperty,                TPCColor);        ONCColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + ONCColorProperty,                ONCColor);        JNCColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + JNCColorProperty,                JNCColor);        GNCColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + GNCColorProperty,                GNCColor);        CIB10Color = (Color) PropUtils.parseColorFromProperties(properties,                prefix + CIB10ColorProperty,                CIB10Color);        CIB5Color = (Color) PropUtils.parseColorFromProperties(properties,                prefix + CIB5ColorProperty,                CIB5Color);        MISCColor = (Color) PropUtils.parseColorFromProperties(properties,                prefix + MISCColorProperty,                MISCColor);        // If the palette is turned off, then we all of them have been        // set to true. Only the coverage of the limited series will        // be asked for.        if (showPalette) {            showCG = PropUtils.booleanFromProperties(properties, prefix

⌨️ 快捷键说明

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