GUI improvements
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>0.9.17</version>
|
||||
<version>0.9.18</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -8,8 +8,11 @@ add car\: : Waggon hinzufügen:
|
||||
Add condition : Bedingung hinzufügen
|
||||
add locomotive\: : Lok hinzufügen:
|
||||
Add tile : Kachel hinzufügen
|
||||
Address\: : Adresse:
|
||||
Analyze plan : Plan analysieren
|
||||
Apply : Übernehmen
|
||||
Availability : Verfügbarkeit
|
||||
Block properties : Block-Eigenschaften
|
||||
Cars\: : Waggons:
|
||||
ConditionalAction : bedingte Aktion
|
||||
Conditions : Bedingungen
|
||||
@@ -23,13 +26,18 @@ delete : entfernen
|
||||
delete route : Route löschen
|
||||
Destination\: {} from {} : Ziel: {} von {}
|
||||
disabled : deaktiviert
|
||||
EAST : Osten
|
||||
editable train properties : veränderliche Zug-Eigenschaften
|
||||
Emergency : Notfall
|
||||
FinishRoute : Route abschließen
|
||||
FreeStartBlock : Start-Block freigeben
|
||||
Hardware settings : Hardware-Einstellungen
|
||||
Help : Hilfe
|
||||
inverted : invertiert
|
||||
learn : lernen
|
||||
LEFT : links
|
||||
Left port\: : Port für links
|
||||
Length : Länge
|
||||
length\: : Länge:
|
||||
length\: {} : Länge: {}
|
||||
Locomotives\: : Lokomotiven:
|
||||
@@ -39,7 +47,10 @@ Manage trains : Züge verwalten
|
||||
Maximum train length\: : maximale Zug-Länge
|
||||
Move tiles : Kacheln verschieben
|
||||
name\: : Name:
|
||||
No : keine
|
||||
No free routes from {} : keine Route von {} frei
|
||||
NORTH : Norden
|
||||
One way\: : Richtung:
|
||||
Online Documentation : Online-Dokumentation
|
||||
other train properties : andere Zug-Eigenschaften
|
||||
Origin and destination : Start und Ziel
|
||||
@@ -54,6 +65,7 @@ Push-pull train : Wendezug
|
||||
Reduce speed to {} km/h : Geschwindigkeit auf {} km/h reduzieren
|
||||
Report Issue : Problem melden
|
||||
RIGHT : rechts
|
||||
Right port\: : Port für rechts
|
||||
Routes using this tile\: : Fahrstraßen, die diesen Abschnitt verwenden:
|
||||
Route will only be available to trains fulfilling all conditions. : Route ist nur für Züge verfügbar, die alle Bedingungen erfüllen.
|
||||
save : speichern
|
||||
@@ -63,8 +75,10 @@ SetSignalsToStop : Signale auf Halt stellen
|
||||
SetSpeed : Geschwindigkeit ändern
|
||||
Setup actions : Aktivierungs-Aktionen
|
||||
Signals : Signale
|
||||
SOUTH : Süden
|
||||
Started {} : {} gestartet
|
||||
StopAuto : Automatikmodus abschalten
|
||||
Straight port\: : Port für gerade
|
||||
STRAIGHT : gerade
|
||||
Tags : Markierungen
|
||||
Toggle power : Stom an/ausschalten
|
||||
@@ -89,3 +103,4 @@ Was not able to assign {} to {}! : Konnte {} nicht an {} zuweisen!
|
||||
Was not able to lock {} : Konnte {} nicht reservieren
|
||||
Was not able to set all signals! : Konnte nicht alle Signale stellen!
|
||||
Was not able to set all turnouts! : Konnte nicht alle Weichen stellen!
|
||||
WEST : Westen
|
||||
@@ -493,6 +493,7 @@ public class Train implements Comparable<Train>,Constants {
|
||||
|
||||
if (!route.lock()) return t("Was not able to lock {}",route);
|
||||
String error = null;
|
||||
if (direction != route.startDirection) turn();
|
||||
if (!route.setTurnouts()) error = t("Was not able to set all turnouts!");
|
||||
route.fireSetupActions(context);
|
||||
if (error == null && !route.setSignals(null)) error = t("Was not able to set all signals!");
|
||||
|
||||
@@ -61,8 +61,9 @@ public abstract class Block extends StretchableTile{
|
||||
@Override
|
||||
public Tag propForm(String id) {
|
||||
Tag form = super.propForm(id);
|
||||
new Tag("h4").content(t("Block properties")).addTo(form);
|
||||
|
||||
new Input(NAME, name).addTo(new Label(t("name:")+" ")).addTo(new Tag("p")).addTo(form);
|
||||
new Input(NAME, name).addTo(new Label(t("name:")+NBSP)).addTo(new Tag("p")).addTo(form);
|
||||
|
||||
new Checkbox(ALLOW_TURN,t("Turn allowed"),turnAllowed).addTo(new Tag("p")).addTo(form);
|
||||
|
||||
@@ -115,7 +116,6 @@ public abstract class Block extends StretchableTile{
|
||||
|
||||
@Override
|
||||
public Tile update(HashMap<String, String> params) throws IOException {
|
||||
super.update(params);
|
||||
if (params.containsKey(NAME)) name=params.get(NAME);
|
||||
if (params.containsKey(TRAIN)) {
|
||||
int trainId = Integer.parseInt(params.get(TRAIN));
|
||||
@@ -127,6 +127,6 @@ public abstract class Block extends StretchableTile{
|
||||
}
|
||||
}
|
||||
turnAllowed = params.containsKey(ALLOW_TURN) && params.get(ALLOW_TURN).equals("on");
|
||||
return this;
|
||||
return super.update(params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ public abstract class StretchableTile extends Tile {
|
||||
@Override
|
||||
public Tag propForm(String id) {
|
||||
Tag form = super.propForm(id);
|
||||
|
||||
Tag label = new Tag("label").content(t("length:"));
|
||||
new Tag("h4").content(t("Length")).addTo(form);
|
||||
Tag label = new Tag("label").content(t("length:")+NBSP);
|
||||
new Tag("input").attr("type", "number").attr("name","length").attr("value", length).addTo(label);
|
||||
label.addTo(new Tag("p")).addTo(form);
|
||||
|
||||
@@ -58,7 +58,6 @@ public abstract class StretchableTile extends Tile {
|
||||
|
||||
@Override
|
||||
public Tile update(HashMap<String, String> params) throws IOException {
|
||||
super.update(params);
|
||||
for (Entry<String, String> entry : params.entrySet()) {
|
||||
switch (entry.getKey()) {
|
||||
case LENGTH:
|
||||
@@ -66,6 +65,6 @@ public abstract class StretchableTile extends Tile {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
return super.update(params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,14 +207,10 @@ public abstract class Tile implements Constants{
|
||||
Window window = new Window("tile-properties",t("Properties of {} @ ({},{})",title(),x,y));
|
||||
String formId = "tile-properties-"+id();
|
||||
Tag form = propForm(formId);
|
||||
if (form!=null && form.children().size()>3) {
|
||||
new Checkbox(DISABLED, t("disabled"), disabled).addTo(form);
|
||||
|
||||
new Button(t("Apply"),"submitForm('"+formId+"')").addTo(form);
|
||||
form.addTo(window);
|
||||
} else {
|
||||
window.content(t("This tile ({}) has no editable properties",getClass().getSimpleName()));
|
||||
}
|
||||
new Tag("h4").content(t("Availability")).addTo(form);
|
||||
new Checkbox(DISABLED, t("disabled"), disabled).addTo(form);
|
||||
new Button(t("Apply"),"submitForm('"+formId+"')").addTo(form);
|
||||
form.addTo(window);
|
||||
|
||||
if (route != null) {
|
||||
new Tag("p").content(t("Locked by {}",route)).addTo(window);
|
||||
|
||||
@@ -56,6 +56,7 @@ public abstract class Turnout extends Tile implements Device{
|
||||
}
|
||||
|
||||
protected Reply init() {
|
||||
if (address == 0) return new Reply(200,"OK");
|
||||
if (!initialized) {
|
||||
Command command = new Command("INIT {} GA "+address+" "+proto()) {
|
||||
|
||||
@@ -109,7 +110,7 @@ public abstract class Turnout extends Tile implements Device{
|
||||
new Radio(PROTOCOL, proto.toString(), t(proto.toString()), proto == this.protocol).addTo(protocol);
|
||||
}
|
||||
protocol.addTo(fieldset).addTo(form);
|
||||
new Input(ADDRESS, address).numeric().addTo(new Label(t("Address"))).addTo(fieldset);
|
||||
new Input(ADDRESS, address).numeric().addTo(new Label(t("Address:")+NBSP)).addTo(fieldset);
|
||||
return form;
|
||||
}
|
||||
|
||||
@@ -137,9 +138,13 @@ public abstract class Turnout extends Tile implements Device{
|
||||
Reply reply = init();
|
||||
if (reply != null && !reply.succeeded()) return reply;
|
||||
LOG.debug("Setting {} to {}",this,newState);
|
||||
if (address == 0) {
|
||||
state = newState;
|
||||
plan.place(this);
|
||||
return new Reply(200,"OK");
|
||||
}
|
||||
try {
|
||||
String cmd = commandFor(newState);
|
||||
return plan.queue(new Command(cmd) {
|
||||
return plan.queue(new Command(commandFor(newState)) {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
@@ -43,8 +43,8 @@ public class TurnoutL extends Turnout {
|
||||
break;
|
||||
}
|
||||
}
|
||||
new Input(STRAIGHT, portA).numeric().addTo(new Label(t("Straight port"))).addTo(fieldset);
|
||||
new Input(LEFT, portB).numeric().addTo(new Label(t("Left port"))).addTo(fieldset);
|
||||
new Input(STRAIGHT, portA).numeric().addTo(new Label(t("Straight port:")+NBSP)).addTo(fieldset);
|
||||
new Input(LEFT, portB).numeric().addTo(new Label(t("Left port:")+NBSP)).addTo(fieldset);
|
||||
return form;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ public class TurnoutR extends Turnout {
|
||||
break;
|
||||
}
|
||||
}
|
||||
new Input(STRAIGHT, portA).numeric().addTo(new Label(t("Straight port"))).addTo(fieldset);
|
||||
new Input(RIGHT, portB).numeric().addTo(new Label(t("Right port"))).addTo(fieldset);
|
||||
new Input(STRAIGHT, portA).numeric().addTo(new Label(t("Straight port:")+NBSP)).addTo(fieldset);
|
||||
new Input(RIGHT, portB).numeric().addTo(new Label(t("Right port:")+NBSP)).addTo(fieldset);
|
||||
return form;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user