Module RandomTrainSimWorld2.main
Class MainController
java.lang.Object
com.github.freddyyj.randomtrainsimworld.gui.MainController
public class MainController extends Object
Main controller of
Main.
Call setRandom(Random) to set random object to your custom class.-
Constructor Summary
Constructors Constructor Description MainController()default constructor -
Method Summary
Modifier and Type Method Description protected VBoxgetLocoBoxByID(String routeId)protected CheckBoxgetLocoByName(String name, String route)Get locomotiveCheckBoxwith locomotive name and route name.protected CheckBoxgetRouteByName(String name)Get routeCheckBoxwith route name.protected CheckBoxgetRouteByVBox(VBox locoId)protected CheckBoxgetWeatherByName(String name)Get weatherCheckBoxwith weather name.protected voidonCheckLocoSelect(ActionEvent e)protected voidonCheckRouteClick(MouseEvent e)protected voidonCheckRouteSelect(ActionEvent e)protected voidonCheckWeatherSelect(ActionEvent e)protected voidonClose(ActionEvent e)protected voidonHelp(ActionEvent e)protected voidonLoad(ActionEvent e)protected voidonRandomAll(ActionEvent e)protected voidonRandomLoco(ActionEvent e)protected voidonRandomRoute(ActionEvent e)protected voidonRandomWeather(ActionEvent e)protected voidonSave(ActionEvent e)protected voidonSaveAs(ActionEvent e)protected voidonShortcut(KeyEvent e)voidreload(SaveLoco save)Reload selection ofCheckBoxs of routes, locomotives and weathers.voidsetRandom(Random random)Set random class.
-
Constructor Details
-
MainController
public MainController()default constructor
-
-
Method Details
-
setRandom
Set random class.If you want to set custom random class, call
Main.Main.controller.setRandom(Random).- Parameters:
random- extendedRandomobject
-
onCheckRouteClick
-
onRandomAll
-
onRandomRoute
-
onRandomLoco
-
onRandomWeather
-
onCheckLocoSelect
-
onCheckRouteSelect
-
onCheckWeatherSelect
-
onSaveAs
-
onLoad
-
onSave
-
onClose
-
onHelp
-
onShortcut
-
reload
Reload selection ofCheckBoxs of routes, locomotives and weathers.- Parameters:
save- aSaveLocoobject
-
getLocoBoxByID
-
getRouteByVBox
-
getRouteByName
Get routeCheckBoxwith route name.- Parameters:
name- route name- Returns:
- route
CheckBox
-
getLocoByName
Get locomotiveCheckBoxwith locomotive name and route name.- Parameters:
name- locomotive nameroute- route name- Returns:
- locomotive
CheckBox
-
getWeatherByName
Get weatherCheckBoxwith weather name.- Parameters:
name- weather name- Returns:
- weather
CheckBox
-