Class DefaultAgentGUI

java.lang.Object
madkit.gui.DefaultAgentGUI
Direct Known Subclasses:
ViewerDefaultGUI

public class DefaultAgentGUI extends Object
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 Details

    • DefaultAgentGUI

      public DefaultAgentGUI(Agent agent)
      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

      protected Node createTopNode()
      Creates the top node of the GUI. Override this method to customize the top part of the GUI.
      Returns:
      the top node
    • createLeftNode

      protected 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

      protected Node createRightNode()
      Creates the right node of the GUI. Override this method to customize the right part of the GUI.
      Returns:
      the right node
    • createBottomNode

      protected 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

      protected ToolBar 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

      protected Node createCenterNode()
      Creates the center node of the GUI. Override this method to customize the center part of the GUI.
      Returns:
      the center node
    • getStage

      public FXAgentStage getStage()
      Returns the stage of the viewer agent.
      Returns:
      the stage
    • getMainPane

      public BorderPane getMainPane()
      Returns the main pane of the viewer agent.
      Returns:
      the mainPane
    • getScene

      public Scene getScene()
      Returns the scene of the viewer agent.
      Returns:
      the scene
    • getAgent

      public Agent getAgent()
      Returns the agent bounded to this GUI.
      Returns:
      the agent
    • getToolBar

      public ToolBar getToolBar()
      Returns the tool bar of the GUI
      Returns:
      the tool bar
    • getToolbar

      public ToolBar getToolbar()
      Returns:
      the toolbar
    • getTopNode

      public Node getTopNode()
      Returns:
      the topNode
    • getLeftNode

      public Node getLeftNode()
      Returns:
      the leftNode
    • getCenterNode

      public Node getCenterNode()
      Returns:
      the centerNode
    • getRightNode

      public Node getRightNode()
      Returns:
      the rightNode
    • getBottomNode

      public Node getBottomNode()
      Returns:
      the bottomNode