public class GUI
extends javafx.application.Application
Modifier and Type | Field and Description |
---|---|
protected javafx.scene.control.TextField |
aiTimeInput |
protected javafx.scene.control.Button |
applyValuesButton |
protected de.smarten.tsuro.shared.gui.TileGridPane |
board |
protected javafx.scene.layout.AnchorPane |
boardAnchor |
protected javafx.scene.control.TextField |
boardLengthInput |
protected de.smarten.tsuro.shared.gui.TileGridPane |
deck |
protected javafx.scene.layout.AnchorPane |
deckAnchor |
protected javafx.scene.control.TextField |
gate0 |
protected javafx.scene.control.TextField |
gate1 |
protected javafx.scene.control.TextField |
gate2 |
protected javafx.scene.control.TextField |
gate3 |
protected javafx.scene.control.TextField |
gate4 |
protected javafx.scene.control.TextField |
gate5 |
protected javafx.scene.control.TextField |
gate6 |
protected javafx.scene.control.TextField |
gate7 |
protected javafx.scene.text.Text |
messageFlow
The message view where the messages and errors will be displayed.
|
protected Queue<String> |
messageLog
A queue of strings to be printed to the message view.
|
protected int |
messageLogLength
The maximal length of the messageLog.
|
protected javafx.scene.layout.AnchorPane |
messagePane |
protected javafx.scene.control.TextField |
playerCountInput |
protected javafx.scene.control.TextField |
playerTimeInput |
protected javafx.scene.control.TextField |
presentationTimeInput |
protected static double |
RELATIVE_GAP_SIZE_BETWEEN_TILES_BOARD
The gap size (in relation to tile size on board) between each of the tiles displayed on the board.
|
protected static double |
RELATIVE_GAP_SIZE_BETWEEN_TILES_DECK
The gap size (in relation to tile size on deck) between each of the tiles displayed on the deck.
|
protected static double |
RELATIVE_STROKE_SIZE_OF_TILES
The stroke size (in relation to tile size) of each tiles.
|
protected javafx.scene.Scene |
scene
This scene is displayed if the GUI is used in eclipse.
|
protected javafx.scene.control.Button |
setModifiedTileButton |
protected static javafx.stage.Stage |
stage
This stage is the main view of the GUI.
|
protected de.smarten.tsuro.shared.gui.TileGridPane |
tileCollection |
protected javafx.scene.layout.AnchorPane |
tileCollectionAnchor |
protected javafx.scene.layout.AnchorPane |
tileManipulateAnchor |
Constructor and Description |
---|
GUI()
The GUI's constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
applyChangesToFocusedTile()
This method applies the changes made on the manipulatedValues method to the focused tile on the deck.
|
boolean |
checkCurrentInput()
This methods checks the current input of the gate text inputs to be integers and accurate values.
|
GuiControl |
getGuiCtrl() |
javafx.scene.Scene |
getScene()
Returns the scene that was created in the constructor or null if
the scene could not be created
|
String |
loadConfiguration()
Never call this method explicitly, it gets called by the GUI control.
|
static void |
main(String[] args)
The main method is used for starting a standalone application.
|
void |
manipulatedValues()
This method calculates the other gate values according to the one that was changed by the user.
|
void |
quit()
Closes the program.
|
void |
setBoardChangedTrue()
Sets the boardChanged boolean to true.
|
void |
setDeckSizeChangedTrue()
Sets the deck size changed boolean to true.
|
void |
setGuiCtrl(GuiControl pGuiControl) |
void |
showError(String error)
Adds the error message to the messageLog and updates the text area.
|
void |
showMessage(String message)
Adds the message to the messageLog and updates the text area.
|
void |
start(javafx.stage.Stage stage)
Will be executed by the launcher when running as a standalone application.
|
void |
storeConfiguration(String config)
Never call this method explicitly, it gets called by the GUI control.
|
void |
tileInDeckClickedToManipulate(int tileId)
This method is called when a tile in the deck was clicked to be manipulated.
|
void |
updateAiTime()
Updates the AI time in the configuration.
|
void |
updateBoardLength()
Updates the board length in the configuration.
|
void |
updatePlayerCount()
Updates the player count in the configuration.
|
void |
updatePlayerTime()
Updates the player time in the configuration.
|
void |
updatePresentationTime()
Updates the presentation time in the configuration.
|
void |
updateTextFields()
Updates all the values in the text fields with the data from the configuration.
|
void |
updateView()
This method is called when the board or the deck configuration data changed.
|
protected static final double RELATIVE_GAP_SIZE_BETWEEN_TILES_BOARD
protected static final double RELATIVE_GAP_SIZE_BETWEEN_TILES_DECK
protected static final double RELATIVE_STROKE_SIZE_OF_TILES
protected int messageLogLength
protected javafx.scene.text.Text messageFlow
protected javafx.scene.Scene scene
protected static javafx.stage.Stage stage
protected javafx.scene.layout.AnchorPane boardAnchor
protected javafx.scene.layout.AnchorPane deckAnchor
protected javafx.scene.layout.AnchorPane tileCollectionAnchor
protected javafx.scene.layout.AnchorPane tileManipulateAnchor
protected javafx.scene.layout.AnchorPane messagePane
protected de.smarten.tsuro.shared.gui.TileGridPane board
protected de.smarten.tsuro.shared.gui.TileGridPane deck
protected de.smarten.tsuro.shared.gui.TileGridPane tileCollection
protected javafx.scene.control.Button applyValuesButton
protected javafx.scene.control.Button setModifiedTileButton
protected javafx.scene.control.TextField boardLengthInput
protected javafx.scene.control.TextField playerCountInput
protected javafx.scene.control.TextField aiTimeInput
protected javafx.scene.control.TextField playerTimeInput
protected javafx.scene.control.TextField presentationTimeInput
protected javafx.scene.control.TextField gate0
protected javafx.scene.control.TextField gate1
protected javafx.scene.control.TextField gate2
protected javafx.scene.control.TextField gate3
protected javafx.scene.control.TextField gate4
protected javafx.scene.control.TextField gate5
protected javafx.scene.control.TextField gate6
protected javafx.scene.control.TextField gate7
public static void main(String[] args)
args
- needed to start the main methodpublic void start(javafx.stage.Stage stage) throws Exception
start
in class javafx.application.Application
stage
- the stage the fx application should run onException
- if the URL of the file is invalidpublic void updateBoardLength()
public void updatePlayerCount()
public void updateAiTime()
public void updatePlayerTime()
public void updatePresentationTime()
public void updateView()
public void updateTextFields()
public void quit()
public void tileInDeckClickedToManipulate(int tileId)
tileId
- the ID of the clicked tilepublic void manipulatedValues()
public boolean checkCurrentInput()
public void applyChangesToFocusedTile()
public void showError(String error)
public void showMessage(String message)
public GuiControl getGuiCtrl()
public void setGuiCtrl(GuiControl pGuiControl)
public javafx.scene.Scene getScene()
public void setDeckSizeChangedTrue()
public void setBoardChangedTrue()
public String loadConfiguration()
public void storeConfiguration(String config)
config
- the configuration to be stored as a stringCopyright © 2017 smarTen. All rights reserved.