implemented one-way tracks
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.srsoftware</groupId>
|
<groupId>de.srsoftware</groupId>
|
||||||
<artifactId>web4rail</artifactId>
|
<artifactId>web4rail</artifactId>
|
||||||
<version>0.2.0</version>
|
<version>0.3.1</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
<url>https://github.com/StephanRichter/Web4Rail</url>
|
<url>https://github.com/StephanRichter/Web4Rail</url>
|
||||||
|
|||||||
@@ -183,4 +183,9 @@ svg.straight .right{
|
|||||||
|
|
||||||
.active circle{
|
.active circle{
|
||||||
fill: #ffcc88;
|
fill: #ffcc88;
|
||||||
|
}
|
||||||
|
|
||||||
|
polygon.oneway{
|
||||||
|
fill: lime;
|
||||||
|
stroke-width:0;
|
||||||
}
|
}
|
||||||
@@ -5,4 +5,9 @@ public class Locomotive extends Car {
|
|||||||
public Locomotive(String name) {
|
public Locomotive(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSpeed(int v) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,23 +82,25 @@ public class Train {
|
|||||||
|
|
||||||
public void setSpeed(int v) {
|
public void setSpeed(int v) {
|
||||||
LOG.debug("Setting speed to {} kmh.",v);
|
LOG.debug("Setting speed to {} kmh.",v);
|
||||||
|
for (Locomotive loco : locos) loco.setSpeed(v);
|
||||||
this.speed = v;
|
this.speed = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String start() throws IOException {
|
public String start() throws IOException {
|
||||||
if (block == null) return t("{} not in a block",this);
|
if (block == null) return t("{} not in a block",this);
|
||||||
|
if (route != null) route.unlock().setSignals(Signal.STOP);
|
||||||
HashSet<Route> routes = block.routes();
|
HashSet<Route> routes = block.routes();
|
||||||
Vector<Route> availableRoutes = new Vector<Route>();
|
Vector<Route> availableRoutes = new Vector<Route>();
|
||||||
for (Route route : routes) {
|
for (Route rt : routes) {
|
||||||
if (route.path().firstElement() != block) continue; // route does not start with current location of loco
|
if (rt == route) continue; // andere Route als zuvor wählen
|
||||||
if (direction != null && route.startDirection != direction) continue;
|
if (rt.path().firstElement() != block) continue; // keine Route wählen, die nicht vom aktuellen Block des Zuges startet
|
||||||
if (!route.free()) {
|
if (direction != null && rt.startDirection != direction) continue; // keine Routen entgegen der Fahrtrichtung wählen
|
||||||
LOG.debug("{} is not free!",route);
|
if (!rt.free()) { // keine belegten Routen wählen
|
||||||
|
LOG.debug("{} is not free!",rt);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
availableRoutes.add(route);
|
availableRoutes.add(rt);
|
||||||
}
|
}
|
||||||
if (route != null) route.unlock().setSignals(Signal.STOP);
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
if (availableRoutes.isEmpty()) return t("No free routes from {}",block);
|
if (availableRoutes.isEmpty()) return t("No free routes from {}",block);
|
||||||
int sel = rand.nextInt(availableRoutes.size());
|
int sel = rand.nextInt(availableRoutes.size());
|
||||||
|
|||||||
18
src/main/java/de/srsoftware/web4rail/tags/Radio.java
Normal file
18
src/main/java/de/srsoftware/web4rail/tags/Radio.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package de.srsoftware.web4rail.tags;
|
||||||
|
|
||||||
|
import de.srsoftware.tools.Tag;
|
||||||
|
|
||||||
|
public class Radio extends Tag {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7291730168237304236L;
|
||||||
|
|
||||||
|
public Radio(String groupName, String value, String label, boolean preCheck) {
|
||||||
|
super("label");
|
||||||
|
Tag radio = new Tag("input").attr("type", "radio").attr("name", groupName).attr("value", value);
|
||||||
|
if (preCheck) radio.attr("checked", "checked");
|
||||||
|
radio.addTo(this);
|
||||||
|
content(label);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -10,6 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
|||||||
public class ContactH extends Contact {
|
public class ContactH extends Contact {
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case WEST:
|
case WEST:
|
||||||
return Map.of(new Connector(x+1,y,from),State.UNDEF);
|
return Map.of(new Connector(x+1,y,from),State.UNDEF);
|
||||||
@@ -19,4 +21,9 @@ public class ContactH extends Contact {
|
|||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.EAST,Direction.WEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -11,6 +12,7 @@ public class ContactV extends Contact {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
return Map.of(new Connector(x,y+1,from),State.UNDEF);
|
return Map.of(new Connector(x,y+1,from),State.UNDEF);
|
||||||
@@ -20,4 +22,9 @@ public class ContactV extends Contact {
|
|||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.NORTH,Direction.SOUTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -10,6 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
|||||||
public class SignalE extends Signal{
|
public class SignalE extends Signal{
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case WEST:
|
case WEST:
|
||||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||||
@@ -24,4 +26,9 @@ public class SignalE extends Signal{
|
|||||||
public boolean isAffectedFrom(Direction dir) {
|
public boolean isAffectedFrom(Direction dir) {
|
||||||
return dir == Direction.EAST;
|
return dir == Direction.EAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.EAST,Direction.WEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -11,6 +12,7 @@ public class SignalN extends Signal {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
||||||
@@ -25,4 +27,9 @@ public class SignalN extends Signal {
|
|||||||
public boolean isAffectedFrom(Direction dir) {
|
public boolean isAffectedFrom(Direction dir) {
|
||||||
return dir == Direction.NORTH;
|
return dir == Direction.NORTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.NORTH,Direction.SOUTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -11,6 +12,7 @@ public class SignalS extends Signal{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
return Map.of(new Connector(x,y+1,Direction.NORTH),State.UNDEF);
|
||||||
@@ -25,4 +27,9 @@ public class SignalS extends Signal{
|
|||||||
public boolean isAffectedFrom(Direction dir) {
|
public boolean isAffectedFrom(Direction dir) {
|
||||||
return dir == Direction.SOUTH;
|
return dir == Direction.SOUTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.NORTH,Direction.SOUTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -10,6 +11,7 @@ import de.srsoftware.web4rail.tiles.Turnout.State;
|
|||||||
public class SignalW extends Signal{
|
public class SignalW extends Signal{
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case WEST:
|
case WEST:
|
||||||
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
return Map.of(new Connector(x+1,y,Direction.WEST),State.UNDEF);
|
||||||
@@ -24,4 +26,9 @@ public class SignalW extends Signal{
|
|||||||
public boolean isAffectedFrom(Direction dir) {
|
public boolean isAffectedFrom(Direction dir) {
|
||||||
return dir == Direction.WEST;
|
return dir == Direction.WEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.EAST,Direction.WEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -11,6 +12,7 @@ public class StraightH extends StretchableTile{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case WEST:
|
case WEST:
|
||||||
return Map.of(new Connector(x+len(),y,Direction.WEST),State.UNDEF);
|
return Map.of(new Connector(x+len(),y,Direction.WEST),State.UNDEF);
|
||||||
@@ -25,4 +27,9 @@ public class StraightH extends StretchableTile{
|
|||||||
public int len() {
|
public int len() {
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.EAST,Direction.WEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.srsoftware.web4rail.tiles;
|
package de.srsoftware.web4rail.tiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
@@ -11,6 +12,7 @@ public class StraightV extends StretchableTile{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Connector, State> connections(Direction from) {
|
public Map<Connector, State> connections(Direction from) {
|
||||||
|
if (oneWay == from) return new HashMap<>();
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
return Map.of(new Connector(x,y+height(),Direction.NORTH),State.UNDEF);
|
return Map.of(new Connector(x,y+height(),Direction.NORTH),State.UNDEF);
|
||||||
@@ -25,4 +27,9 @@ public class StraightV extends StretchableTile{
|
|||||||
public int height() {
|
public int height() {
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return List.of(Direction.NORTH,Direction.SOUTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,11 @@ import java.io.IOException;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -22,6 +24,7 @@ import de.srsoftware.web4rail.Plan.Direction;
|
|||||||
import de.srsoftware.web4rail.Route;
|
import de.srsoftware.web4rail.Route;
|
||||||
import de.srsoftware.web4rail.Window;
|
import de.srsoftware.web4rail.Window;
|
||||||
import de.srsoftware.web4rail.tags.Form;
|
import de.srsoftware.web4rail.tags.Form;
|
||||||
|
import de.srsoftware.web4rail.tags.Radio;
|
||||||
|
|
||||||
public abstract class Tile {
|
public abstract class Tile {
|
||||||
|
|
||||||
@@ -31,6 +34,7 @@ public abstract class Tile {
|
|||||||
private HashSet<Route> routes = new HashSet<>();
|
private HashSet<Route> routes = new HashSet<>();
|
||||||
protected Plan plan;
|
protected Plan plan;
|
||||||
protected Route route;
|
protected Route route;
|
||||||
|
protected Direction oneWay = null;
|
||||||
|
|
||||||
protected static Logger LOG = LoggerFactory.getLogger(Tile.class);
|
protected static Logger LOG = LoggerFactory.getLogger(Tile.class);
|
||||||
|
|
||||||
@@ -97,11 +101,25 @@ public abstract class Tile {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Direction> possibleDirections() {
|
||||||
|
return new Vector<Plan.Direction>();
|
||||||
|
}
|
||||||
|
|
||||||
public Tag propForm() {
|
public Tag propForm() {
|
||||||
Form form = new Form();
|
Form form = new Form();
|
||||||
new Tag("input").attr("type", "hidden").attr("name","action").attr("value", "update").addTo(form);
|
new Tag("input").attr("type", "hidden").attr("name","action").attr("value", "update").addTo(form);
|
||||||
new Tag("input").attr("type", "hidden").attr("name","x").attr("value", x).addTo(form);
|
new Tag("input").attr("type", "hidden").attr("name","x").attr("value", x).addTo(form);
|
||||||
new Tag("input").attr("type", "hidden").attr("name","y").attr("value", y).addTo(form);
|
new Tag("input").attr("type", "hidden").attr("name","y").attr("value", y).addTo(form);
|
||||||
|
|
||||||
|
List<Direction> pd = possibleDirections();
|
||||||
|
if (!pd.isEmpty()) {
|
||||||
|
new Tag("h4").content(t("One way:")).addTo(form);
|
||||||
|
new Radio("oneway","none",t("No"),oneWay == null).addTo(form);
|
||||||
|
for (Direction d:pd) {
|
||||||
|
Radio radio = new Radio("oneway",d.toString(),t(d.toString()),d == oneWay);
|
||||||
|
radio.addTo(form);
|
||||||
|
}
|
||||||
|
}
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,6 +133,10 @@ public abstract class Tile {
|
|||||||
window.content(t("This tile ({}) has no properties",getClass().getSimpleName()));
|
window.content(t("This tile ({}) has no properties",getClass().getSimpleName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (route != null) {
|
||||||
|
new Tag("p").content(t("Locked by {}",route)).addTo(window);
|
||||||
|
}
|
||||||
|
|
||||||
if (!routes.isEmpty()) {
|
if (!routes.isEmpty()) {
|
||||||
new Tag("h4").content(t("Routes using this tile:")).addTo(window);
|
new Tag("h4").content(t("Routes using this tile:")).addTo(window);
|
||||||
Tag routeList = new Tag("ul");
|
Tag routeList = new Tag("ul");
|
||||||
@@ -166,6 +188,7 @@ public abstract class Tile {
|
|||||||
if (x>-1) style="left: "+(30*x)+"px; top: "+(30*y)+"px;";
|
if (x>-1) style="left: "+(30*x)+"px; top: "+(30*y)+"px;";
|
||||||
if (len()>1) style+=" width: "+(30*len())+"px;";
|
if (len()>1) style+=" width: "+(30*len())+"px;";
|
||||||
if (height()>1) style+=" height: "+(30*height())+"px;";
|
if (height()>1) style+=" height: "+(30*height())+"px;";
|
||||||
|
|
||||||
if (!style.isEmpty()) svg.style(style);
|
if (!style.isEmpty()) svg.style(style);
|
||||||
|
|
||||||
File file = new File(System.getProperty("user.dir")+"/resources/svg/"+getClass().getSimpleName()+".svg");
|
File file = new File(System.getProperty("user.dir")+"/resources/svg/"+getClass().getSimpleName()+".svg");
|
||||||
@@ -182,6 +205,17 @@ public abstract class Tile {
|
|||||||
}
|
}
|
||||||
scanner.close();
|
scanner.close();
|
||||||
svg.content(sb.toString());
|
svg.content(sb.toString());
|
||||||
|
|
||||||
|
if (oneWay != null) {
|
||||||
|
switch (oneWay) {
|
||||||
|
|
||||||
|
case EAST:
|
||||||
|
new Tag("polygon").clazz("oneway").attr("points", "100,50 75,35 75,65").addTo(svg);
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
new Tag("polygon").clazz("oneway").attr("points", "0,50 25,35 25,65").addTo(svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
new Tag("title").content(t("No display defined for this tile ({})",getClass().getSimpleName())).addTo(svg);
|
new Tag("title").content(t("No display defined for this tile ({})",getClass().getSimpleName())).addTo(svg);
|
||||||
new Tag("text")
|
new Tag("text")
|
||||||
@@ -212,6 +246,14 @@ public abstract class Tile {
|
|||||||
|
|
||||||
public Tile update(HashMap<String, String> params) {
|
public Tile update(HashMap<String, String> params) {
|
||||||
LOG.debug("{}.update({})",getClass().getSimpleName(),params);
|
LOG.debug("{}.update({})",getClass().getSimpleName(),params);
|
||||||
|
String oneWayDir = params.get("oneway");
|
||||||
|
if (oneWayDir != null) {
|
||||||
|
try {
|
||||||
|
oneWay = Direction.valueOf(oneWayDir);
|
||||||
|
} catch (Exception e) {
|
||||||
|
oneWay = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user