public Set<Action> actions(Object s) {
Set<Action> result = new LinkedHashSet<Action>();
MapNode from = (MapNode) s;
for (WayRef wref : from.getWayRefs()) {
if (filter == null || filter.isAccepted(wref.getWay())) {
MapWay way = wref.getWay();
int nodeIdx = wref.getNodeIdx();
List<MapNode> wayNodes = way.getNodes();
MapNode to;
for (int idx = nodeIdx + 1; idx < wayNodes.size(); idx++) {
to = wayNodes.get(idx);
if (goal == null || goal == to
|| to.getWayRefs().size() > 1
|| idx == wayNodes.size() - 1) {
result.add(new OsmMoveAction(way, from, to));
break;
}
}
if (!way.isOneway() || ignoreOneWays) {
for (int idx = nodeIdx - 1; idx >= 0; idx--) {
to = wayNodes.get(idx);
if (goal == null || goal == to
|| to.getWayRefs().size() > 1 || idx == 0) {
result.add(new OsmMoveAction(way, from, to));