further improvement of train management
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.11.31</version>
|
<version>0.11.32</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class Car extends BaseClass implements Comparable<Car>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tag link(String tagClass) {
|
public Tag link(String tagClass) {
|
||||||
return link(tagClass, Map.of(REALM,REALM_CAR,ID,id,ACTION,ACTION_PROPS), name());
|
return link(tagClass, Map.of(REALM,REALM_CAR,ID,id,ACTION,ACTION_PROPS), name()+(stockId.isEmpty()?"":" "+t("(id: {}, length: {})",stockId,length)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Vector<Car> list() {
|
static Vector<Car> list() {
|
||||||
@@ -143,11 +143,7 @@ public class Car extends BaseClass implements Comparable<Car>{
|
|||||||
new Tag("h4").content(t("known cars")).addTo(win);
|
new Tag("h4").content(t("known cars")).addTo(win);
|
||||||
Tag list = new Tag("ul");
|
Tag list = new Tag("ul");
|
||||||
for (Car car : new TreeSet<Car>(cars.values())) {
|
for (Car car : new TreeSet<Car>(cars.values())) {
|
||||||
if (!(car instanceof Locomotive)) {
|
if (!(car instanceof Locomotive)) car.link("li").addTo(list);
|
||||||
Tag tag = car.link("li");
|
|
||||||
if (isSet(car.stockId) && !car.stockId.isEmpty()) tag.content(NBSP+t("(id: {}, length: {})",car.stockId,car.length));
|
|
||||||
tag.addTo(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
list.addTo(win);
|
list.addTo(win);
|
||||||
|
|
||||||
|
|||||||
@@ -209,10 +209,7 @@ public class Locomotive extends Car implements Constants,Device{
|
|||||||
for (Car car : new TreeSet<Car>(cars.values())) {
|
for (Car car : new TreeSet<Car>(cars.values())) {
|
||||||
if (car instanceof Locomotive) {
|
if (car instanceof Locomotive) {
|
||||||
Locomotive loco = (Locomotive) car;
|
Locomotive loco = (Locomotive) car;
|
||||||
Tag tag = loco.link("li");
|
loco.link("li").addTo(list);
|
||||||
if (isSet(loco.stockId) && !loco.stockId.isEmpty()) tag.content(NBSP+t("(id: {}, length: {})",loco.stockId,loco.length));
|
|
||||||
tag.addTo(list);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list.addTo(win);
|
list.addTo(win);
|
||||||
|
|||||||
Reference in New Issue
Block a user