📄 dtedcoveragelayer.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/dted/DTEDCoverageLayer.java,v $// $RCSfile: DTEDCoverageLayer.java,v $// $Revision: 1.3.2.2 $// $Date: 2004/10/14 18:27:03 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.layer.dted;/* Java Core */import java.awt.Color;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JCheckBox;import javax.swing.Box;/* OpenMap */import com.bbn.openmap.layer.OMGraphicHandlerLayer;import com.bbn.openmap.omGraphics.OMGraphicList;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.Debug;import com.bbn.openmap.util.PropUtils;/** * This is a Layer that provides coverage information on the DTED * data. The layer really uses the properties passed in to it to * determine which directories should be scanned for the data, and * where to locate a coverage file. If a coverage file is not * available, the layer will take the time to scan the directories and * create one, placing it in the desired location (as specified in the * properties). There is a palette for this layer, that lets you turn * off the coverage for different levels of DTED. Right now, only * level 0, 1 and 2 are handled. * * <pre> * * The properties for this file are: * * # Java DTED properties * dtedcov.class=com.bbn.openmap.layer.dted.DTEDCoverageLayer * dtedcov.prettyName=DTED Coverage * # This property should reflect the paths to the RPF directories * #jdted.paths=/tmp/data/dted * dtedcov.paths=/usr/local/matt/data/dted /cdrom/cdrom0/dted * #DTED Level 2 data! * dtedcov.level2.paths=/net/blatz/u5/DTEDLV2 * # Number between 0-255: 0 is transparent, 255 is opaque * dtedcov.opaque=255 * dtedcov.coverageFile=/usr/local/matt/data/dted/coverage.dat * # option ---- * #dtedcov.coverageURL=http://location.of.coverage.file * #Default is true, don't need this entry if you like it... * dtedcov.level0.showcov=true * #Default colors don't need this entry * dtedcov.level0.color=CE4F3F * #Default is true, don't need this entry if you like it... * dtedcov.level1.showcov=true * #Default colors don't need this entry * dtedcov.level1.color=339159 * #Default is true, don't need this entry if you like it... * dtedcov.level2.showcov=true * #Default colors don't need this entry * dtedcov.level2.color=0C75D3 * * </pre> */public class DTEDCoverageLayer extends OMGraphicHandlerLayer implements ActionListener { /** The graphic list of objects to draw. */ protected OMGraphicList[] omGraphics; /** The paths to the DTED directories, telling where the data is. */ protected String[] paths; /** * The paths to the DTED Level 2 directories, telling where the * data is. */ protected String[] paths2; /** Flag to tell the cache to return the coverage for level 0 dted. */ protected boolean showDTEDLevel0; /** Flag to tell the cache to return the coverage for level 1 dted. */ protected boolean showDTEDLevel1; /** Flag to tell the cache to return the coverage for level 0 dted. */ protected boolean showDTEDLevel2; /** The color to outline the shapes for level 0. */ protected Color level0Color; /** The color to outline the shapes for level 1. */ protected Color level1Color; /** The color to outline the shapes for level 2. */ protected Color level2Color; /** * A setting for how transparent to make the images. The default * is 255, which is totally opaque. */ protected int opaqueness; /** Flag to fill the coverage rectangles. */ protected boolean fillRects; /* * Location of coverage summary file. If it doesn't exists, one * will be created here for later use. */ protected String coverageFile = null; /** * Location of coverage summary file, if supplied as a URL. If it * doesn't exists, a coverage file will be used instead. */ protected String coverageURL = null; protected DTEDCoverageManager coverageManager = null; private static final String showLevel0Command = "showLevel0"; private static final String showLevel1Command = "showLevel1"; private static final String showLevel2Command = "showLevel2"; /** The property describing the locations of level 0 and 1 data. */ public static final String DTEDPathsProperty = "paths"; /** The property describing the locations of level 2 data. */ public static final String DTED2PathsProperty = "level2.paths"; /** Property setting to show level 0 data on startup. */ public static final String ShowLevel0Property = "level0.showcov"; /** * Property to use to change the color for coverage of level 0 * data. */ public static final String Level0ColorProperty = "level0.color"; /** Property setting to show level 1 data on startup. */ public static final String ShowLevel1Property = "level1.showcov"; /** * Property to use to change the color for coverage of level 1 * data. */ public static final String Level1ColorProperty = "level1.color"; /** Property setting to show level 2 data on startup. */ public static final String ShowLevel2Property = "level2.showcov"; /** * Property to use to change the color for coverage of level 2 * data. */ public static final String Level2ColorProperty = "level2.color"; /** Property to use for filled rectangles (when java supports it). */ public static final String OpaquenessProperty = "opaque"; /** Property to use to fill rectangles. */ public static final String FillProperty = "fill"; /** * The file to read/write coverage summary. If it doesn't exist * here, it will be created and placed here. */ public static final String CoverageFileProperty = "coverageFile"; /** * A URL to read coverage summary. If it doesn't exist, the * coverage file will be tried. */ public static final String CoverageURLProperty = "coverageURL"; /** * The default constructor for the Layer. All of the attributes * are set to their default values. */ public DTEDCoverageLayer() { setProjectionChangePolicy(new com.bbn.openmap.layer.policy.ListResetPCPolicy(this)); } /** Method that sets all the variables to the default values. */ protected void setDefaultValues() { paths = null; paths2 = null; showDTEDLevel0 = true; showDTEDLevel1 = true; showDTEDLevel2 = true; opaqueness = DTEDFrameColorTable.DEFAULT_OPAQUENESS; fillRects = false; } /** * Set all the DTED 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) { super.setProperties(prefix, properties); setDefaultValues(); prefix = PropUtils.getScopedPropertyPrefix(prefix); paths = PropUtils.initPathsFromProperties(properties, prefix
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -