本文整理汇总了Java中org.dynmap.markers.AreaMarker.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java AreaMarker.setLabel方法的具体用法?Java AreaMarker.setLabel怎么用?Java AreaMarker.setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dynmap.markers.AreaMarker
的用法示例。
在下文中一共展示了AreaMarker.setLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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 */
}
示例3: 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);
}
示例4: 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);
}
}
示例5: 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));
}
示例6: addStyle
import org.dynmap.markers.AreaMarker; //导入方法依赖的package包/类
private void addStyle(final String plotid, final String worldid, final AreaMarker m, final PlotWrapper plot) {
AreaStyle as = this.cusstyle.get(worldid + "/" + plotid);
if (as == null) {
as = this.cusstyle.get(plotid);
}
if (as == null) { /* Check for wildcard style matches */
for (final String wc : this.cuswildstyle.keySet()) {
final String[] tok = wc.split("\\|");
if ((tok.length == 1) && plotid.startsWith(tok[0])) {
as = this.cuswildstyle.get(wc);
} else if ((tok.length >= 2) && plotid.startsWith(tok[0]) && plotid.endsWith(tok[1])) {
as = this.cuswildstyle.get(wc);
}
}
}
if (as == null) { /* Check for owner style matches */
if (this.ownerstyle.isEmpty() != true) {
String owner = plot.owner;
if (owner == null) {
owner = "unknown";
}
if (as == null) {
as = this.ownerstyle.get(owner.toLowerCase());
}
}
}
if (as == null) {
as = this.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 (final NumberFormatException nfx) {
nfx.printStackTrace();
}
if (as.strokeweight != 0) {
m.setLineStyle(as.strokeweight, as.strokeopacity, sc);
}
if (as.fillopacity != 0) {
m.setFillStyle(as.fillopacity, fc);
}
if (as.label != null) {
m.setLabel(as.label);
}
}