Package dataModelFX.connectionNodes
Class ConnectionNodeFactory
java.lang.Object
dataModelFX.connectionNodes.ConnectionNodeFactory
Creates connection nodes from both saved parameters and when new modules and/or
as structures are added manually.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddModule
(javafx.stage.Stage primaryStage, PamModuleInfo pamModuleInfo) Add an instance of this module type to the data model.addNewModule
(PamControlledUnit pamControlledUnit, double x, double y) Adds a new connection node to thevoid
addNewModule
(PamModuleInfo pamModuleInfo, double x, double y) Called whenever there is an attempt to add a new module to the pane.addNewStructure
(DataModelModulePane.StructureRectangle structureRectangle, double x, double y) Called whenever there is an attempt to add a structure to the pane.createConnectionnNode
(String unitType) Create a new connection node.createConnectionnNode
(PamControlledUnit pamControlledUnit) Create a new connection node.createConnectionNode
(ConnectionNodeParams connectionParams) Create a connection node based on it's type.createConnectionNode
(ConnectionNodeParams.PAMConnectionNodeType connectionNodeType, ConnectionNodeParams connectionParams) Create a connection node based on it's type.createConnectionStructure
(DataModelModulePane.StructureRectangle structureRectangle) Create a connection node from a structure rectangle
-
Constructor Details
-
ConnectionNodeFactory
-
-
Method Details
-
addModule
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
Called whenever there is an attempt to add a new module to the pane.- Parameters:
pamModuleInfo
- - thex
- -x position of dropped moduley
- - y position of dropped module
-
addNewModule
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 nodepamController
- - 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 nodex
- - the pixel x co-ordinatey
- - 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
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
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
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.
-