introduced length units

This commit is contained in:
Stephan Richter
2020-11-28 17:01:02 +01:00
parent df529aaba4
commit 1df8bfb822
9 changed files with 18 additions and 10 deletions

View File

@@ -180,7 +180,7 @@ public class Car extends BaseClass implements Comparable<Car>{
car.stockId,
car.link(),
car.maxSpeed == 0 ? "":(car.maxSpeed+NBSP+speedUnit),
car.length,
car.length+NBSP+lengthUnit,
String.join(", ", car.tags()),
car.cloneButton()
));
@@ -221,7 +221,7 @@ public class Car extends BaseClass implements Comparable<Car>{
Fieldset fieldset = new Fieldset("Basic properties");
new Input(NAME,name).addTo(new Label(t("Name")+NBSP)).addTo(fieldset);
new Input(STOCK_ID,stockId).addTo(new Label(t("Stock ID")+NBSP)).addTo(fieldset);
new Input(LENGTH,length).attr("type", "number").addTo(new Label(t("Length")+NBSP)).addTo(fieldset);
new Input(LENGTH,length).attr("type", "number").addTo(new Label(t("Length")+NBSP)).content(NBSP+lengthUnit).addTo(fieldset);
new Input(TAGS,String.join(", ", tags)).addTo(new Label(t("Tags")+NBSP)).addTo(fieldset);
new Input(MAX_SPEED, maxSpeed).numeric().addTo(new Label(t("Maximum speed")+":"+NBSP)).content(NBSP+speedUnit).addTo(fieldset);
fieldset.addTo(form);

View File

@@ -239,7 +239,7 @@ public class Locomotive extends Car implements Constants,Device{
.map(car -> (Locomotive)car)
.sorted(Comparator.comparing(loco -> loco.address))
.sorted(Comparator.comparing(loco -> loco.stockId))
.forEach(loco -> table.addRow(loco.stockId,loco.link(),loco.maxSpeed == 0 ? "":loco.maxSpeed+NBSP+speedUnit,loco.proto,loco.address,loco.length,String.join(", ", loco.tags())));
.forEach(loco -> table.addRow(loco.stockId,loco.link(),loco.maxSpeed == 0 ? "":loco.maxSpeed+NBSP+speedUnit,loco.proto,loco.address,loco.length+NBSP+lengthUnit,String.join(", ", loco.tags())));
table.addTo(win);

View File

@@ -458,7 +458,7 @@ public class Train extends BaseClass implements Comparable<Train> {
int ms = train.maxSpeed();
table.addRow(
train.link(),
train.length(),
train.length()+NBSP+lengthUnit,
ms == Integer.MAX_VALUE ? "" : ms+NBSP+speedUnit,
String.join(", ", train.tags()),
train.route,