Package pamViewFX.fxNodes.connectionPane
Class StandardConnectionPlug
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Polygon
pamViewFX.fxNodes.connectionPane.StandardConnectionPlug
- All Implemented Interfaces:
 javafx.css.Styleable,javafx.event.EventTarget,ConnectorNode
Plug connected to a collision rectangle. Plugs can connect to sockets or, if
 allowed, connection lines. Plugs can also be dragged without moving the
 ConnectionRectangle.
- Author:
 - Jamie Macaulay
 
- 
Property Summary
Properties inherited from class javafx.scene.shape.Shape
fill, smooth, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, stroke, strokeType, strokeWidthProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible - 
Field Summary
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHTFields inherited from interface pamViewFX.fxNodes.connectionPane.ConnectorNode
CONNECTED, CONNECTION_DISABLED, CONNECTOR_MOVED, NO_CONNECTION, POSSIBLE_CONNECTION - 
Constructor Summary
ConstructorsConstructorDescriptionStandardConnectionPlug(StandardConnectionNode connectionNode, double plugBodyWidth, double plugEndWidth, double plugBodyHeight, double plugEndHeight, double cornerRadius, javafx.geometry.Orientation orientation)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the shape can connect to another shape and connect if so.checkForCollision(ConnectorNode shape, ArrayList<? extends ConnectorNode> nodes, double min_dist) Check whether a collision with another shape has occurred.booleanCheck whether a plug is close to rectangle and therefore should be deleted.booleancheckPossibleConnection(boolean notify) Check whether a shape can connect and send appropriate flag to itself and the shape it can connect to.voidIf dragged then a new disabled plug is made in default positions and the new plug becomes something which can be dragged around the connection pane.Get all branch sockets attached to the connectionLines of the plug.Get the connected shape- the shape this shape is connected to.Get the connectionNode associated with the shape.javafx.scene.layout.PaneGet the connection node body.intCheck if the shape is currently connected to another shape.javafx.scene.paint.ColordoublegetDistance(javafx.scene.shape.Shape shape) Get the distance form the CollisionShape to another shape.doublegetDragX()doublegetDragY()javafx.scene.paint.Colorjavafx.geometry.Point2DgetLocalCords(double x, double y) Get the local co-ordinates for the plug when given the scene co-ordinates.doublejavafx.scene.paint.Colorjavafx.geometry.OrientationGet the orientation of the shape .getPlugPolygon(double plugBodyWidth, double plugEndWidth, double plugBodyHeight, double plugEndHeight, double cornerRadius) Get the polygon point array for the plug.Get a list of connection shapes which might connect with this shape.javafx.scene.shape.ShapegetShape()Get the Shape associated with the Collision shape.booleanisBound()Check whether the plug is bound to the Connection Rectangle.booleanisError()Check whether plug is set to show an error.voidsetConnectedShape(ConnectorNode connectionShape) Set the connected shape- the shape which this shape is connected to.voidsetConnectionNode(StandardConnectionNode connectionNode) voidsetConnectionStatus(int type, ConnectorNode foundShape) Set the connection status.voidSet all connector nodes null.voidsetDisableColour(javafx.scene.paint.Color disableColour) voidsetDragX(double dragX) voidsetDragY(double dragY) voidsetError(boolean isError) Set whether plug is set to show an error.voidsetHighLightColour(javafx.scene.paint.Color highLightColour) voidsetNormalColour(javafx.scene.paint.Color normalColour) voidsetPlugConnectionLines(ArrayList<ConnectionLine> plugConnectionLines) Methods inherited from class javafx.scene.shape.Polygon
getPoints, toStringMethods inherited from class javafx.scene.shape.Shape
fillProperty, getClassCssMetaData, getCssMetaData, getFill, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, unionMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface pamViewFX.fxNodes.connectionPane.ConnectorNode
checkPossibleConnection, getConnectedShape, getConnectionNode, getConnectionStatus, getDistance, getOrientation, getShape, setConnectedShapeMethods inherited from interface javafx.css.Styleable
getStyleableNode 
- 
Constructor Details
- 
StandardConnectionPlug
public StandardConnectionPlug(StandardConnectionNode connectionNode, double plugBodyWidth, double plugEndWidth, double plugBodyHeight, double plugEndHeight, double cornerRadius, javafx.geometry.Orientation orientation)  
 - 
 - 
Method Details
- 
getPlugPolygon
public static ArrayList<Double> getPlugPolygon(double plugBodyWidth, double plugEndWidth, double plugBodyHeight, double plugEndHeight, double cornerRadius) Get the polygon point array for the plug.- Parameters:
 plugBodyWidth- - the width of the plug body.plugEndWidth- - the width of the end section of the plug (that fits into the socket).plugBodyHeight- - the height of the plug body.plugEndHeight- - the height of the end section of the plug (that fits into the socket).cornerRadius- - the corner radius of the plug- Returns:
 - list of points that make a polygon of the plug shape.
 
 - 
setConnectorNodesNull
public void setConnectorNodesNull()Set all connector nodes null. This means possible conenctions that are out of range etc are removed - 
getLocalCords
public javafx.geometry.Point2D getLocalCords(double x, double y) Get the local co-ordinates for the plug when given the scene co-ordinates. Note this is here just in case this requires overriding in special cases.- Returns:
 - the local co-ordinates in for plug.
 
 - 
enableFreePlug
public void enableFreePlug()If dragged then a new disabled plug is made in default positions and the new plug becomes something which can be dragged around the connection pane. Sets plug to free mode and adds new disabled plug to node. - 
setConnectionStatus
Description copied from interface:ConnectorNodeSet the connection status.- Specified by:
 setConnectionStatusin interfaceConnectorNode- Parameters:
 type- - type of connection status,foundShape- - the connected or possibly connected shape. Can be null if NO_CONNECTION FLAG.
 - 
isBound
public boolean isBound()Check whether the plug is bound to the Connection Rectangle. If so then enableFreePlug() needs to be called to unbind. By default a new diabled plug will be added when called. - 
checkPlugDelete
public boolean checkPlugDelete()Check whether a plug is close to rectangle and therefore should be deleted.- Returns:
 - true if the plug can be deleted
 
 - 
getBranchSockets
Get all branch sockets attached to the connectionLines of the plug.- Returns:
 - all branch sockets attached to the connection lines of the plug.
 
 - 
getPlugConnectionLines
 - 
setPlugConnectionLines
 - 
getPossibleConnectionShapes
Get a list of connection shapes which might connect with this shape.- Returns:
 - a list of ConnectionShapes in a ConnectionPane which can connect with the AbstractConnectionShape;
 
 - 
getDragX
public double getDragX() - 
setDragX
public void setDragX(double dragX)  - 
getDragY
public double getDragY() - 
setDragY
public void setDragY(double dragY)  - 
isError
public boolean isError()Check whether plug is set to show an error.- Specified by:
 isErrorin interfaceConnectorNode- Returns:
 - true if the plug shows an error like appearance.
 
 - 
setError
public void setError(boolean isError) Set whether plug is set to show an error.- Specified by:
 setErrorin interfaceConnectorNode- Parameters:
 isError- - true if error in connectiontrue- if the plug shows an error like appearance.
 - 
getConnectionNodeBody
public javafx.scene.layout.Pane getConnectionNodeBody()Get the connection node body.- Returns:
 - the connection node body
 
 - 
getConnectionNode
Get the connectionNode associated with the shape.- Specified by:
 getConnectionNodein interfaceConnectorNode- Returns:
 - the ConnectionNode associated with the shape.
 
 - 
setConnectionNode
 - 
getOrientation
public javafx.geometry.Orientation getOrientation()Description copied from interface:ConnectorNodeGet the orientation of the shape .- Specified by:
 getOrientationin interfaceConnectorNode- Returns:
 - orientation of the shape.
 
 - 
checkConnection
public void checkConnection()Check if the shape can connect to another shape and connect if so. - 
checkPossibleConnection
public boolean checkPossibleConnection(boolean notify) Check whether a shape can connect and send appropriate flag to itself and the shape it can connect to.- Specified by:
 checkPossibleConnectionin interfaceConnectorNode- Parameters:
 notify-send- POSSIBLE_CONNECTION to shape and found shape if found.- Returns:
 - true if a possible connection has been found.
 
 - 
getDistance
public double getDistance(javafx.scene.shape.Shape shape) Description copied from interface:ConnectorNodeGet the distance form the CollisionShape to another shape. Usually this is just the centre point of the shape to the other shape centre, however in some cases might be slightly different e.g. for a line you want the closest point on the line to a shape rather than just the centre of the line.- Specified by:
 getDistancein interfaceConnectorNode- Parameters:
 shape- - shape to get distance to.- Returns:
 - the distance in pixels from the CollisionShape to the shape.
 
 - 
getNormalColour
public javafx.scene.paint.Color getNormalColour() - 
setNormalColour
public void setNormalColour(javafx.scene.paint.Color normalColour)  - 
getHighLightColour
public javafx.scene.paint.Color getHighLightColour() - 
setHighLightColour
public void setHighLightColour(javafx.scene.paint.Color highLightColour)  - 
getDisableColour
public javafx.scene.paint.Color getDisableColour() - 
setDisableColour
public void setDisableColour(javafx.scene.paint.Color disableColour)  - 
getShape
public javafx.scene.shape.Shape getShape()Description copied from interface:ConnectorNodeGet the Shape associated with the Collision shape.- Specified by:
 getShapein interfaceConnectorNode- Returns:
 - the shape
 
 - 
getConnectionStatus
public int getConnectionStatus()Description copied from interface:ConnectorNodeCheck if the shape is currently connected to another shape.- Specified by:
 getConnectionStatusin interfaceConnectorNode- Returns:
 - true if the shape is connected to another shape.
 
 - 
checkForCollision
public ConnectorNode checkForCollision(ConnectorNode shape, ArrayList<? extends ConnectorNode> nodes, double min_dist) Check whether a collision with another shape has occurred.- Returns:
 - the shape a collision has occurred with. If no collision has occurred return null;
 
 - 
setConnectedShape
Description copied from interface:ConnectorNodeSet the connected shape- the shape which this shape is connected to. null if no shape is connected;- Specified by:
 setConnectedShapein interfaceConnectorNode- Parameters:
 connectionShape- - the connected shape. Can be null.
 - 
getConnectedShape
Description copied from interface:ConnectorNodeGet the connected shape- the shape this shape is connected to. null if shape is not connected to anything;- Specified by:
 getConnectedShapein interfaceConnectorNode
 - 
getMinDist
public double getMinDist() 
 -