preparing menus for editing cars and trains
This commit is contained in:
@@ -2,6 +2,9 @@ package de.srsoftware.web4rail.moving;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import de.srsoftware.tools.Tag;
|
||||
import de.srsoftware.web4rail.Window;
|
||||
|
||||
public class Locomotive extends Car {
|
||||
|
||||
private static final String REVERSE = "reverse";
|
||||
@@ -30,8 +33,23 @@ public class Locomotive extends Car {
|
||||
super.load(json);
|
||||
if (json.has(REVERSE)) reverse = json.getBoolean(REVERSE);
|
||||
}
|
||||
|
||||
public void setSpeed(int v) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public static Object manager() {
|
||||
Window win = new Window("loco-manager", t("Locomotive manager"));
|
||||
new Tag("h4").content(t("known locomotives")).addTo(win);
|
||||
Tag list = new Tag("ul");
|
||||
for (Car car : cars.values()) {
|
||||
if (car instanceof Locomotive) {
|
||||
Locomotive loco = (Locomotive) car;
|
||||
loco.link("li").addTo(list);
|
||||
}
|
||||
}
|
||||
list.addTo(win);
|
||||
return win;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user