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