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

📄 rpfviewattributes.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// **********************************************************************// // <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/RpfViewAttributes.java,v $// $RCSfile: RpfViewAttributes.java,v $// $Revision: 1.4.2.4 $// $Date: 2005/08/09 21:17:56 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.rpf;import java.util.Properties;import com.bbn.openmap.Environment;import com.bbn.openmap.I18n;import com.bbn.openmap.PropertyConsumer;import com.bbn.openmap.omGraphics.OMRasterObject;import com.bbn.openmap.proj.CADRG;import com.bbn.openmap.util.PropUtils;import com.bbn.openmap.util.propertyEditor.OptionPropertyEditor;/** * This class contains information to pass through the RpfCacheManager * and RpfCacheHandlers to describe limitations and parameters desired * for data view. It contains information about the numbers of colors * to use, how opaque to make the images, the chart series to * retrieve, etc. */public class RpfViewAttributes implements RpfConstants, PropertyConsumer {    public final static String ANY = "ANY";    public final static String ALL = "ALL";    public final static String COLORMODEL_DIRECT_STRING = "direct";    public final static String COLORMODEL_INDEXED_STRING = "indexed";    protected String propertyPrefix = null;    /** Number of colors to use - 16, 32, 216 */    public int numberOfColors;    /**     * The opaqueness of the image (transparency) 0-255: 0 is clear,     * 255 is opaque.     */    public int opaqueness;    /**     * The image colormodel to use, indexed or colortable, for the     * OMRasters.     */    public int colorModel;    /**     * Flag to use to scale images or not. This will cause the caches     * to scale the images to match the map scale, instead of     * requiring the map to be at the same scale as the desired image.     */    public boolean scaleImages;    /**     * The limiting factor for image scaling. Make this too big, and     * you will run out of memory.     */    public float imageScaleFactor;    /**     * The data series two-letter code to limit responses to. If you     * want any data that is the closest match for the current map,     * use ANY (default). If you want all of the RpfCoverageBoxes that     * have some coverage, use ALL.     */    public String chartSeries;    /**     * Flag to set if the CADRG projection is required. Might not be,     * if we start warping images.     */    public boolean requireProjection;    /** Flag to display images. */    public boolean showMaps;    /** Flag to display attribute information about the subframes. */    public boolean showInfo;    /** CADRG Projection of the map. */    public CADRG proj;    /**     * Autofetch the subframe attributes from the FrameProvider. Use     * only if you are interested in background information about the     * images.     */    public boolean autofetchAttributes;    protected I18n i18n = Environment.getI18n();    public RpfViewAttributes() {        setDefaults();    }    public void setDefaults() {        numberOfColors = RpfColortable.CADRG_COLORS;        opaqueness = RpfColortable.DEFAULT_OPAQUENESS;        scaleImages = true;        imageScaleFactor = 4.0f;        colorModel = OMRasterObject.COLORMODEL_DIRECT;        chartSeries = ANY;        requireProjection = true;        showMaps = true;        showInfo = false;        autofetchAttributes = false;    }    // ========================================    // PropertyConsumer interface    // ========================================    /**     * Sets the properties. This particular method assumes that the     * marker name is not needed, because all of the contents of this     * Properties object are to be used for this object, and scoping     * the properties with a prefix is unnecessary.     *      * @param props the <code>Properties</code> object.     */    public void setProperties(java.util.Properties props) {        setProperties(null, props);    }    /**     */    public void setProperties(String prefix, java.util.Properties props) {        propertyPrefix = prefix;        prefix = PropUtils.getScopedPropertyPrefix(prefix);        opaqueness = PropUtils.intFromProperties(props, prefix                + OpaquenessProperty, opaqueness);        numberOfColors = PropUtils.intFromProperties(props, prefix                + NumColorsProperty, numberOfColors);        showMaps = PropUtils.booleanFromProperties(props, prefix                + ShowMapsProperty, showMaps);        showInfo = PropUtils.booleanFromProperties(props, prefix                + ShowInfoProperty, showInfo);        scaleImages = PropUtils.booleanFromProperties(props, prefix                + ScaleImagesProperty, scaleImages);        chartSeries = props.getProperty(prefix + ChartSeriesProperty);        autofetchAttributes = PropUtils.booleanFromProperties(props, prefix                + AutoFetchAttributeProperty, autofetchAttributes);        imageScaleFactor = PropUtils.floatFromProperties(props, prefix                + ImageScaleFactorProperty, imageScaleFactor);        String colormodel = props.getProperty(prefix + ColormodelProperty);        if (colormodel != null                && colormodel.equalsIgnoreCase(COLORMODEL_INDEXED_STRING)) {            colorModel = OMRasterObject.COLORMODEL_INDEXED;        } else {            colorModel = OMRasterObject.COLORMODEL_DIRECT;        }    }    /**     * PropertyConsumer method, to fill in a Properties object,     * reflecting the current values of the layer. If the layer has a     * propertyPrefix set, the property keys should have that prefix     * plus a separating '.' prepended to each propery key it uses for     * configuration.     *      * @param props a Properties object to load the PropertyConsumer     *        properties into. If props 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 getProperties(Properties props) {        if (props == null) {            props = new Properties();        }

⌨️ 快捷键说明

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