Class ConnectionNodeFactory

java.lang.Object
dataModelFX.connectionNodes.ConnectionNodeFactory

public class ConnectionNodeFactory extends Object
Creates connection nodes from both saved parameters and when new modules and/or as structures are added manually.
  • Constructor Details

    • ConnectionNodeFactory

      public ConnectionNodeFactory(DataModelPaneFX dataModel)
  • Method Details

    • addModule

      public PamControlledUnit addModule(javafx.stage.Stage primaryStage, PamModuleInfo pamModuleInfo)
      Add an instance of this module type to the data model.
      Parameters:
      primaryStage - - the primary stage
      Returns:
      the new PamControlledUnit if added successfully. Null if the module was not added successfully.
    • addNewModule

      public void addNewModule(PamModuleInfo pamModuleInfo, double x, double y)
      Called whenever there is an attempt to add a new module to the pane.
      Parameters:
      pamModuleInfo - - the
      x - -x position of dropped module
      y - - y position of dropped module
    • addNewModule

      public ModuleConnectionNode addNewModule(PamControlledUnit pamControlledUnit, double x, double y)
      Adds a new connection node to the
      Parameters:
      x - - the x position on the connection pane to place the node.
      y - - the y position on the connection pane to place the node
      pamController - - the pamControlledUnit
      Returns:
    • addNewStructure

      public StandardConnectionNode addNewStructure(DataModelModulePane.StructureRectangle structureRectangle, double x, double y)
      Called whenever there is an attempt to add a structure to the pane.
      Parameters:
      structureRectangle - - the structure node
      x - - the pixel x co-ordinate
      y - - the pixel y co-ordinate
    • createConnectionStructure

      public StandardConnectionNode createConnectionStructure(DataModelModulePane.StructureRectangle structureRectangle)
      Create a connection node from a structure rectangle
      Parameters:
      structureRectangle - - the structure rectangle to create.
      Returns:
      the new structure conneciton node.
    • createConnectionnNode

      public ModuleConnectionNode createConnectionnNode(String unitType)
      Create a new connection node. Will create sub class nodes if appropriate,
      Parameters:
      pamControlledUnit - - the pmaControlledUnit for the module
      Returns:
      a new module node.
    • createConnectionnNode

      public ModuleConnectionNode createConnectionnNode(PamControlledUnit pamControlledUnit)
      Create a new connection node. Will create sub class nodes if appropriate,
      Parameters:
      pamControlledUnit - - the pmaControlledUnit for the module
      Returns:
      a new module node.
    • createConnectionNode

      public StandardConnectionNode createConnectionNode(ConnectionNodeParams connectionParams)
      Create a connection node based on it's type.
      Parameters:
      connectionParams - - the parameters.
      Returns:
      the new connection node.
    • createConnectionNode

      public StandardConnectionNode createConnectionNode(ConnectionNodeParams.PAMConnectionNodeType connectionNodeType, ConnectionNodeParams connectionParams)
      Create a connection node based on it's type.
      Parameters:
      connectionParams - - the parameters. Can be null if a structure or for default ModuleConnectionNode.
      connectionType - - the type of connection node to create
      Returns:
      the new connection node.