• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MemoryTileCache类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.openstreetmap.gui.jmapviewer.MemoryTileCache的典型用法代码示例。如果您正苦于以下问题:Java MemoryTileCache类的具体用法?Java MemoryTileCache怎么用?Java MemoryTileCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MemoryTileCache类属于org.openstreetmap.gui.jmapviewer包,在下文中一共展示了MemoryTileCache类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 3

import org.openstreetmap.gui.jmapviewer.MemoryTileCache; //导入依赖的package包/类
private void init() {
    setSelectable(false);
    setName("OpenStreetMap");
    TileSource tileSource = new OsmTileSource.Mapnik();
    TileCache cache = new MemoryTileCache(NBR_CACHED_IMAGES);
    tileController = new TileController(tileSource, cache, this);

    scaleChangeListener = new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            double oldScale = (Double) evt.getOldValue();
            double newScale = (Double) evt.getNewValue();
            int oldZoom = zoomLevel(oldScale);
            int newZoom = zoomLevel(newScale);
            if (oldZoom != newZoom) {
                tileController.cancelOutstandingJobs();
            }
        }
    };
}
 

开发者ID:berniejenny,
项目名称:MapAnalyst,
代码行数:21,
代码来源:OpenStreetMap.java

示例2: Registration

点赞 3

import org.openstreetmap.gui.jmapviewer.MemoryTileCache; //导入依赖的package包/类
public Registration(ModeController controller, MindMap map) {
	this.controller = (MindMapController) controller;
	mMap = map;
	logger = controller.getFrame().getLogger(this.getClass().getName());
	mTileSource = new OsmTileSource.Mapnik();
	mTileCache = new MemoryTileCache();
	mTileController = new TileController(mTileSource, mTileCache, this);
	mTileController.setTileLoader(createTileLoader(this));
	mOptionContributor = new MapDialogPropertyContributor(this.controller);

	synchronized (sTimerSemaphore) {
		if (sTimer == null) {
			// only once in the system
			sTimer = new Timer();
			long purgeTime = Resources.getInstance().getLongProperty(
					MapDialog.TILE_CACHE_PURGE_TIME,
					MapDialog.TILE_CACHE_PURGE_TIME_DEFAULT);
			sTimer.schedule(new CachePurger(getCacheDirectory(),
					getCacheMaxAge()), purgeTime, purgeTime);
		}
	}

}
 

开发者ID:iwabuchiken,
项目名称:freemind_1.0.0_20140624_214725,
代码行数:24,
代码来源:Registration.java

示例3: OsmCanvas

点赞 2

import org.openstreetmap.gui.jmapviewer.MemoryTileCache; //导入依赖的package包/类
public OsmCanvas(List<V> nodes, List<Edge<V>> edges, NodePropertySchema nodeSchema, EdgePropertySchema edgeSchema,
		Naming naming) {
	super(nodes, edges, nodeSchema, edgeSchema, naming);
	
	tileController = new TileController(new OsmTileSource.Mapnik(), new MemoryTileCache(), this);
	lastZoom = -1;
	lastTopLeft = null;
	lastBottomRight = null;
	viewer.addPostRenderPaintable(new PostPaintable());
}
 

开发者ID:SiLeBAT,
项目名称:BfROpenLab,
代码行数:11,
代码来源:OsmCanvas.java

示例4: loadAllTiles

点赞 2

import org.openstreetmap.gui.jmapviewer.MemoryTileCache; //导入依赖的package包/类
public void loadAllTiles() {
	int tileSize = tileController.getTileSource().getTileSize();
	int maxTiles = (getCanvasSize().width / tileSize + 2) * (getCanvasSize().height / tileSize + 2);
	MemoryTileCache tileCache = (MemoryTileCache) tileController.getTileCache();

	tileCache.setCacheSize(Math.max(tileCache.getCacheSize(), maxTiles));
	getTiles(true);
}
 

开发者ID:SiLeBAT,
项目名称:BfROpenLab,
代码行数:9,
代码来源:OsmCanvas.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)