本文整理汇总了Java中gov.nasa.worldwind.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于gov.nasa.worldwind包,在下文中一共展示了Configuration类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: GridTileLayer
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public GridTileLayer(GridRetriever retriever, ImageResampler ImageResampler) {
super(makeLevels(retriever.getNumLevels()), new GridTiler(retriever, ImageResampler));
tiler = (GridTiler) getTiler();
tiler.renderTools.addChangeListener(this);
if (!WorldWind.getMemoryCacheSet().containsCache(TextureTile.class.getName()))
{
long size = Configuration.getLongValue(AVKey.TEXTURE_IMAGE_CACHE_SIZE, 3000000L);
MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
cache.setName("Texture Tiles");
WorldWind.getMemoryCacheSet().addCache(TextureTile.class.getName(), cache);
}
this.setUseTransparentTextures(true);
this.setDrawTileBoundaries(true);
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:GridTileLayer.java
示例2: setCacheLocation
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
/**
* Set the map cache location
*
* @param location
*/
public static void setCacheLocation(String location) {
StringBuilder sb = new StringBuilder("<?xml version=\"1.0\"?>");
sb.append("<dataFileStore><writeLocations><location wwDir=\"");
sb.append(location);
sb.append("\" create=\"true\"/></writeLocations></dataFileStore>");
try {
File file = File.createTempFile("adsc", ".xml");
file.deleteOnExit();
FileWriter fw = new java.io.FileWriter(file);
fw.write(sb.toString());
fw.close();
Configuration.setValue(
AVKey.DATA_FILE_STORE_CONFIGURATION_FILE_NAME, file
.getAbsolutePath());
} catch (IOException e) {
e.printStackTrace();
}
}
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:29,代码来源:WWJUtil.java
示例3: setProxyPort
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
/**
* Set the value of the field proxyPort
* @param proxyPort the new proxyPort to set
*/
public void setProxyPort(final String proxyPort) {
_proxyPort = proxyPort;
if (proxyPort == null || "".equals(proxyPort)) {
Configuration.removeKey(AVKey.URL_PROXY_PORT);
Configuration.removeKey(AVKey.URL_PROXY_TYPE);
System.getProperties().remove("http.proxyPort");
} else {
Configuration.setValue(AVKey.URL_PROXY_PORT, proxyPort);
Configuration.setValue(AVKey.URL_PROXY_TYPE, Proxy.Type.HTTP);
System.setProperty("http.proxyPort", proxyPort);
}
}
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:17,代码来源:Env.java
示例4: setProxyHost
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
/**
* Set the value of the field proxyHost
* @param proxyHost the new proxyHost to set
*/
public void setProxyHost(final String proxyHost) {
_proxyHost = proxyHost;
if (proxyHost == null || "".equals(proxyHost)) {
Configuration.removeKey(AVKey.URL_PROXY_HOST);
Configuration.removeKey(AVKey.URL_PROXY_TYPE);
System.getProperties().remove("http.proxyHost");
} else {
Configuration.setValue(AVKey.URL_PROXY_HOST, proxyHost);
Configuration.setValue(AVKey.URL_PROXY_TYPE, Proxy.Type.HTTP);
System.setProperty("http.proxyHost", proxyHost);
}
}
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:17,代码来源:Env.java
示例5: main
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public static void main( String[] args) {
if (Configuration.isMacOS()) {
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "GeoMapApp");
}
com.Ostermiller.util.Browser.init();
WWMapApp.main(args);
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:9,代码来源:WWWrapper.java
示例6: readTexture
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
/**
* Reads and returns the texture data at the specified URL, optionally converting it to the specified format and
* generating mip-maps. If <code>textureFormat</code> is a recognized mime type, this returns the texture data in
* the specified format. Otherwise, this returns the texture data in its native format. If <code>useMipMaps</code>
* is true, this generates mip maps for any non-DDS texture data, and uses any mip-maps contained in DDS texture
* data.
* <p/>
* Supported texture formats are as follows: <ul> <li><code>image/dds</code> - Returns DDS texture data, converting
* the data to DDS if necessary. If the data is already in DDS format it's returned as-is.</li> </ul>
*
* @param url the URL referencing the texture data to read.
* @param textureFormat the texture data format to return.
* @param useMipMaps true to generate mip-maps for the texture data or use mip maps already in the texture data,
* and false to read the texture data without generating or using mip-maps.
*
* @return TextureData the texture data from the specified URL, in the specified format and with mip-maps.
*/
protected TextureData readTexture(java.net.URL url, String textureFormat, boolean useMipMaps)
{
try
{
// If the caller has enabled texture compression, and the texture data is not a DDS file, then use read the
// texture data and convert it to DDS.
if ("image/dds".equalsIgnoreCase(textureFormat) && !url.toString().toLowerCase().endsWith("dds"))
{
// Configure a DDS compressor to generate mipmaps based according to the 'useMipMaps' parameter, and
// convert the image URL to a compressed DDS format.
DXTCompressionAttributes attributes = DDSCompressor.getDefaultCompressionAttributes();
attributes.setBuildMipmaps(useMipMaps);
ByteBuffer buffer = DDSCompressor.compressImageURL(url, attributes);
return OGLUtil.newTextureData(Configuration.getMaxCompatibleGLProfile(),
WWIO.getInputStreamFromByteBuffer(buffer), useMipMaps);
}
// If the caller has disabled texture compression, or if the texture data is already a DDS file, then read
// the texture data without converting it.
else
{
return OGLUtil.newTextureData(Configuration.getMaxCompatibleGLProfile(), url, useMipMaps);
}
}
catch (Exception e)
{
String msg = Logging.getMessage("layers.TextureLayer.ExceptionAttemptingToReadTextureFile", url);
Logging.logger().log(java.util.logging.Level.SEVERE, msg, e);
return null;
}
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:50,代码来源:BasicScalingTiledImageLayer.java
示例7: readTexture
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
private static TextureData readTexture(URL url)
{
try
{
return OGLUtil.newTextureData(Configuration.getMaxCompatibleGLProfile(), url, (Boolean) null);
//return TextureIO.newTextureData(url, false, null);
}
catch (Exception e)
{
Logging.logger().log(
java.util.logging.Level.SEVERE, "layers.TextureLayer.ExceptionAttemptingToReadTextureFile", e);
return null;
}
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:AbstractTrackTiler.java
示例8: GISFrame
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public GISFrame(MarkerLayer layer, Boolean isMiniMap, Double initLat, Double initLong)
{
this.isMiniMap = isMiniMap;
Configuration.setValue(AVKey.INITIAL_LATITUDE, initLat);
Configuration.setValue(AVKey.INITIAL_LONGITUDE, initLong);
Configuration.setValue(AVKey.INITIAL_PITCH, 45);
Configuration.setValue(AVKey.INITIAL_ALTITUDE, 180000);
setupGui(layer);
setupMenus();
}
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:11,代码来源:GISFrame.java
示例9: start
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public static AppFrame start(String appName, Class appFrameClass)
{
if (Configuration.isMacOS() && appName != null)
{
System.setProperty("com.apple.mrj.application.apple.menu.about.name", appName);
}
try
{
final AppFrame frame = (AppFrame) appFrameClass.newInstance();
frame.setTitle(appName);
// SEG -- CHANGED didn't want full app to be closed
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run()
{
frame.setVisible(true);
}
});
return frame;
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
}
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:32,代码来源:BulkDownload_GPS.java
示例10: configureProxy
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public static Proxy configureProxy()
{
String proxyHost = Configuration.getStringValue(AVKey.URL_PROXY_HOST);
if (proxyHost == null)
return null;
Proxy proxy = null;
try
{
int proxyPort = Configuration.getIntegerValue(AVKey.URL_PROXY_PORT);
String proxyType = Configuration.getStringValue(AVKey.URL_PROXY_TYPE);
SocketAddress addr = new InetSocketAddress(proxyHost, proxyPort);
if (proxyType.equals("Proxy.Type.Http"))
proxy = new Proxy(Proxy.Type.HTTP, addr);
else if (proxyType.equals("Proxy.Type.SOCKS"))
proxy = new Proxy(Proxy.Type.SOCKS, addr);
}
catch (Exception e)
{
Logging.logger().log(Level.WARNING,
Logging.getMessage("URLRetriever.ErrorConfiguringProxy", proxyHost), e);
}
return proxy;
}
开发者ID:TrilogisIT,项目名称:FAO_Application,代码行数:28,代码来源:WWIO.java
示例11: BasicMercatorTiledImageLayer
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public BasicMercatorTiledImageLayer( LevelSet levelSet ) {
super(levelSet);
if (!WorldWind.getMemoryCacheSet().containsCache(MercatorTextureTile.class.getName())) {
long size = Configuration.getLongValue(AVKey.TEXTURE_IMAGE_CACHE_SIZE, 3000000L);
MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
cache.setName("Texture Tiles");
WorldWind.getMemoryCacheSet().addCache(MercatorTextureTile.class.getName(), cache);
}
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:11,代码来源:BasicMercatorTiledImageLayer.java
示例12: readTexture
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
private static TextureData readTexture( java.net.URL url, boolean useMipMaps ) {
try {
return OGLUtil.newTextureData(Configuration.getMaxCompatibleGLProfile(), url, useMipMaps);
} catch (Exception e) {
// String msg = Logging.getMessage("layers.TextureLayer.ExceptionAttemptingToReadTextureFile", url.toString());
// Logging.logger().log(java.util.logging.Level.SEVERE, msg, e);
return null;
}
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:10,代码来源:BasicMercatorTiledImageLayer.java
示例13: main
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public static void main( String[] args ) throws Exception {
if (Configuration.isMacOS() && APPNAME != null) {
System.setProperty("com.apple.mrj.application.apple.menu.about.name", APPNAME);
}
GuiUtilities.setDefaultLookAndFeel();
Logger.INSTANCE.init();
openNww(APPNAME, -1);
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:12,代码来源:SimpleNwwViewer.java
示例14: SherpaGui
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
private SherpaGui() {
System.setProperty("java.net.useSystemProxies", "true");
if (Configuration.isMacOS()) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "World Wind Application");
System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
System.setProperty("apple.awt.brushMetalLook", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", APP_NAME);
} else if (Configuration.isWindowsOS()) {
/*
* prevents flashing during window resizing
*/
System.setProperty("sun.awt.noerasebackground", "true");
}
}
开发者ID:ofmooseandmen,项目名称:sherpa,代码行数:16,代码来源:SherpaGui.java
示例15: createDataStore
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
public static Document createDataStore(File[] files, File directory, DataStoreProducer producer,String datasetName ) throws Exception {
//File installLocation = DataInstallUtil.getDefaultInstallLocation(fileStore);
if (directory == null) {
String message = Logging.getMessage("generic.NoDefaultImportLocation");
Logging.logger().severe(message);
return null;
}
// Create the production parameters. These parameters instruct the DataStoreProducer where to install the cached
// data, and what name to put in the data configuration document.
AVList params = new AVListImpl();
params.setValue(AVKey.DATASET_NAME, datasetName);
params.setValue(AVKey.DATA_CACHE_NAME, datasetName);
params.setValue(AVKey.FILE_STORE_LOCATION, directory.getAbsolutePath());
// These parameters define producer's behavior:
// create a full tile cache OR generate only first two low resolution levels
boolean enableFullPyramid = Configuration.getBooleanValue(AVKey.PRODUCER_ENABLE_FULL_PYRAMID, true);
if (!enableFullPyramid) {
params.setValue(AVKey.SERVICE_NAME, AVKey.SERVICE_NAME_LOCAL_RASTER_SERVER);
// retrieve the value of the AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL, default to "Auto" if missing
String maxLevel = Configuration.getStringValue(AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL, "Auto");
params.setValue(AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL, maxLevel);
} else {
params.setValue(AVKey.PRODUCER_ENABLE_FULL_PYRAMID, true);
}
producer.setStoreParameters(params);
try {
for (File file : files) {
producer.offerDataSource(file, null);
Thread.yield();
}
// Convert the file to a form usable by World Wind components, according to the specified DataStoreProducer.
// This throws an exception if production fails for any reason.
producer.startProduction();
} catch (InterruptedException ie) {
producer.removeProductionState();
Thread.interrupted();
throw ie;
} catch (Exception e) {
// Exception attempting to convert the file. Revert any change made during production.
producer.removeProductionState();
throw e;
}
// Return the DataConfiguration from the production results. Since production successfully completed, the
// DataStoreProducer should contain a DataConfiguration in the production results. We test the production
// results anyway.
Iterable results = producer.getProductionResults();
if (results != null && results.iterator() != null && results.iterator().hasNext()) {
Object o = results.iterator().next();
if (o != null && o instanceof Document) {
return (Document) o;
}
}
return null;
}
开发者ID:TrilogisIT,项目名称:FAO_Application,代码行数:63,代码来源:ImportUtils.java
示例16: makeElevationModel
import gov.nasa.worldwind.Configuration; //导入依赖的package包/类
private static ElevationModel makeElevationModel() throws URISyntaxException, ParserConfigurationException,
IOException, SAXException {
final URI serverURI = new URI("http://www.nasa.network.com/elev");
final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setNamespaceAware(true);
if (Configuration.getJavaVersion() >= 1.6) {
try {
docBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException e) { // Note it and continue on. Some Java5 parsers don't support the feature.
String message = Logging.getMessage("XML.NonvalidatingNotSupported");
Logging.logger().finest(message);
}
}
final DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
// Request the capabilities document from the server.
final CapabilitiesRequest req = new CapabilitiesRequest(serverURI);
final Document doc = docBuilder.parse(req.toString());
// Parse the DOM as a capabilities document.
// CHANGED
//final Capabilities caps = Capabilities.parse(doc);
final WMSCapabilities caps = new WMSCapabilities(doc);
final double HEIGHT_OF_MT_EVEREST = 8850d; // meters
final double DEPTH_OF_MARIANAS_TRENCH = -11000d; // meters
// Set up and instantiate the elevation model
final AVList params = new AVListImpl();
params.setValue(AVKey.LAYER_NAMES, "|srtm3");
params.setValue(AVKey.TILE_WIDTH, 150);
params.setValue(AVKey.TILE_HEIGHT, 150);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, LatLon.fromDegrees(20, 20));
params.setValue(AVKey.NUM_LEVELS, 8);
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
params.setValue(AVKey.ELEVATION_MIN, DEPTH_OF_MARIANAS_TRENCH);
params.setValue(AVKey.ELEVATION_MAX, HEIGHT_OF_MT_EVEREST);
final CompoundElevationModel cem = new CompoundElevationModel();
cem.addElevationModel(new WMSBasicElevationModel(caps, params));
return cem;
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:45,代码来源:AppPanel.java
注:本文中的gov.nasa.worldwind.Configuration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论