Package pacman.controller
Class SelectController
- java.lang.Object
-
- pacman.controller.SelectController
-
public class SelectController extends java.lang.ObjectSelectController
A
SelectControlleris a controller for ScoreBoard scene.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Song Zhang
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSelectController.LevelListCellFactoryThis is the factory for producing level list cell.private classSelectController.TextureListCellFactoryThis is the factory for producing background and wall list cell.
-
Field Summary
Fields Modifier and Type Field Description private javafx.scene.control.ComboBoxbackgroundComboBoxThe background combobox shown on the screen.private javafx.scene.control.ListViewlevelListViewThe level list shown on the screen.private MapmapTheMapfor storing some configurations.private javafx.scene.control.TextFieldnicknameTextFieldThe nickname text field shown on the screen.private javafx.scene.control.ComboBoxwallComboBoxThe wall combobox shown on the screen.
-
Constructor Summary
Constructors Constructor Description SelectController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidhandleBackClicked()Called when the Back button is clicked.protected voidhandleBackgroundChange()Called when the background combo box is changed.protected voidhandleGoClicked()Called when the Go button is clicked.protected voidhandleLevelChange()Called when the level selection is changed.protected voidhandleNicknameChange()Called when the nickname text field is changed.protected voidhandleWallChange()Called when the wall combo box is changed.private voidinitBackgroundComboBox()Called when the Go button is clicked.voidinitialize()Called when the UI is initialized.private voidinitLevelListView()Initializes the wall combo box.private voidinitWallComboBox()Initializes the wall combo box.
-
-
-
Field Detail
-
backgroundComboBox
private javafx.scene.control.ComboBox backgroundComboBox
The background combobox shown on the screen.
-
wallComboBox
private javafx.scene.control.ComboBox wallComboBox
The wall combobox shown on the screen.
-
levelListView
private javafx.scene.control.ListView levelListView
The level list shown on the screen.
-
nicknameTextField
private javafx.scene.control.TextField nicknameTextField
The nickname text field shown on the screen.
-
-
Method Detail
-
initialize
public void initialize()
Called when the UI is initialized.This method initializes UI and a default configuration in to
map.
-
handleNicknameChange
protected void handleNicknameChange()
Called when the nickname text field is changed.This methods updates the nickname according to user's input.
-
handleBackgroundChange
protected void handleBackgroundChange()
Called when the background combo box is changed.This methods updates the background file name according to user's choice.
-
handleWallChange
protected void handleWallChange()
Called when the wall combo box is changed.This methods updates the wall file name according to user's choice.
-
handleLevelChange
protected void handleLevelChange()
Called when the level selection is changed.This methods updates the level file name according to user's choice.
-
handleGoClicked
protected void handleGoClicked()
Called when the Go button is clicked.This methods switches to the Game scene.
-
handleBackClicked
protected void handleBackClicked()
Called when the Back button is clicked.This methods switches to the Home scene.
-
initBackgroundComboBox
private void initBackgroundComboBox()
Called when the Go button is clicked.This methods switches to the Game scene.
-
initWallComboBox
private void initWallComboBox()
Initializes the wall combo box.
-
initLevelListView
private void initLevelListView()
Initializes the wall combo box.
-
-