Package pacman.controller
Class SelectController
- java.lang.Object
-
- pacman.controller.SelectController
-
public class SelectController extends java.lang.Object
SelectController
A
SelectController
is 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 class
SelectController.LevelListCellFactory
This is the factory for producing level list cell.private class
SelectController.TextureListCellFactory
This is the factory for producing background and wall list cell.
-
Field Summary
Fields Modifier and Type Field Description private javafx.scene.control.ComboBox
backgroundComboBox
The background combobox shown on the screen.private javafx.scene.control.ListView
levelListView
The level list shown on the screen.private Map
map
TheMap
for storing some configurations.private javafx.scene.control.TextField
nicknameTextField
The nickname text field shown on the screen.private javafx.scene.control.ComboBox
wallComboBox
The 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 void
handleBackClicked()
Called when the Back button is clicked.protected void
handleBackgroundChange()
Called when the background combo box is changed.protected void
handleGoClicked()
Called when the Go button is clicked.protected void
handleLevelChange()
Called when the level selection is changed.protected void
handleNicknameChange()
Called when the nickname text field is changed.protected void
handleWallChange()
Called when the wall combo box is changed.private void
initBackgroundComboBox()
Called when the Go button is clicked.void
initialize()
Called when the UI is initialized.private void
initLevelListView()
Initializes the wall combo box.private void
initWallComboBox()
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.
-
-