本文整理汇总了Java中org.dynmap.markers.AreaMarker类的典型用法代码示例。如果您正苦于以下问题:Java AreaMarker类的具体用法?Java AreaMarker怎么用?Java AreaMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AreaMarker类属于org.dynmap.markers包,在下文中一共展示了AreaMarker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public AreaMarker create(MarkerSet markerset, String markerId) {
AreaMarker ret = markerset.createAreaMarker(markerId, this.label, false, this.world, this.x, this.z, false);
if (ret == null) {
return null;
}
// Description
ret.setDescription(this.description);
// Line Style
ret.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
// Fill Style
ret.setFillStyle(this.fillOpacity, this.fillColor);
// Boost Flag
ret.setBoostFlag(this.boost);
return ret;
}
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:22,代码来源:TempAreaMarker.java
示例2: equals
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public static boolean equals(AreaMarker marker, double x[], double z[]) {
int length = marker.getCornerCount();
if (x.length != length) {
return false;
}
if (z.length != length) {
return false;
}
for (int i = 0; i < length; i++) {
if (marker.getCornerX(i) != x[i]) {
return false;
}
if (marker.getCornerZ(i) != z[i]) {
return false;
}
}
return true;
}
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:22,代码来源:TempAreaMarker.java
示例3: showSquareBorder
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
private static void showSquareBorder(String worldName, BorderData border)
{
if ( Gateway.roundBorders.containsKey(worldName) )
removeBorder(worldName);
// corners of the square border
double[] xVals = {border.getX() - border.getRadiusX(), border.getX() + border.getRadiusX()};
double[] zVals = {border.getZ() - border.getRadiusZ(), border.getZ() + border.getRadiusZ()};
AreaMarker marker = Gateway.squareBorders.get(worldName);
if (marker == null)
{
marker = Gateway.markSet.createAreaMarker(
"worldborder_" + worldName,
Config.getDynmapMessage(),
false, worldName, xVals, zVals, true
);
marker.setLineStyle(LINE_WEIGHT, LINE_OPACITY, LINE_COLOR);
marker.setFillStyle(0.0, 0x000000);
Gateway.squareBorders.put(worldName, marker);
}
else
marker.setCornerLocations(xVals, zVals);
}
开发者ID:abused,项目名称:World-Border,代码行数:26,代码来源:DynMapFeatures.java
示例4: updateTownBorders
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public void updateTownBorders() {
/* build new maps */
Map<String, AreaMarker> newTownBordermap = new HashMap<String,AreaMarker>();
Map<String, AreaMarker> newCultureMap = new HashMap<String,AreaMarker>();
// for (AreaMarker am : renderCultureAreas.values()) {
// am.
// }
for (Town t : CivGlobal.getTowns()) {
//deleteInvalidCultureMarkers(t);
handleCulture(t, newCultureMap);
handleTownBorders(t, newTownBordermap);
}
renderTownBorderAreas = newTownBordermap;
renderCultureAreas = newCultureMap;
}
开发者ID:netizen539,项目名称:civcraft,代码行数:19,代码来源:CivCraftUpdateTask.java
示例5: getMarker
import org.dynmap.markers.AreaMarker; //导入依赖的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
示例6: getMarkerByLabel
import org.dynmap.markers.AreaMarker; //导入依赖的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
示例7: createAreaMarker
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
@Override
public MCDynmapAreaMarker createAreaMarker(String id, String label, boolean isHTML, MCWorld world, MCLocation[] corners, boolean isPersistent) {
double[] Xs = new double[corners.length];
double[] Zs = new double[corners.length];
int i = 0;
for (MCLocation location : corners) {
Xs[i] = location.getX();
Zs[i] = location.getZ();
i++;
}
AreaMarker marker = _set.createAreaMarker(id, label, isHTML, world.getName(), Xs, Zs, isPersistent);
if (marker != null) {
return new BukkitMCDynmapAreaMarker(marker);
} else {
return null;
}
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:18,代码来源:BukkitMCDynmapMarkerSet.java
示例8: update
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public void update(AreaMarker marker) {
// Corner Locations
if (!equals(marker, this.x, this.z)) {
marker.setCornerLocations(this.x, this.z);
}
// Label
if (!marker.getLabel().equals(this.label)) {
marker.setLabel(this.label);
}
// Description
if (!marker.getDescription().equals(this.description)) {
marker.setDescription(this.description);
}
// Line Style
if (marker.getLineWeight() != this.lineWeight
|| marker.getLineOpacity() != this.lineOpacity
|| marker.getLineColor() != this.lineColor) {
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
}
// Fill Style
if ((marker.getFillOpacity() != this.fillOpacity) || (marker.getFillColor() != this.fillColor)) {
marker.setFillStyle(this.fillOpacity, this.fillColor);
}
// Boost Flag
if (marker.getBoostFlag() != this.boost) {
marker.setBoostFlag(this.boost);
}
}
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:33,代码来源:TempAreaMarker.java
示例9: removeBorder
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public static void removeBorder(String worldName)
{
if (!enabled) return;
CircleMarker marker = Gateway.roundBorders.remove(worldName);
if (marker != null)
marker.deleteMarker();
AreaMarker marker2 = Gateway.squareBorders.remove(worldName);
if (marker2 != null)
marker2.deleteMarker();
}
开发者ID:abused,项目名称:World-Border,代码行数:13,代码来源:DynMapFeatures.java
示例10: formatInfoBox
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
private String formatInfoBox(RegionData regionData, AreaMarker m, LandTypes cubitType, boolean hasOwner) {
String typeString;
switch (cubitType) {
case SERVER:
typeString = "<div class=\"infowindow\"><span style=\"font-size:120%;\">Type: SERVER<br> %cubitLand%</span></div>";
break;
case SHOP:
typeString = "<div class=\"infowindow\"><span style=\"font-size:120%;\">Type: SHOP<br> %cubitLand% %ownerstyle%</span></div>";
break;
case WORLD:
typeString = "<div class=\"infowindow\"><span style=\"font-size:120%;\">Type: LAND<br> %cubitLand% %ownerstyle%</span></div>";
break;
default:
typeString = "<div class=\"infowindow\"><span style=\"font-size:120%;\">Type: LAND<br> %cubitLand%</span></div>";
break;
}
String v = "<div class=\"cubitInfo\">" + typeString + "</div>";
v = v.replace("%cubitLand%", m.getLabel());
if (hasOwner) {
v = v.replace("%ownerstyle%", "<br>Besitzer: " + this.plugin.getRegionManager().getPlayerNames(regionData.getOwnersUUID()).toString());
} else {
v = v.replace("%ownerstyle%", "<br>Frei");
}
return v;
}
开发者ID:MineGaming,项目名称:cubit,代码行数:28,代码来源:CubitDynmap.java
示例11: removeMark
import org.dynmap.markers.AreaMarker; //导入依赖的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
示例12: handleGames
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
/**
* Show the game area
* @param game
*/
private void handleGames(Game game) {
World world = getBeaconzWorld();
String name = game.getName();
double[] x = new double[4];
double[] z = new double[4];
Point2D[] corners = game.getRegion().getCorners();
int xMin = (int) corners[0].getX();
int xMax = (int) corners[1].getX();
int zMin = (int) corners[0].getY();
int zMax = (int) corners[1].getY();
x[0] = xMin+1; z[0] = zMin+1;
x[1] = xMax-1; z[1] = zMin+1;
x[3] = xMin+1; z[3] = zMax-1;
x[2] = xMax-1; z[2] = zMax-1;
String markerid = world.getName() + "_" + name;
AreaMarker m = resareas.remove(markerid); /* Existing area? */
if(m == null) {
m = set.createAreaMarker(markerid, name, false, world.getName(), x, z, false);
if(m == null)
return;
} else {
m.setCornerLocations(x, z); /* Replace corner locations */
m.setLabel(name); /* Update label */
}
if(use3d) { /* If 3D? */
m.setRangeY(world.getMaxHeight(), 0);
}
/* Set line and fill properties */
addStyle(name, world.getName(), m, game.getName());
/* Build popup */
String desc = formatInfoWindow(game.getName(), m);
m.setDescription(desc); /* Set popup */
}
开发者ID:tastybento,项目名称:beaconz,代码行数:41,代码来源:OurServerListener.java
示例13: handleTriangle
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
private void handleTriangle(TriangleField triangle) {
World world = getBeaconzWorld();
if (triangle.getOwner() == null) {
return;
}
String name = triangle.getOwner().toString();
double[] x = new double[3];
double[] z = new double[3];
x[0] = triangle.a.getX(); z[0] = triangle.a.getY();
x[1] = triangle.b.getX(); z[1] = triangle.b.getY();
x[2] = triangle.c.getX(); z[2] = triangle.c.getY();
String markerid = world.getName() + "_" + triangle.toString();
AreaMarker m = resareas.remove(markerid); /* Existing area? */
if(m == null) {
m = set.createAreaMarker(markerid, name, false, world.getName(), x, z, false);
if(m == null)
return;
} else {
m.setCornerLocations(x, z); /* Replace corner locations */
m.setLabel(name); /* Update label */
}
if(use3d) { /* If 3D? */
m.setRangeY(world.getMaxHeight()-1, world.getMaxHeight()-2);
}
/* Set line and fill properties */
addStyle(name, world.getName(), m, triangle.getOwner().getName());
/* Build popup */
String desc = formatInfoWindow(triangle.getOwner().getName(), m);
m.setDescription(desc); /* Set popup */
/* Add to map */
resareas.put(markerid, m);
}
开发者ID:tastybento,项目名称:beaconz,代码行数:37,代码来源:OurServerListener.java
示例14: addStyle
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
/**
* Adds a style
* @param resid
* @param worldid
* @param m
* @param name
*/
private void addStyle(String resid, String worldid, AreaMarker m, String name) {
AreaStyle as = null;
if(!teamstyle.isEmpty()) {
//info("DEBUG: ownerstyle is not empty " + getServer().getOfflinePlayer(island.getOwner()).getName());
as = teamstyle.get(name);
/*
if (as != null) {
info("DEBUG: fill color = " + as.fillcolor);
info("DEBUG: stroke color = " + as.strokecolor);
}*/
}
if(as == null) {
//info("DEBUG: as = is null - using default style");
as = defstyle;
}
int sc = 0xFF0000;
int fc = 0xFF0000;
try {
sc = Integer.parseInt(as.strokecolor.substring(1), 16);
fc = Integer.parseInt(as.fillcolor.substring(1), 16);
} catch (NumberFormatException nfx) {
}
/*
if (sc == 0xFF0000) {
info("DEBUG: stroke is red");
} else {
info("DEBUG: stroke is not red");
}*/
m.setLineStyle(as.strokeweight, as.strokeopacity, sc);
m.setFillStyle(as.fillopacity, fc);
if(as.label != null) {
m.setLabel(as.label);
}
}
开发者ID:tastybento,项目名称:beaconz,代码行数:42,代码来源:OurServerListener.java
示例15: getAreaMarkers
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
@Override
public MCDynmapAreaMarker[] getAreaMarkers() {
Set<AreaMarker> ms = _set.getAreaMarkers();
MCDynmapAreaMarker[] markers = new MCDynmapAreaMarker[ms.size()];
int i = 0;
for (AreaMarker marker : ms) {
markers[i] = new BukkitMCDynmapAreaMarker(marker);
i++;
}
return markers;
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:12,代码来源:BukkitMCDynmapMarkerSet.java
示例16: getAreaMarker
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
@Override
public MCDynmapAreaMarker getAreaMarker(String id) {
AreaMarker marker = _set.findAreaMarker(id);
if (marker != null) {
return new BukkitMCDynmapAreaMarker(marker);
} else {
return null;
}
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:10,代码来源:BukkitMCDynmapMarkerSet.java
示例17: getAreaMarkerByLabel
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
@Override
public MCDynmapAreaMarker getAreaMarkerByLabel(String label) {
AreaMarker marker = _set.findAreaMarkerByLabel(label);
if (marker != null) {
return new BukkitMCDynmapAreaMarker(marker);
} else {
return null;
}
}
开发者ID:Hekta,项目名称:CHDynmap,代码行数:10,代码来源:BukkitMCDynmapMarkerSet.java
示例18: hide
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
public boolean hide(final GeneralRegion region) {
if (this.markerSet == null || !region.isDynmapable()) {
return false;
} else {
// TODO Handle non-area marker if needed
final String id = StringUtil.toLowerCamelCase(region.getRegionName());
final AreaMarker marker = this.markerSet.findAreaMarker(id);
if (marker == null) {
return false;
} else {
marker.deleteMarker();
return true;
}
}
}
开发者ID:Ribesg,项目名称:NPlugins,代码行数:16,代码来源:DynmapBridge.java
示例19: updateRegionMarker
import org.dynmap.markers.AreaMarker; //导入依赖的package包/类
void updateRegionMarker(World world, ProtectedRegion region) {
double[] x;
double[] z;
String regionId = region.getId();
LandTypes cubitType = LandTypes.getLandType(regionId);
RegionData regionData = new RegionData(world);
regionData.setWGRegion(region);
boolean hasOwner = false;
if (regionData.getOwnersUUID().length >= 1) {
hasOwner = true;
}
RegionType tn = region.getType();
BlockVector l0 = region.getMinimumPoint();
BlockVector l1 = region.getMaximumPoint();
if (tn == RegionType.CUBOID) {
x = new double[4];
z = new double[4];
x[0] = l0.getX();
z[0] = l0.getZ();
x[1] = l0.getX();
z[1] = l1.getZ() + 1.0;
x[2] = l1.getX() + 1.0;
z[2] = l1.getZ() + 1.0;
x[3] = l1.getX() + 1.0;
z[3] = l0.getZ();
} else {
return;
}
String markerId = world.getName() + "_" + regionId;
AreaMarker m = this.markerSet.findAreaMarker(markerId);
if (m == null) {
m = this.markerSet.createAreaMarker(markerId, regionId, false, world.getName(), x, z, false);
if (m == null)
return;
} else {
m.setCornerLocations(x, z);
m.setLabel(regionId);
}
addStyle(m, regionData, cubitType, hasOwner);
m.setDescription(formatInfoBox(regionData, m, cubitType, hasOwner));
}
开发者ID:MineGaming,项目名称:cubit,代码行数:47,代码来源:CubitDynmap.java
示例20: addMark
import org.dynmap.markers.AreaMarker; //导入依赖的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
注:本文中的org.dynmap.markers.AreaMarker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论