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

📄 rpflayer.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        } else {            props.put(prefix + RpfPathsProperty, "");        }        props.put(prefix + KillCacheProperty, new Boolean(killCache).toString());        props.put(prefix + CacheSizeProperty,                Integer.toString(subframeCacheSize));        props.put(prefix + AuxCacheSizeProperty,                Integer.toString(auxSubframeCacheSize));        viewAttributes.setPropertyPrefix(prefix);        viewAttributes.getProperties(props);        if (coverage == null) {            RpfCoverage cov = new RpfCoverage(this);            cov.setProperties(prefix, new Properties());            cov.getProperties(props);        } else {            coverage.getProperties(props);        }        return props;    }    /**     * Method to fill in a Properties object with values reflecting     * the properties able to be set on this PropertyConsumer. The key     * for each property should be the raw property name (without a     * prefix) with a value that is a String that describes what the     * property key represents, along with any other information about     * the property that would be helpful (range, default value,     * etc.). For Layer, this method should at least return the     * 'prettyName' property.     *      * @param list a Properties object to load the PropertyConsumer     *        properties into. If getList equals null, then a new     *        Properties object should be created.     * @return Properties object containing PropertyConsumer property     *         values. If getList was not null, this should equal     *         getList. Otherwise, it should be the Properties object     *         created by the PropertyConsumer.     */    public Properties getPropertyInfo(Properties list) {        list = super.getPropertyInfo(list);        String interString;        interString = i18n.get(RpfLayer.class,                RpfPathsProperty,                I18n.TOOLTIP,                "Paths to RPF directories.  Semi-colon separated paths.");        list.put(RpfPathsProperty, interString);        list.put(RpfPathsProperty + ScopedEditorProperty,                "com.bbn.openmap.util.propertyEditor.MultiDirectoryPropertyEditor");        interString = i18n.get(RpfLayer.class, RpfPathsProperty, "Data Path");        list.put(RpfPathsProperty + LabelEditorProperty, interString);        interString = i18n.get(RpfLayer.class,                KillCacheProperty,                I18n.TOOLTIP,                "Flag to trigger the cache to be cleared when layer is removed from the map.");        list.put(KillCacheProperty, interString);        list.put(KillCacheProperty + ScopedEditorProperty,                "com.bbn.openmap.util.propertyEditor.OnOffPropertyEditor");        interString = i18n.get(RpfLayer.class, KillCacheProperty, "Clear Cache");        list.put(KillCacheProperty + LabelEditorProperty, interString);        interString = i18n.get(RpfLayer.class,                CacheSizeProperty,                I18n.TOOLTIP,                "Number of frames to hold in the frame cache.");        list.put(CacheSizeProperty, interString);        interString = i18n.get(RpfLayer.class,                CacheSizeProperty,                "Frame Cache Size");        list.put(CacheSizeProperty + LabelEditorProperty, interString);        interString = i18n.get(RpfLayer.class,                AuxCacheSizeProperty,                I18n.TOOLTIP,                "Number of frames to hold in aux. frame caches.");        list.put(AuxCacheSizeProperty, interString);        interString = i18n.get(RpfLayer.class,                AuxCacheSizeProperty,                "Aux Frame Cache Size");        list.put(AuxCacheSizeProperty + LabelEditorProperty, interString);        viewAttributes.getPropertyInfo(list);        RpfCoverage tmpCov = coverage;        if (tmpCov == null) {            tmpCov = new RpfCoverage(this);        }        tmpCov.getPropertyInfo(list);        list.put(initPropertiesProperty, RpfPathsProperty + " "                + KillCacheProperty + " " + CacheSizeProperty + " "                + AuxCacheSizeProperty + " "                + viewAttributes.getInitPropertiesOrder() + " "                + AddToBeanContextProperty + " " + AddAsBackgroundProperty                + " " + RemovableProperty + " " + CoverageProperty + " "                + tmpCov.getInitPropertiesOrder());        return list;    }    public void resetPalette() {        box = null;        if (coverage != null) {            if (coverage.isInUse()) {                coverage.resetColors();            }        }        super.resetPalette();    }    /**     * Sets the current graphics list to the given list.     *      * @param aList a list of OMGraphics.     */    public synchronized void setGraphicList(OMGraphicList aList) {        setList(aList);    }    /** Retrieves the current graphics list. */    public synchronized OMGraphicList getGraphicList() {        return getList();    }    /**     * Clear the frame cache.     */    public void clearCache() {        if (frameProvider instanceof CacheHandler) {            ((CacheHandler) frameProvider).resetCache();        }        if (this.cache != null) {            this.cache.setViewAttributes(null);            this.cache.setFrameProvider(null);            this.cache.clearCaches();        }        frameProvider = null;        setGraphicList(null);        this.cache = null;    }    /**     * Set the view attributes for the layer. The frame provider view     * attributes are updated, and the cache is cleared.     *      * @param rva the RpfViewAttributes used for the layer.     */    public void setViewAttributes(RpfViewAttributes rva) {        viewAttributes = rva;        if (this.cache != null) {            this.cache.setViewAttributes(rva);        }    }    /**     * Get the view attributes or the layer.     *      * @return RpfViewAttributes.     */    public RpfViewAttributes getViewAttributes() {        return viewAttributes;    }    /**     * Set the RpfCoverage tool used by the layer. If the view     * attributes chart series setting is not equal to     * RpfViewAttributes.ANY, then the palette of the tool is not     * shown.     *      * @param cov the RpfCoverage tool.     */    public void setCoverage(RpfCoverage cov) {        coverage = cov;        if (viewAttributes != null                && coverage != null                && !viewAttributes.chartSeries.equalsIgnoreCase(RpfViewAttributes.ANY)) {            coverage.setShowPalette(false);        }    }    /**     * Return the coverage tool used by the layer.     *      * @return RpfCoverage tool.     */    public RpfCoverage getCoverage() {        return coverage;    }    /**     * Set the RpfFrameProvider for the layer. Clears out the cache,     * and the frame provider gets the RpfViewAttributes held by the     * layer.     *      * @param fp the frame provider.     */    public void setFrameProvider(RpfFrameProvider fp) {        frameProvider = fp;        if (this.cache != null) {            this.cache.setFrameProvider(frameProvider);        }    }    /**     * Return RpfFrameProvider used by the layer.     */    public RpfFrameProvider getFrameProvider() {        return frameProvider;    }    /**     * Returns the Vector containing RpfCoverageBoxes that was     * returned from the RpfFrameProvider as a result of the last     * setCache call. These provide rudimentary knowledge about what     * is being displayed. This vector is from the primary cache     * handler.     *      * @return Vector of RpfCoverageBoxes.     */    public Vector getCoverageBoxes() {        return this.cache.getCoverageBoxes();    }    /**     * The projectionListener interface method that lets the Layer     * know when the projection has changes, and therefore new     * graphics have to created /supplied for the screen.     *      * @param e The projection event, most likely fired from a map     *        bean.     */    public void projectionChanged(ProjectionEvent e) {        projectionChanged(e, false);    }    /**     * Called from projectionListener interface method that lets the     * Layer know when the projection has changes, and therefore new     * graphics have to created /supplied for the screen.     *      * @param e The projection event, most likely fired from a map     *        bean.     * @param saveGraphicsForRedraw flag to test for whether the scale     *        and zone has changed for the projection. If true, and     *        the scale and zone is the same, we'll just reproject and     *        redraw the current frames before getting new ones, to     *        fake something happening quickly.     */    public void projectionChanged(ProjectionEvent e,                                  boolean saveGraphicsForRedraw) {        Debug.message("basic", getName() + "|RpfLayer.projectionChanged()");        // Need to grab a copy of the old projection in case        // saveGraphicsForRedraw is true and the projection changes,        // so we can test to see if the zone and scale have changed,        // testing for reuse of current frames.        Projection oldProj = getProjection();        Projection newProj = setProjection(e);        if (newProj == null) {            // Projection didn't change, nothing to do, already have            // good graphics and just need to paint...            repaint();            return;        }        if (saveGraphicsForRedraw && oldProj instanceof CADRG                && newProj instanceof CADRG) {            CADRG cadrg1 = (CADRG) oldProj;            CADRG cadrg2 = (CADRG) newProj;            if (cadrg1.getScale() != cadrg2.getScale()                    || cadrg1.getZone() != cadrg2.getZone()) {                setGraphicList(null);            }            // else set graphic list escapes deletion...        } else {            setGraphicList(null);        }        doPrepare();    }    /**     * Prepares the graphics for the layer. This is where the     * getRectangle() method call is made on the rpf.     * <p>     * Occasionally it is necessary to abort a prepare call. When this     * happens, the map will set the cancel bit in the LayerThread,     * (the thread that is running the prepare). If this Layer needs     * to do any cleanups during the abort, it should do so, but     * return out of the prepare asap.     *      * @return graphics list of images and attributes.     */    public synchronized OMGraphicList prepare() {        if (isCancelled()) {            Debug.message("rpf", getName() + "|RpfLayer.prepare(): aborted.");            return null;        }        if (frameProvider == null) {            // Assuming running locally - otherwise the            // frameProvider should be set before we get here,            // like in setProperties or in the constructor.            setPaths(paths);            if (frameProvider == null) {

⌨️ 快捷键说明

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