prepared route search
This commit is contained in:
10
src/main/java/de/srsoftware/web4rail/tiles/Block.java
Normal file
10
src/main/java/de/srsoftware/web4rail/tiles/Block.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package de.srsoftware.web4rail.tiles;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import de.srsoftware.web4rail.Route;
|
||||
import de.srsoftware.web4rail.tiles.StretchableTile;
|
||||
|
||||
public abstract class Block extends StretchableTile{
|
||||
public abstract Set<Route> routes();
|
||||
}
|
||||
@@ -3,12 +3,14 @@ package de.srsoftware.web4rail.tiles;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import de.srsoftware.tools.Tag;
|
||||
import de.srsoftware.web4rail.Route;
|
||||
|
||||
public class BlockH extends StraightH{
|
||||
public class BlockH extends Block{
|
||||
private static final String NAME = "name";
|
||||
Contact north,center,south;
|
||||
private String name = "Block";
|
||||
@@ -26,6 +28,10 @@ public class BlockH extends StraightH{
|
||||
if (config.has(NAME)) name = config.getString(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int len() {
|
||||
return length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag propForm() {
|
||||
@@ -38,6 +44,11 @@ public class BlockH extends StraightH{
|
||||
return form;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Route> routes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag tag(Map<String, Object> replacements) throws IOException {
|
||||
if (replacements == null) replacements = new HashMap<String, Object>();
|
||||
@@ -45,6 +56,11 @@ public class BlockH extends StraightH{
|
||||
return super.tag(replacements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName()+"("+name+") @ ("+x+","+y+")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tile update(HashMap<String, String> params) {
|
||||
super.update(params);
|
||||
|
||||
@@ -3,12 +3,14 @@ package de.srsoftware.web4rail.tiles;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import de.srsoftware.tools.Tag;
|
||||
import de.srsoftware.web4rail.Route;
|
||||
|
||||
public class BlockV extends StraightV{
|
||||
public class BlockV extends Block{
|
||||
private static final String NAME = "name";
|
||||
Contact west,center,east;
|
||||
private String name = "Block";
|
||||
@@ -26,6 +28,10 @@ public class BlockV extends StraightV{
|
||||
if (config.has(NAME)) name = config.getString(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int height() {
|
||||
return length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag propForm() {
|
||||
@@ -38,6 +44,11 @@ public class BlockV extends StraightV{
|
||||
return form;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Route> routes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag tag(Map<String, Object> replacements) throws IOException {
|
||||
if (replacements == null) replacements = new HashMap<String, Object>();
|
||||
@@ -45,6 +56,11 @@ public class BlockV extends StraightV{
|
||||
return super.tag(replacements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName()+"("+name+") @ ("+x+","+y+")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tile update(HashMap<String, String> params) {
|
||||
super.update(params);
|
||||
|
||||
Reference in New Issue
Block a user