slight improvement in car and loco manager
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.28</version>
|
<version>0.11.29</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>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ add action : Aktion hinzufügen
|
|||||||
add car\: : Waggon hinzufügen:
|
add car\: : Waggon hinzufügen:
|
||||||
Add condition : Bedingung hinzufügen
|
Add condition : Bedingung hinzufügen
|
||||||
add locomotive\: : Lok hinzufügen:
|
add locomotive\: : Lok hinzufügen:
|
||||||
|
add new car : neuen Waggon anlegen
|
||||||
add new locomotive : neue Lok anlegen
|
add new locomotive : neue Lok anlegen
|
||||||
add new train : neuen Zug anlegen
|
add new train : neuen Zug anlegen
|
||||||
Add tile : Kachel hinzufügen
|
Add tile : Kachel hinzufügen
|
||||||
@@ -55,9 +56,11 @@ FreeStartBlock : Start-Block freigeben
|
|||||||
Hardware settings : Hardware-Einstellungen
|
Hardware settings : Hardware-Einstellungen
|
||||||
Height : Höhe
|
Height : Höhe
|
||||||
Help : Hilfe
|
Help : Hilfe
|
||||||
(id: {}, length: {}) : (Id: {}, Länge: {})
|
(id\: {}, length\: {}) : (Id: {}, Länge: {})
|
||||||
if ({})\: : falls ({}):
|
if ({})\: : falls ({}):
|
||||||
inverted : invertiert
|
inverted : invertiert
|
||||||
|
known cars : bekannte Waggons
|
||||||
|
known locomotives : bekannte Lokomotiven
|
||||||
learn : lernen
|
learn : lernen
|
||||||
LEFT : links
|
LEFT : links
|
||||||
Left port\: : Port für links
|
Left port\: : Port für links
|
||||||
@@ -72,6 +75,7 @@ Maximum train length\: : maximale Zug-Länge
|
|||||||
Minimum and maximum times (in Miliseconds) trains with the respective tag have to wait in this block. : Minamle und maximale Block-Haltezeit (in Millisekunden) für Züge mit der entsprchender Markierung.
|
Minimum and maximum times (in Miliseconds) trains with the respective tag have to wait in this block. : Minamle und maximale Block-Haltezeit (in Millisekunden) für Züge mit der entsprchender Markierung.
|
||||||
Move tiles : Kacheln verschieben
|
Move tiles : Kacheln verschieben
|
||||||
name\: : Name:
|
name\: : Name:
|
||||||
|
new car : neuer Waggon
|
||||||
new locomotive : neue Lok
|
new locomotive : neue Lok
|
||||||
new tag : neue Markierung
|
new tag : neue Markierung
|
||||||
new train : neuer Zug
|
new train : neuer Zug
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import de.srsoftware.web4rail.tags.Form;
|
|||||||
import de.srsoftware.web4rail.tags.Input;
|
import de.srsoftware.web4rail.tags.Input;
|
||||||
import de.srsoftware.web4rail.tags.Label;
|
import de.srsoftware.web4rail.tags.Label;
|
||||||
|
|
||||||
public class Car extends BaseClass {
|
public class Car extends BaseClass implements Comparable<Car>{
|
||||||
protected static final Logger LOG = LoggerFactory.getLogger(Car.class);
|
protected static final Logger LOG = LoggerFactory.getLogger(Car.class);
|
||||||
static HashMap<Integer,Car> cars = new HashMap<Integer, Car>();
|
static HashMap<Integer,Car> cars = new HashMap<Integer, Car>();
|
||||||
|
|
||||||
@@ -78,29 +78,6 @@ public class Car extends BaseClass {
|
|||||||
return t("Unknown action: {}",params.get(ACTION));
|
return t("Unknown action: {}",params.get(ACTION));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object manager() {
|
|
||||||
Window win = new Window("car-manager", t("Car manager"));
|
|
||||||
new Tag("h4").content(t("known cars")).addTo(win);
|
|
||||||
Tag list = new Tag("ul");
|
|
||||||
for (Car car : cars.values()) {
|
|
||||||
if (!(car instanceof Locomotive)) {
|
|
||||||
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);
|
|
||||||
|
|
||||||
Form form = new Form();
|
|
||||||
new Input(ACTION, ACTION_ADD).hideIn(form);
|
|
||||||
new Input(REALM,REALM_CAR).hideIn(form);
|
|
||||||
Fieldset fieldset = new Fieldset(t("add new car"));
|
|
||||||
new Input(Locomotive.NAME, t("new car")).addTo(new Label(t("Name:")+NBSP)).addTo(fieldset);
|
|
||||||
new Button(t("Apply")).addTo(fieldset);
|
|
||||||
fieldset.addTo(form).addTo(win);
|
|
||||||
return win;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Tag cockpit() {
|
protected Tag cockpit() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -160,6 +137,29 @@ public class Car extends BaseClass {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object manager() {
|
||||||
|
Window win = new Window("car-manager", t("Car manager"));
|
||||||
|
new Tag("h4").content(t("known cars")).addTo(win);
|
||||||
|
Tag list = new Tag("ul");
|
||||||
|
for (Car car : new TreeSet<Car>(cars.values())) {
|
||||||
|
if (!(car instanceof Locomotive)) {
|
||||||
|
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);
|
||||||
|
|
||||||
|
Form form = new Form();
|
||||||
|
new Input(ACTION, ACTION_ADD).hideIn(form);
|
||||||
|
new Input(REALM,REALM_CAR).hideIn(form);
|
||||||
|
Fieldset fieldset = new Fieldset(t("add new car"));
|
||||||
|
new Input(Locomotive.NAME, t("new car")).addTo(new Label(t("Name:")+NBSP)).addTo(fieldset);
|
||||||
|
new Button(t("Apply")).addTo(fieldset);
|
||||||
|
fieldset.addTo(form).addTo(win);
|
||||||
|
return win;
|
||||||
|
}
|
||||||
|
|
||||||
String name(){
|
String name(){
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@@ -246,4 +246,9 @@ public class Car extends BaseClass {
|
|||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Car o) {
|
||||||
|
return (stockId+":"+name).compareTo(o.stockId+":"+o.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package de.srsoftware.web4rail.moving;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.TreeSet;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -201,7 +202,7 @@ public class Locomotive extends Car implements Constants,Device{
|
|||||||
Window win = new Window("loco-manager", t("Locomotive manager"));
|
Window win = new Window("loco-manager", t("Locomotive manager"));
|
||||||
new Tag("h4").content(t("known locomotives")).addTo(win);
|
new Tag("h4").content(t("known locomotives")).addTo(win);
|
||||||
Tag list = new Tag("ul");
|
Tag list = new Tag("ul");
|
||||||
for (Car 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");
|
Tag tag = loco.link("li");
|
||||||
|
|||||||
Reference in New Issue
Block a user