Class DefaultAgentGUI
java.lang.Object
madkit.gui.DefaultAgentGUI
- Direct Known Subclasses:
ViewerDefaultGUI
This class provides a default GUI for an agent using JavaFX. To create a custom GUI for
an agent, extend this class and override the methods to customize the different parts
of the GUI.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAgentGUI
(Agent agent) Constructs a default GUI for the specified agent. -
Method Summary
Modifier and TypeMethodDescriptionprotected Node
Creates the bottom node of the GUI.protected Node
Creates the center node of the GUI.protected Node
Creates the left node of the GUI.protected Node
Creates the right node of the GUI.protected ToolBar
Creates a toolbar.protected Node
Creates the top node of the GUI.getAgent()
Returns the agent bounded to this GUI.Returns the main pane of the viewer agent.getScene()
Returns the scene of the viewer agent.getStage()
Returns the stage of the viewer agent.Returns the tool bar of the GUIprotected void
Called first when the GUI is initialized.
-
Constructor Details
-
DefaultAgentGUI
Constructs a default GUI for the specified agent. Override this constructor to customize the initialization of the GUI.- Parameters:
agent
- the agent for which the GUI is created
-
-
Method Details
-
onInitialize
protected void onInitialize()Called first when the GUI is initialized. Override this method to perform custom initialization. -
createTopNode
Creates the top node of the GUI. Override this method to customize the top part of the GUI.- Returns:
- the top node
-
createLeftNode
Creates the left node of the GUI. Override this method to customize the left part of the GUI.- Returns:
- the left node, or null if not used
-
createRightNode
Creates the right node of the GUI. Override this method to customize the right part of the GUI.- Returns:
- the right node
-
createBottomNode
Creates the bottom node of the GUI. Override this method to customize the bottom part of the GUI.- Returns:
- the bottom node
-
createToolBar
Creates a toolbar. Override this method to customize the toolbar. By default it will be used for creating the bottom node.- Returns:
- the toolbar
-
createCenterNode
Creates the center node of the GUI. Override this method to customize the center part of the GUI.- Returns:
- the center node
-
getStage
-
getMainPane
-
getScene
-
getAgent
-
getToolBar
-
getToolbar
- Returns:
- the toolbar
-
getTopNode
- Returns:
- the topNode
-
getLeftNode
- Returns:
- the leftNode
-
getCenterNode
- Returns:
- the centerNode
-
getRightNode
- Returns:
- the rightNode
-
getBottomNode
- Returns:
- the bottomNode
-