• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Marker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void update(MarkerAPI markerApi, Marker marker) {
    if (!this.world.equals(marker.getWorld()) || this.x != marker.getX() || this.y != marker.getY() || this.z != marker.getZ()) {
        marker.setLocation(this.world, this.x, this.y, this.z);
    }

    if (!marker.getLabel().equals(this.label)) {
        marker.setLabel(this.label);
    }

    MarkerIcon icon = getMarkerIcon(markerApi, this.iconName);
    if (marker.getMarkerIcon() == null || marker.getMarkerIcon().equals(icon)) {
        marker.setMarkerIcon(icon);
    }

    if (!marker.getDescription().equals(this.description)) {
        marker.setDescription(this.description);
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:19,代码来源:TempMarker.java


示例2: updateDynmap

import org.dynmap.markers.Marker; //导入依赖的package包/类
private void updateDynmap() {
	
	Plugin dynmapPlugin = Bukkit.getServer().getPluginManager().getPlugin("dynmap");
	if (dynmapPlugin == null || !(dynmapPlugin instanceof DynmapAPI)){
		print("Critical error accessing the dynmap plugin, dynmap will not be used.");
		return;
	}	//dynmap contract assumes none of the below null
	DynmapAPI dynmapAPI = (DynmapAPI)dynmapPlugin;	
	MarkerAPI markerAPI = dynmapAPI.getMarkerAPI();
	MarkerIcon planetIcon = markerAPI.getMarkerIcon("world");
	
	MarkerSet markers = markerAPI.getMarkerSet("markers");
	for (String name : centreCoordinates.keySet()){
		Integer[] coords = centreCoordinates.get(name);
		Marker planetMarker = markers.findMarker(name);
		
		if (planetMarker == null){
			markers.createMarker(name, name, worldName, coords[0], coords[1], coords[2], planetIcon,true);
		} else {
			planetMarker.setLocation(worldName, coords[0], coords[1], coords[2]);
		}
	}	
	
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:25,代码来源:SQOrbitsPlanetMover.java


示例3: getMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapMarker getMarker(String id) {
	AreaMarker am = _set.findAreaMarker(id);
	if (am != null) {
		return new BukkitMCDynmapAreaMarker(am);
	}
	CircleMarker cm = _set.findCircleMarker(id);
	if (cm != null) {
		return new BukkitMCDynmapCircleMarker(cm);
	}
	Marker ic = _set.findMarker(id);
	if (ic != null) {
		return new BukkitMCDynmapIconMarker(ic);
	}
	PolyLineMarker pm = _set.findPolyLineMarker(id);
	if (pm != null) {
		return new BukkitMCDynmapPolyLineMarker(pm);
	}
	return null;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:21,代码来源:BukkitMCDynmapMarkerSet.java


示例4: getMarkerByLabel

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapMarker getMarkerByLabel(String label) {
	GenericMarker marker = _set.findAreaMarkerByLabel(label);
	if (marker != null) {
		return new BukkitMCDynmapAreaMarker((AreaMarker) marker);
	}
	marker = _set.findCircleMarkerByLabel(label);
	if (marker != null) {
		return new BukkitMCDynmapCircleMarker((CircleMarker) marker);
	}
	marker = _set.findMarkerByLabel(label);
	if (marker != null) {
		return new BukkitMCDynmapIconMarker((Marker) marker);
	}
	marker = _set.findPolyLineMarkerByLabel(label);
	if (marker != null) {
		return new BukkitMCDynmapPolyLineMarker((PolyLineMarker) marker);
	}
	return null;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:21,代码来源:BukkitMCDynmapMarkerSet.java


示例5: create

import org.dynmap.markers.Marker; //导入依赖的package包/类
public Marker create(MarkerAPI markerApi, MarkerSet markerset, String markerId) {
    Marker ret = markerset.createMarker(markerId, this.label, this.world, this.x, this.y, this.z, getMarkerIcon(markerApi, this.iconName), false // not persistent
    );

    if (ret == null) {
        return null;
    }

    ret.setDescription(this.description);

    return ret;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:13,代码来源:TempMarker.java


示例6: addMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void addMarker(String partyname, String label, Location loc) {
	for (Marker m : layer.getMarkers()) {
		if (m.getMarkerID().equals("party_"+partyname))
			m.deleteMarker();
	}
	layer.createMarker("party_" + partyname, label, true, loc.getWorld().getName(), loc.getX(), loc.getY(), loc.getZ(), api.getMarkerAPI().getMarkerIcon(Variables.dynmap_marker_icon), true);
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:8,代码来源:DynmapHandler.java


示例7: removeMark

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void removeMark(Region r){		
	AreaMarker am = MSet.findAreaMarker(r.getID());
	if (am != null){
		am.deleteMarker();
	}
	Marker m = MSet.findMarker(r.getID());
	if (m != null){
		m.deleteMarker();
	}
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:11,代码来源:RPDynmap.java


示例8: getIconMarkers

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapIconMarker[] getIconMarkers() {
	Set<Marker> ms = _set.getMarkers();
	MCDynmapIconMarker[] markers = new MCDynmapIconMarker[ms.size()];
	int i = 0;
	for (Marker marker : ms) {
		markers[i] = new BukkitMCDynmapIconMarker(marker);
		i++;
	}
	return markers;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:12,代码来源:BukkitMCDynmapMarkerSet.java


示例9: getIconMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapIconMarker getIconMarker(String id) {
	Marker marker = _set.findMarker(id);
	if (marker != null) {
		return new BukkitMCDynmapIconMarker(marker);
	} else {
		return null;
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:10,代码来源:BukkitMCDynmapMarkerSet.java


示例10: getIconMarkerByLabel

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapIconMarker getIconMarkerByLabel(String label) {
	Marker marker = _set.findMarkerByLabel(label);
	if (marker != null) {
		return new BukkitMCDynmapIconMarker(marker);
	} else {
		return null;
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:10,代码来源:BukkitMCDynmapMarkerSet.java


示例11: createIconMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public MCDynmapIconMarker createIconMarker(String id, String label, boolean isHTML, MCLocation location, MCDynmapIcon icon, boolean isPersistent) {
	Marker marker = _set.createMarker(id, label, isHTML, location.getWorld().getName(), location.getX(), location.getY(), location.getZ(), ((BukkitMCDynmapIcon) icon).getHandle(), isPersistent);
	if (marker != null) {
		return new BukkitMCDynmapIconMarker(marker);
	} else {
		return null;
	}
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:10,代码来源:BukkitMCDynmapMarkerSet.java


示例12: reinitialize

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void reinitialize(final Iterable<GeneralRegion> regions) {
    if (this.markerSet != null) {
        for (final Marker marker : this.markerSet.getMarkers()) {
            marker.deleteMarker();
        }
        this.initialize(regions);
    }
}
 
开发者ID:Ribesg,项目名称:NPlugins,代码行数:9,代码来源:DynmapBridge.java


示例13: removeMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void removeMarker(String id) {
	for (Marker m : layer.getMarkers()) {
		if (m.getMarkerID().equals("party_"+id))
			m.deleteMarker();
	}
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:7,代码来源:DynmapHandler.java


示例14: addMark

import org.dynmap.markers.Marker; //导入依赖的package包/类
public void addMark(Region r){
	AreaMarker am = MSet.findAreaMarker(r.getID());
	
	double[] x = new double[4];
	double[] z = new double[4];
	int i = 0;
	for (Location l:r.get4Points(90)){
		x[i] = l.getX();
		z[i] = l.getZ();
		i++;
	}
		
	if (am == null){		    				
		am = MSet.createAreaMarker(r.getID(), r.getName(), false, r.getWorld(), x, z, true);	
	} else {
		am.setCornerLocations(x, z);
	}		
	
	String rName = RPLang.get("region.name")+" <span style=\"font-weight:bold;\">"+r.getName()+"</span><br>";
	String area = RPLang.get("region.area")+" <span style=\"font-weight:bold;\">"+r.getArea()+"</span>"; 		
	am.setDescription(ChatColor.stripColor(rName+area));
	
	if (RPConfig.getBool("hooks.dynmap.show-leaders-admins")){			
		String leader = RPLang.get("region.leaders")+" <span style=\"font-weight:bold;\">"+r.getLeadersDesc()+"</span><br>"; 
		String admin = RPLang.get("region.admins")+" <span style=\"font-weight:bold;\">"+r.getAdminDesc()+"</span><br>"; 						
		am.setDescription(ChatColor.stripColor(rName+leader+admin+area));
	}		
	
	int center = -1;
	if (RPConfig.getBool("hooks.dynmap.cuboid-region.enabled")){
		am.setRangeY(r.getMinLocation().getY(), r.getMaxLocation().getY());
	} else {
		center = RPConfig.getInt("hooks.dynmap.cuboid-region.if-disable-set-center");
		am.setRangeY(center, center);			
	}
	
	
	if (RPConfig.getBool("hooks.dynmap.show-icon")){
		Marker m = MSet.findMarker(r.getID());
		if (center == -1){
			center = r.getCenterY();
		}
		if (m == null){		    				
			m = MSet.createMarker(r.getID(), r.getName(), r.getWorld(), r.getCenterX(), center, r.getCenterZ(), MApi.getMarkerIcon(RPConfig.getString("hooks.dynmap.marker-icon")), true);
		} else {
			m.setLocation(r.getWorld(), r.getCenterX(), center, r.getCenterZ());
		}
	}
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:50,代码来源:RPDynmap.java


示例15: updateStructures

import org.dynmap.markers.Marker; //导入依赖的package包/类
private void updateStructures() {
		
		Iterator<Entry<BlockCoord, Structure>> iter = CivGlobal.getStructureIterator();

		while(iter.hasNext()) {
			Structure struct = iter.next().getValue();
			Marker m = this.structureMarkers.get(struct.getCorner().toString());
			
			if (m == null) {
			
				int centerX = struct.getCorner().getX() + (struct.getTemplateX() / 2);
				int centerY = struct.getCorner().getY() + (struct.getTemplateY() / 2);
				int centerZ = struct.getCorner().getZ() + (struct.getTemplateZ() / 2);
				

				
				m = structureSet.createMarker("struct-"+struct.getId(), struct.getDisplayName(), false, 
						struct.getCorner().getWorldname(), 
						centerX, centerY, centerZ, 
						markerapi.getMarkerIcon(struct.getMarkerIconName()), false);
								
				if (m == null) {
					DynmapCivcraftPlugin.log.info("Unable to create marker for:"+struct.getDisplayName()+" at "+struct.getCorner().toString());
					continue;
				}				
			}
			
//			if (m == null) {
	//         	DynmapCivcraftPlugin.log.info("marker was null");
	  //       	return;
		//	}
			
			//if (struct == null) {
	       //  	DynmapCivcraftPlugin.log.info("struct was null");
	       //  	return;
			//}
			
			if (struct.getDisplayName() == null) {
	         	DynmapCivcraftPlugin.log.info("display name was null");
	         	return;
			}
			
			//if (struct != null) {
				m.setLabel(struct.getDisplayName());
				m.setDescription(struct.getDynmapDescription());
			//}
				structureMarkers.put(struct.getCorner().toString(), m);
		}
	}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:50,代码来源:CivCraftUpdateTask.java


示例16: BukkitMCDynmapIconMarker

import org.dynmap.markers.Marker; //导入依赖的package包/类
public BukkitMCDynmapIconMarker(Marker marker) {
	super(marker);
	this._marker = marker;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:5,代码来源:BukkitMCDynmapIconMarker.java


示例17: getHandle

import org.dynmap.markers.Marker; //导入依赖的package包/类
@Override
public Marker getHandle() {
	return _marker;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:5,代码来源:BukkitMCDynmapIconMarker.java



注:本文中的org.dynmap.markers.Marker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Function3类代码示例发布时间:2022-05-23
下一篇:
Java MatchGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap