📄 regionoverlay.java
字号:
package org.placelab.demo.mapview;import java.util.Enumeration;import java.util.Hashtable;import java.util.Vector;import org.placelab.util.swt.Glyph;/** * A region overlay displays {#link RegionBacking} objects on a {#link MapView}. * It also allows the regions to be manipulated by the user through the viewport. */public class RegionOverlay extends MapViewOverlay { public RegionOverlay(MapView view) { super(view); } public void mapChanged(MapBacking newMap) { Vector newGlyphs = new Vector(); Enumeration i = glyphs.elements(); while(i.hasMoreElements()) { RegionGlyph g = (RegionGlyph)i.nextElement(); RegionBacking rb = g.region; g.dispose(); g = new RegionGlyph(this.view, rb); newGlyphs.addElement(g); } glyphs = newGlyphs; } public void addRegion(RegionBacking region) { RegionGlyph rg = new RegionGlyph(this.view, region); glyphs.addElement(rg); } public void addRegions(Hashtable regions) { if(regions == null) return; Enumeration e = regions.elements(); while(e.hasMoreElements()) { this.addRegion((RegionBacking)e.nextElement()); } } public Glyph getTopGlyph() { return (Glyph)glyphs.elementAt(glyphs.size() - 1); } public String getName() { return "RegionOverlay"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -