searchedTurnout = turnoutPersistence
.getTurnoutByNumber(enteredNumber);
if (searchedTurnout == null) {
return;
}
TurnoutControlIface turnoutControl = AdHocRailway.getInstance()
.getTurnoutControl();
if (this instanceof CurvedLeftAction) {
turnoutControl.setCurvedLeft(searchedTurnout);
} else if (this instanceof StraightAction) {
turnoutControl.setStraight(searchedTurnout);
} else if (this instanceof CurvedRightAction) {
turnoutControl.setCurvedRight(searchedTurnout);
} else if (this instanceof EnableRouteAction) {
if (!searchedTurnout.isThreeWay()) {
turnoutControl.setNonDefaultState(searchedTurnout);
}
} else if (this instanceof DisableRouteAction) {
if (!searchedTurnout.isThreeWay()) {
turnoutControl.setDefaultState(searchedTurnout);
}
}
updateHistory(searchedTurnout);
}