Package pamViewFX.fxNodes.connectionPane
Class ConnectionLine
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Line
pamViewFX.fxNodes.connectionPane.ConnectionLine
- All Implemented Interfaces:
 javafx.css.Styleable,javafx.event.EventTarget,ConnectorNode
Line which connects a plug or socket to a ConnectionRectangle or other ConnectionLine.
- Author:
 - Jamie Macaulay
 
- 
Property Summary
Properties inherited from class javafx.scene.shape.Line
endX, endY, startX, startYProperties 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
ConstructorsConstructorDescriptionConnectionLine(StandardConnectionNode connectionNode, ConnectorNode connectionShape)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddBranchNewSocket(ConnectorNode plugShape) Add a new socket to the line.voidaddTempSocket(ConnectorNode plugShape) Add a temporary socket to the line.booleancheckBranchSocketParent(ConnectorNode connectionShape) Check whether the current connection shape has a parent ConnectionNode whihc already has a branch plug on the line.booleancheckPossibleConnection(boolean notify) Check whether a connection hasGet the connected shape- the shape this shape is connected to.Get the connection node the shape is associated with;intCheck whether a connection line can connect to another ConnectionShape or not; i.e.doublegetDistance(javafx.scene.shape.Shape shape) Get the distance form the CollisionShape to another shape.javafx.geometry.OrientationGet the orientation of the shape .Get the parent connection shape.javafx.scene.shape.ShapegetShape()Get the Shape associated with the Collision shape.booleanChick if branch sockets can connect to linebooleanisError()Checkj whether the line is showing error status.voidRemove any temporary socket from the line.voidsetAllowBranchSockets(boolean allowBranchSockets) Allow the line to accept branch sockets.voidsetConnectedShape(ConnectorNode connecionShape) Set the connected shape- the shape which this shape is connected to.voidsetConnectionStatus(int type, ConnectorNode connectionShape) Set the connection status.voidsetError(boolean isError) Set line to show error.voidsetNormalColor(javafx.scene.paint.Color color) Set the colour of the lineMethods inherited from class javafx.scene.shape.Line
endXProperty, endYProperty, getEndX, getEndY, getStartX, getStartY, setEndX, setEndY, setStartX, setStartY, startXProperty, startYProperty, 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 javafx.css.Styleable
getStyleableNode 
- 
Constructor Details
- 
ConnectionLine
 
 - 
 - 
Method Details
- 
setNormalColor
public void setNormalColor(javafx.scene.paint.Color color) Set the colour of the line- Parameters:
 color- - colour of the line
 - 
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.
 
 - 
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()Check whether a connection line can connect to another ConnectionShape or not; i.e. will register a collision of another shape comes near.- Specified by:
 getConnectionStatusin interfaceConnectorNode- Returns:
 - flag for connection type.
 
 - 
setConnectionStatus
Description copied from interface:ConnectorNodeSet the connection status.- Specified by:
 setConnectionStatusin interfaceConnectorNode- Parameters:
 type- - type of connection status,connectionShape- - the connected or possibly connected shape. Can be null if NO_CONNECTION FLAG.
 - 
checkBranchSocketParent
Check whether the current connection shape has a parent ConnectionNode whihc already has a branch plug on the line. A parent node cannot have two branch connections.- Parameters:
 connectionShape- - shape attempting to connect via branch socket.- Returns:
 - true if the parent ConnectionNodde of the shape is not already connected to the line.
 
 - 
removeTempSocket
public void removeTempSocket()Remove any temporary socket from the line. - 
addTempSocket
Add a temporary socket to the line. - 
addBranchNewSocket
Add a new socket to the line.- Parameters:
 plugShape- - plug to connect this new socket to.
 - 
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.
 
 - 
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:
 connecionShape- - 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
 - 
getConnectionNode
Description copied from interface:ConnectorNodeGet the connection node the shape is associated with;- Specified by:
 getConnectionNodein interfaceConnectorNode- Returns:
 - the connection node the shape is associated with;
 
 - 
isError
public boolean isError()Checkj whether the line is showing error status.- Specified by:
 isErrorin interfaceConnectorNode- Returns:
 - true if showing error status.
 
 - 
setError
public void setError(boolean isError) Set line to show error.- Specified by:
 setErrorin interfaceConnectorNode- Parameters:
 isError- - true to show error.
 - 
isAllowBranchSockets
public boolean isAllowBranchSockets()Chick if branch sockets can connect to line- Returns:
 - true if branch sockets can connect
 
 - 
setAllowBranchSockets
public void setAllowBranchSockets(boolean allowBranchSockets) Allow the line to accept branch sockets.- Parameters:
 allowBranchSockets-
 - 
getParentConnectionShape
Get the parent connection shape. Each line connects a ConnectionShape to a ConnectionNode - the connectionShape the line connects to is the ParentConnectionShape.- Returns:
 - the ConnectionShape the line connects the ConnectionNode to.
 
 - 
checkPossibleConnection
public boolean checkPossibleConnection(boolean notify) Description copied from interface:ConnectorNodeCheck whether a connection has- Specified by:
 checkPossibleConnectionin interfaceConnectorNode- Parameters:
 notify-- Returns:
 
 
 -