- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中net.rptools.maptool.model.Zone
类的一些代码示例,展示了Zone
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone
类的具体详情如下:
包路径:net.rptools.maptool.model.Zone
类名称:Zone
[英]This object represents the maps that will appear for placement of Tokens.
Note: When adding new fields to this class, make sure to add functionality to the constructor, #imported(), #optimize(), and #readResolve() to ensure they are properly initialized for maximum compatibility.
[中]此对象表示将出现用于放置令牌的地图。
注意:向此类添加新字段时,请确保向构造函数、#imported()、#optimize()和#readResolve()添加功能,以确保它们正确初始化以实现最大兼容性。
代码示例来源:origin: RPTools/maptool
public static Zone createZone() {
Zone zone = new Zone();
zone.setName(DEFAULT_MAP_NAME);
zone.setBackgroundPaint(new DrawableTexturePaint(defaultImageId));
zone.setFogPaint(new DrawableColorPaint(Color.black));
zone.setVisible(AppPreferences.getNewMapsVisible());
zone.setHasFog(AppPreferences.getNewMapsHaveFOW());
zone.setUnitsPerCell(AppPreferences.getDefaultUnitsPerCell());
zone.setTokenVisionDistance(AppPreferences.getDefaultVisionDistance());
zone.setGrid(GridFactory.createGrid(AppPreferences.getDefaultGridType(), AppPreferences.getFaceEdge(), AppPreferences.getFaceVertex()));
zone.setGridColor(AppPreferences.getDefaultGridColor().getRGB());
zone.getGrid().setSize(AppPreferences.getDefaultGridSize());
zone.getGrid().setOffset(0, 0);
return zone;
}
代码示例来源:origin: RPTools/maptool
public void setZone(Zone zone) {
if (zone != null) {
zone.removeModelChangeListener(this);
}
this.zone = zone;
update();
if (zone != null) {
zone.addModelChangeListener(this);
}
}
代码示例来源:origin: RPTools/maptool
public void clearAllDrawings(GUID zoneGUID, Zone.Layer layer) {
Zone zone = server.getCampaign().getZone(zoneGUID);
List<DrawnElement> list = zone.getDrawnElements(layer);
zone.clearDrawables(list); // FJE Empties the DrawableUndoManager and empties the list
forwardToAllClients();
}
代码示例来源:origin: RPTools/maptool
private void setZone(Zone z) {
setList(z.getInitiativeList());
if (zone != null) {
zone.removeModelChangeListener(this);
}
zone = z;
zone.addModelChangeListener(this);
}
代码示例来源:origin: RPTools/maptool
public Campaign(Campaign campaign) {
zones = Collections.synchronizedMap(new LinkedHashMap<GUID, Zone>());
/*
* JFJ 2010-10-27 Don't forget that since these are new zones AND new tokens created here from the old one, if
* you have any data that needs to transfer over you will need to manually copy it as is done below for the
* campaign properties and macro buttons.
*/
for (Entry<GUID, Zone> entry : campaign.zones.entrySet()) {
Zone copy = new Zone(entry.getValue());
zones.put(copy.getId(), copy);
}
campaignProperties = new CampaignProperties(campaign.campaignProperties);
macroButtonProperties = new ArrayList<MacroButtonProperties>(campaign.getMacroButtonPropertiesArray());
}
代码示例来源:origin: RPTools/maptool
if (renderer != null && renderer != MapTool.getFrame().getCurrentZoneRenderer() && (renderer.getZone().isVisible() || MapTool.getPlayer().isGM())) {
MapTool.getFrame().setCurrentZoneRenderer(renderer);
Zone.Layer layer = (Zone.Layer) parameters[1];
zone = MapTool.getCampaign().getZone(zoneGUID);
zone.getDrawnElements(layer).clear();
zone.setHasFog(hasFog);
zone.exposeArea(area, selectedToks);
MapTool.getFrame().refresh();
return;
zone.setFogArea(area, selectedToks);
MapTool.getFrame().refresh();
return;
zone.hideArea(area, selectedToks);
MapTool.getFrame().refresh();
return;
if (MapTool.getFrame().getCurrentZoneRenderer() == null && zone.isVisible()) {
MapTool.getFrame().setCurrentZoneRenderer(renderer);
zone = MapTool.getCampaign().getZone(zoneGUID);
Token token = (Token) parameters[1];
zone.putToken(token);
MapTool.getFrame().refresh();
return;
代码示例来源:origin: RPTools/maptool
/**
* This is a convenience method to send the VBL Area to be rendered to the
* server
*
* @param renderer
* Reference to the ZoneRenderer
* @param area
* A valid Area containing VBL polygons
* @param erase
* Set to true to erase the VBL, otherwise draw it
*/
private void renderVBL(ZoneRenderer renderer, Area area, boolean erase) {
if (erase) {
renderer.getZone().removeTopology(area);
MapTool.serverCommand().removeTopology(renderer.getZone().getId(), area);
} else {
renderer.getZone().addTopology(area);
MapTool.serverCommand().addTopology(renderer.getZone().getId(), area);
}
renderer.repaint();
}
}
代码示例来源:origin: RPTools/maptool
addModelChangeListener(undo);
setName(zone.getName());
Iterator<GUID> i = zone.labels.keySet().iterator();
while (i.hasNext()) {
this.putLabel(new Label(zone.labels.get(i.next())));
token.setExposedAreaGUID(guid);
ExposedAreaMetaData eamd = zone.getExposedAreaMetaData(old.getExposedAreaGUID());
if (eamd != null)
exposeArea(eamd.getExposedAreaHistory(), token);
putToken(token);
List<Integer> list = zone.initiativeList.indexOf(old);
for (Integer integer : list) {
代码示例来源:origin: RPTools/maptool
if (functionName.equals("getCurrentMapName")) {
checkNumberOfParameters(functionName, parameters, 0, 0);
return MapTool.getFrame().getCurrentZoneRenderer().getZone().getName();
} else if (functionName.equals("setCurrentMap")) {
checkTrusted(functionName);
if (parameters.size() > 0) {
String mapName = parameters.get(0).toString();
return getNamedMap(functionName, mapName).getZone().isVisible() ? "1" : "0";
} else {
return MapTool.getFrame().getCurrentZoneRenderer().getZone().isVisible() ? "1" : "0";
zone.setVisible(visible);
MapTool.serverCommand().setZoneVisibility(zone.getId(), zone.isVisible());
MapTool.getFrame().getZoneMiniMapPanel().flush();
MapTool.getFrame().repaint();
return zone.isVisible() ? "1" : "0";
String newMapName = parameters.get(1).toString();
Zone zone = getNamedMap(functionName, oldMapName).getZone();
zone.setName(newMapName);
MapTool.serverCommand().renameZone(zone.getId(), newMapName);
if (zone == MapTool.getFrame().getCurrentZoneRenderer().getZone())
MapTool.getFrame().setCurrentZoneRenderer(MapTool.getFrame().getCurrentZoneRenderer());
return zone.getName();
String newName = parameters.get(1).toString();
Zone oldMap = getNamedMap(functionName, oldName).getZone();
代码示例来源:origin: RPTools/maptool
public void actionPerformed(ActionEvent e) {
List<DrawnElement> drawableList = renderer.getZone().getAllDrawnElements();
Iterator<DrawnElement> iter = drawableList.iterator();
while (iter.hasNext()) {
DrawnElement de = iter.next();
if (selectedDrawSet.contains(de.getDrawable().getId())) {
renderer.getZone().removeDrawable(de.getDrawable().getId());
MapTool.serverCommand().undoDraw(renderer.getZone().getId(), de.getDrawable().getId());
renderer.getZone().addDrawable(new DrawnElement(de.getDrawable(), de.getPen()));
MapTool.serverCommand().draw(renderer.getZone().getId(), de.getPen(), de.getDrawable());
}
}
MapTool.getFrame().updateDrawTree();
MapTool.getFrame().refresh();
}
}
代码示例来源:origin: RPTools/maptool
@Override
public void execute(ActionEvent e) {
Zone zone = MapTool.getFrame().getCurrentZoneRenderer().getZone();
// XXX Perhaps ask the user if the copied map should have its GEA and/or TEA cleared? An imported map would ask...
String zoneName = JOptionPane.showInputDialog("New map name:", "Copy of " + zone.getName());
if (zoneName != null) {
Zone zoneCopy = new Zone(zone);
zoneCopy.setName(zoneName);
MapTool.addZone(zoneCopy);
}
}
};
代码示例来源:origin: RPTools/maptool
/**
* Set the zone that we are currently working on.
*
* @param aZone
* The new zone
*/
public void setZone(Zone aZone) {
// Clean up listeners
if (aZone == zone)
return;
if (zone != null)
zone.removeModelChangeListener(this);
zone = aZone;
if (zone != null)
zone.addModelChangeListener(this);
// Older campaigns didn't have a list, make sure this one does
InitiativeList list = (zone != null) ? zone.getInitiativeList() : new InitiativeList(null);
if (list == null) {
list = new InitiativeList(zone);
zone.setInitiativeList(list);
} // endif
// Set the list and actions
setList(list);
displayList.getSelectionModel().clearSelection();
updateView();
}
代码示例来源:origin: RPTools/maptool
public void actionPerformed(ActionEvent e) {
List<DrawnElement> drawableList = renderer.getZone().getAllDrawnElements();
Iterator<DrawnElement> iter = drawableList.iterator();
while (iter.hasNext()) {
DrawnElement de = iter.next();
if (selectedDrawSet.contains(de.getDrawable().getId())) {
renderer.getZone().removeDrawable(de.getDrawable().getId());
renderer.getZone().addDrawableRear(de);
}
}
// horrid kludge needed to redraw zone :(
for (DrawnElement de : renderer.getZone().getAllDrawnElements()) {
MapTool.serverCommand().undoDraw(renderer.getZone().getId(), de.getDrawable().getId());
MapTool.serverCommand().draw(renderer.getZone().getId(), de.getPen(), de.getDrawable());
}
MapTool.getFrame().updateDrawTree();
MapTool.getFrame().refresh();
}
}
代码示例来源:origin: RPTools/maptool
if ((map.zone.getExposedArea() != null && !map.zone.getExposedArea().isEmpty())
|| (map.zone.getExposedAreaMetaData() != null && !map.zone.getExposedAreaMetaData().isEmpty())) {
boolean ok = MapTool.confirm("<html>Map contains exposed areas of fog.<br>Do you want to reset all of the fog?");
if (ok == true) {
map.zone.clearExposedArea();
代码示例来源:origin: RPTools/maptool
/**
* Note: When adding new fields to this class, make sure to update all
* constructors, {@link #imported()}, {@link #readResolve()}, and
* potentially {@link #optimize()}.
*/
public Zone() {
// TODO: Was this needed?
// setGrid(new SquareGrid());
undo = new UndoPerZone(this); // registers as ModelChangeListener for drawables...
addModelChangeListener(undo);
}
代码示例来源:origin: RPTools/maptool
public static void exposePCArea(ZoneRenderer renderer) {
Set<GUID> tokenSet = new HashSet<GUID>();
List<Token> tokList = renderer.getZone().getPlayerTokens();
String playerName = MapTool.getPlayer().getName();
boolean isGM = MapTool.getPlayer().getRole() == Role.GM;
for (Token token : tokList) {
if (!token.getHasSight()) {
continue;
}
boolean owner = token.isOwner(playerName) || isGM;
if ((!MapTool.isPersonalServer() || MapTool.getServerPolicy().isUseIndividualViews()) && !owner) {
continue;
}
tokenSet.add(token.getId());
}
renderer.getZone().clearExposedArea(); // Was clearExposedArea(tokenSet)
exposeVisibleArea(renderer, tokenSet);
}
代码示例来源:origin: RPTools/maptool
public void testConversion() throws Exception {
ZoneRenderer renderer = ZoneRendererFactory.newRenderer(new Zone());
renderer.moveViewBy(-100, -100);
for (int i = -10; i < 10; i++) {
for (int j = -10; j < 10; j++) {
ZonePoint zp = new ZonePoint(i, j);
assertEquals(zp, ScreenPoint.fromZonePoint(renderer, zp).convertToZone(renderer));
}
}
}
}
代码示例来源:origin: RPTools/maptool
public void draw(GUID zoneGUID, Pen pen, Drawable drawable) {
server.getConnection().broadcastCallMethod(ClientCommand.COMMAND.draw.name(), RPCContext.getCurrent().parameters);
Zone zone = server.getCampaign().getZone(zoneGUID);
zone.addDrawable(new DrawnElement(drawable, pen));
}
代码示例来源:origin: RPTools/maptool
/**
* Clear out any drawables that are hidden/erased. This is an optimization
* step that should only happen when you can't undo your changes and
* re-expose a drawable, typically at load.
*/
private void collapseDrawables() {
collapseDrawableLayer(drawables);
collapseDrawableLayer(gmDrawables);
collapseDrawableLayer(objectDrawables);
collapseDrawableLayer(backgroundDrawables);
}
代码示例来源:origin: RPTools/maptool
public void addTopology(GUID zoneGUID, Area area) {
Zone zone = server.getCampaign().getZone(zoneGUID);
zone.addTopology(area);
forwardToClients();
}
在类中实现 NSCopying 的此方法以启用复制时,区域参数使用什么?如果我设置一个新对象,我不需要用 allocWithZone 来分配它,因为 alloc 就足够了......我很困惑.....
本文整理了Java中io.sphere.sdk.zones.Zone.getLocations()方法的一些代码示例,展示了Zone.getLocations()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中io.sphere.sdk.zones.Zone.getId()方法的一些代码示例,展示了Zone.getId()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中io.sphere.sdk.zones.Zone.referenceTypeId()方法的一些代码示例,展示了Zone.referenceTypeId()的具体用法。这些代码示例主
本文整理了Java中io.kaif.model.zone.Zone.valueOf()方法的一些代码示例,展示了Zone.valueOf()的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中io.kaif.model.zone.Zone.tryFallback()方法的一些代码示例,展示了Zone.tryFallback()的具体用法。这些代码示例主要来源于Githu
我的数据库中恰好有包含 timestamp without time zone 列的表。现在我需要根据时区比较它们。 我可以这样做: select my_timestamp::timestamp wi
我正在尝试 Angular 2。但是在将 zone.js 作为全局变量导入后出现此错误: 我的包及其版本: "dependencies": { "angular2": "2.0.0-beta.
可能我问这个问题已经太晚了,但无论如何。 有人可以解释一下在什么情况下我需要导入区域的补丁 - zone.js/dist/zone-patch-rxjs。据我所知,补丁已添加到此 PR 中(this
问题很简短:如果我已经在没有时区的时间戳类型的列中有数据,如果我将类型设置为带时区的时间戳,postgresql 将如何处理这些数据? 最佳答案 它将当前值保留在本地时间并将时区设置为本地时间的偏移量
我有一个在东部时区的时间,但我想将它调整为中部时区。两个时区都在美国。我从来没有这样做过?我不知道如何转换它。请帮帮我好吗? 最佳答案 这是一种可能的方法: $dt = new DateTime('2
我在 Angular 11 上有一个应用程序刚刚开始在所有浏览器、所有环境(本地/暂存/生产)上同时出现错误(大约一个小时前,没有任何更新或任何东西): Uncaught TypeError: t.g
我们有一个函数,可以像 JS 一样解析 UTC 中的日期/时间对,但随后强制它的行为就像在本地时区中指定的一样。如下: var tz = (new Date()).toString().match(/
我很难理解 "AT TIME ZONE 'localtime'" 究竟是如何工作的?通过使用它,我发现它的行为与 "AT TIME ZONE 'UTC'" 完全一样......但是为什么呢? "loc
我在 PostgreSQL 9.3 ALTER TABLE manual page 中找到了这个 ALTER COLUMN 语句: ALTER TABLE audits ALTER COLUM
首先,我意识到不推荐使用 time with time zone。我要使用它是因为我将多个 time with time zone 值与我当前的系统时间进行比较,而不管是哪一天。 IE。用户说每天 0
在 Rails 控制台中: > ActiveSupport::TimeZone['Samoa'].utc_offset => -39600 > ActiveSupport::TimeZone['Sam
我在两个不同的数据库中运行了相同的语句:我的本地数据库和 Oracle Live SQL . CREATE TABLE test( timestamp TIMESTAMP DEFAULT SY
我在两个不同的数据库中运行了相同的语句:我的本地数据库和 Oracle Live SQL . CREATE TABLE test( timestamp TIMESTAMP DEFAULT SY
在 Rails 3.0.10 中,我使用 Time.zone 来更改用户查看美国各地发布的类(class)时间的方式。然而,更改时区似乎并不像我期望的那样 Time.zone = TZInfo::Ti
我是一名优秀的程序员,十分优秀!