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 VBox
getLocoBoxByID(String routeId)
protected CheckBox
getLocoByName(String name, String route)
Get locomotiveCheckBox
with locomotive name and route name.protected CheckBox
getRouteByName(String name)
Get routeCheckBox
with route name.protected CheckBox
getRouteByVBox(VBox locoId)
protected CheckBox
getWeatherByName(String name)
Get weatherCheckBox
with weather name.protected void
onCheckLocoSelect(ActionEvent e)
protected void
onCheckRouteClick(MouseEvent e)
protected void
onCheckRouteSelect(ActionEvent e)
protected void
onCheckWeatherSelect(ActionEvent e)
protected void
onClose(ActionEvent e)
protected void
onHelp(ActionEvent e)
protected void
onLoad(ActionEvent e)
protected void
onRandomAll(ActionEvent e)
protected void
onRandomLoco(ActionEvent e)
protected void
onRandomRoute(ActionEvent e)
protected void
onRandomWeather(ActionEvent e)
protected void
onSave(ActionEvent e)
protected void
onSaveAs(ActionEvent e)
protected void
onShortcut(KeyEvent e)
void
reload(SaveLoco save)
Reload selection ofCheckBox
s of routes, locomotives and weathers.void
setRandom(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
- extendedRandom
object
-
onCheckRouteClick
-
onRandomAll
-
onRandomRoute
-
onRandomLoco
-
onRandomWeather
-
onCheckLocoSelect
-
onCheckRouteSelect
-
onCheckWeatherSelect
-
onSaveAs
-
onLoad
-
onSave
-
onClose
-
onHelp
-
onShortcut
-
reload
Reload selection ofCheckBox
s of routes, locomotives and weathers.- Parameters:
save
- aSaveLoco
object
-
getLocoBoxByID
-
getRouteByVBox
-
getRouteByName
Get routeCheckBox
with route name.- Parameters:
name
- route name- Returns:
- route
CheckBox
-
getLocoByName
Get locomotiveCheckBox
with locomotive name and route name.- Parameters:
name
- locomotive nameroute
- route name- Returns:
- locomotive
CheckBox
-
getWeatherByName
Get weatherCheckBox
with weather name.- Parameters:
name
- weather name- Returns:
- weather
CheckBox
-