improved train access
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>1.0.17</version>
|
<version>1.0.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>
|
||||||
|
|||||||
@@ -592,6 +592,11 @@ public class Plan extends BaseClass{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Window properties(HashMap<String, String> params) {
|
private Window properties(HashMap<String, String> params) {
|
||||||
|
if (params.containsKey(ID)) {
|
||||||
|
Tile tile = get(params.get(ID), true);
|
||||||
|
if (isSet(tile)) return tile.propMenu();
|
||||||
|
}
|
||||||
|
|
||||||
Window win = new Window("plan-properties", t("Properties"));
|
Window win = new Window("plan-properties", t("Properties"));
|
||||||
Form form = new Form("plan-properties-form");
|
Form form = new Form("plan-properties-form");
|
||||||
new Input(REALM,REALM_PLAN).hideIn(form);
|
new Input(REALM,REALM_PLAN).hideIn(form);
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
|
|
||||||
HashMap<String, Object> props = new HashMap<String,Object>(Map.of(REALM,REALM_TRAIN,ID,id));
|
HashMap<String, Object> props = new HashMap<String,Object>(Map.of(REALM,REALM_TRAIN,ID,id));
|
||||||
if (isSet(currentBlock)) {
|
if (isSet(currentBlock)) {
|
||||||
link("li",Map.of(REALM,REALM_PLAN,ID,currentBlock.id(),ACTION,ACTION_CLICK),t("Current location: {}",currentBlock)).addTo(propList);
|
currentBlock.link(currentBlock.toString(),"span").addTo(new Tag("li").content(t("Current location:")+NBSP)).addTo(propList);
|
||||||
Tag actions = new Tag("li").clazz().content(t("Actions:")+NBSP);
|
Tag actions = new Tag("li").clazz().content(t("Actions:")+NBSP);
|
||||||
if (isSet(route)) {
|
if (isSet(route)) {
|
||||||
props.put(ACTION, ACTION_STOP);
|
props.put(ACTION, ACTION_STOP);
|
||||||
|
|||||||
@@ -120,6 +120,12 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
|||||||
|
|
||||||
private Vector<WaitTime> waitTimes = new Vector<WaitTime>();
|
private Vector<WaitTime> waitTimes = new Vector<WaitTime>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object click() throws IOException {
|
||||||
|
if (isSet(train)) return train.props();
|
||||||
|
return super.click();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Block other) {
|
public int compareTo(Block other) {
|
||||||
return name.compareTo(other.name);
|
return name.compareTo(other.name);
|
||||||
@@ -189,7 +195,7 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
|||||||
public Tag link(String...args) {
|
public Tag link(String...args) {
|
||||||
String tx = args.length<1 ? name+NBSP : args[0];
|
String tx = args.length<1 ? name+NBSP : args[0];
|
||||||
String type = args.length<2 ? "span" : args[1];
|
String type = args.length<2 ? "span" : args[1];
|
||||||
return link(type, Map.of(REALM,REALM_PLAN,ID,id(),ACTION,ACTION_CLICK), tx);
|
return link(type, Map.of(REALM,REALM_PLAN,ID,id(),ACTION,ACTION_PROPS), tx).clazz("link","block");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user