本文整理汇总了Java中org.dynmap.markers.AreaMarker.setFillStyle方法的典型用法代码示例。如果您正苦于以下问题:Java AreaMarker.setFillStyle方法的具体用法?Java AreaMarker.setFillStyle怎么用?Java AreaMarker.setFillStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dynmap.markers.AreaMarker
的用法示例。
在下文中一共展示了AreaMarker.setFillStyle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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);
}
示例3: 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);
}
}
示例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: 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);
}
}
示例6: showCuboidRegion
import org.dynmap.markers.AreaMarker; //导入方法依赖的package包/类
/**
* Precondition: We already checked that this cuboid region can be shown and has to be shown.
*/
private boolean showCuboidRegion(final CuboidRegion region) {
// Parameter 1: marker ID
final String id = StringUtil.toLowerCamelCase(region.getRegionName());
// Parameter 2: marker label
final String lbl = region.getRegionName();
// Parameter 3: if label contains HTML, always true
final boolean markup = true;
// Parameter 4: world id, use world name? FIXME
final String world = region.getWorldName();
// Parameter 5 & 6: points coords
//
// z max
// ^ 3 - - - - - - 2
// | | |
// | | |
// | | |
// | 0 - - - - - - 1
// | min
// + - - - - - - - - - - - > x
//
final double[] x = new double[4];
final double[] z = new double[4];
x[0] = x[1] = region.getMinX();
x[2] = x[3] = region.getMaxX();
z[0] = z[3] = region.getMinZ();
z[1] = z[2] = region.getMaxZ();
// Parameter 7: if marker is persistent. It's not.
final boolean persistent = false;
// Do the actual stuff!
final AreaMarker marker = this.markerSet.createAreaMarker(id, lbl, markup, world, x, z, persistent);
if (marker == null) {
LOGGER.warning("Failed to create marker for region " + region.getRegionName());
return false;
}
// Then set the Y!
marker.setRangeY(region.getMinY(), region.getMaxY());
// Description
final String wrap = "<br />";
final StringBuilder description = new StringBuilder();
description.append("<strong>").append(lbl).append("</strong>").append(wrap);
description.append("Owner: ").append(UuidDb.getName(region.getOwnerId())).append(wrap);
description.append("Size: ").append(region.getTotalSize()).append(" blocks").append(wrap);
description.append("Flags: ");
description.append("<ul>");
for (final Flag f : Flag.values()) {
if (region.getFlag(f)) {
description.append(" <li>").append(f).append("</li>");
}
}
description.append("<ul>");
marker.setDescription(description.toString());
// Color!
final int color = Color.fromRGB(200, 200, 20).asRGB();
marker.setLineStyle(1, 0.9, color);
marker.setFillStyle(0.1, color);
return true;
}