Class Connection
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget
Connection is a visual curveProperty, whose appearance is
defined through a single start and end point, and a set of control points,
which may be 'connected', i.e. be attached to an IAnchor. The exact
curveProperty shape is determined by an IConnectionRouter, which is
responsible of computing an ICurve geometry for a given
Connection (which is then rendered using a GeometryNode).
Whether the control points are interpreted as way points (that lie on the
curveProperty) or as 'real' control points depends on the
IConnectionInterpolator. While PolylineInterpolator and
PolyBezierInterpolator interpret control points to be way points,
other routers may e.g. interpret them as the control points of a
BezierCurve.
In addition to the curveProperty shape, the visual appearance of a
Connection can be controlled via start and end decorations. They will
be rendered 'on-top' of the curveProperty shape and the curveProperty shape
will be properly clipped at the decorations (so it does not paint through).
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyListProperty<IAnchor>Returns an unmodifiable read-only list property, which contains theIAnchors that determine the start point, control points, and end point of thisConnection.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns a property wrapping the curveNode.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns anObjectPropertywrapping the end decorationNode.javafx.beans.property.ObjectProperty<IConnectionInterpolator>Returns theIConnectionInterpolatorproperty.javafx.beans.property.ReadOnlyListProperty<Point>Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.javafx.beans.property.ObjectProperty<IConnectionRouter>Returns a writable property containing theIConnectionRouterof this connection.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns anObjectPropertywrapping the start decorationNode.Properties inherited from class javafx.scene.Group
autoSizeChildrenProperties inherited from class javafx.scene.Parent
needsLayoutProperties 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, 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_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidaddControlAnchor(int index, IAnchor anchor) Adds the givenIAnchoras a control point anchor for the given index into theanchorsUnmodifiableProperty()of thisConnection.voidaddControlPoint(int index, Point controlPoint) Adds anStaticAnchoryielding the givenPointas a control point anchor for the given index into theanchorsUnmodifiableProperty()of thisConnection.javafx.beans.property.ReadOnlyListProperty<IAnchor>Returns an unmodifiable read-only list property, which contains theIAnchors that determine the start point, control points, and end point of thisConnection.Creates a position change listener (PCL) whichrefreshesthisConnectionupon anchor position changes corresponding to the givenAnchorKey.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns a property wrapping the curveNode.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns anObjectPropertywrapping the end decorationNode.getAnchor(int index) Returns the anchor at the given index.protected intgetAnchorIndex(AnchorKey anchorKey) Returns the anchor index for the givenAnchorKey.protected AnchorKeygetAnchorKey(int anchorIndex) Returns theAnchorKeyfor the given anchor index, i.e. the reverse ofgetAnchorIndex(AnchorKey).javafx.collections.ObservableList<IAnchor>Returns aListcontaining theIAnchors which are assigned to thisConnectionin the order: start anchor, control point anchorsByKeys, end anchor.Computes the 'logical' center point of theConnection, which is the middle control point position (in case the curveProperty consists of an even number of segment) or the middle point of the middle segment.getControlAnchor(int index) protected intReturns the control anchor index for the givenAnchorKey, i.e.protected AnchorKeygetControlAnchorKey(int index) Returns theAnchorKeyfor the given control anchor index.getControlPoint(int index) Returns the controlPointfor the given control anchor index within the coordinate system of thisConnectionwhich is determined by querying the anchor position for the correspondingcontrol anchor, ornullif nocontrol anchoris assigned for the given index.javafx.scene.NodegetCurve()Returns theNodewhich displays the curveProperty geometry.protected AnchorKeyReturns the endAnchorKeyfor thisConnection.javafx.scene.NodeReturns the endPointof thisConnectionwithin its coordinate system which is determined by querying the anchor position for theend anchor key, ornullwhen noend anchoris assigned.Returns the currently set end position hint ornullif no hint is present.Returns theIConnectionInterpolatorof thisConnection.getPoint(int index) Returns the point at the given index.javafx.collections.ObservableList<Point>Returns thePoints constituting thisConnectionwithin its coordinate system in the order: start point, control points, end point.Returns theIConnectionRouterof thisConnection.protected AnchorKeyReturns the startAnchorKeyfor thisConnection.javafx.scene.NodeReturns the startPointof thisConnectionwithin its coordinate system which is determined by querying the anchor position for thestart anchor key, ornullwhen nostart anchoris assigned.Returns the currently set start position hint ornullif no hint is present.javafx.beans.property.ObjectProperty<IConnectionInterpolator>Returns theIConnectionInterpolatorproperty.booleanisConnected(int index) Returns whether the (start, end, or control) anchor at the respective index is connected.booleanisConnected(IAnchor anchor) Returntruein case the anchor is bound to an anchorage unequal to this connection.booleanisControlConnected(int index) Returnstrueif the currently assignedcontrol anchorfor the given index is bound to an anchorage.booleanReturnstrueif the currently assignedend anchoris bound to an anchorage.booleanReturnstrueif the currently assignedstart anchoris bound to an anchorage.doublemaxHeight(double width) doublemaxWidth(double height) doubleminHeight(double width) doubleminWidth(double height) javafx.beans.property.ReadOnlyListProperty<Point>Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.protected voidreattachAnchorKeys(javafx.scene.Node oldAnchored, javafx.scene.Node newAnchored) Re-attaches allAnchorKeys that are managed by thisConnection.protected voidrefresh()Refreshes the visualization in response to anchor, position, transformation, etc. changes.voidRemoves all control points of thisConnection.voidRemoves all control points of thisConnection.protected voidremoveAnchor(AnchorKey anchorKey, IAnchor anchor) voidremoveControlAnchor(int index) Removes the control anchor specified by the given index from thisConnection.voidremoveControlPoint(int index) Removes the control point specified by the given control anchor index from thisConnection.javafx.beans.property.ObjectProperty<IConnectionRouter>Returns a writable property containing theIConnectionRouterof this connection.protected voidvoidsetAnchors(List<IAnchor> anchors) Replaces all anchors of thisConnectionwith the givenIAnchors, i.e. the first givenIAnchorreplaces the currently assigned start anchor, the last givenIAnchorreplaces the currently assigned end anchor, and the intermediateIAnchors replace the currently assigned control anchorsByKeys.voidsetControlAnchor(int index, IAnchor anchor) Sets the control anchor for the given control anchor index to the givenIAnchor.voidsetControlAnchors(List<IAnchor> anchors) voidsetControlPoint(int index, Point controlPoint) Sets the control anchor for the given control anchor index to anStaticAnchorwhich yields the givenPoint.voidsetControlPoints(List<Point> controlPoints) voidsetCurve(javafx.scene.Node curve) Sets theNodethat is used to render the connection.voidsetEndAnchor(IAnchor anchor) Sets the endIAnchorof thisConnectionto the given value.voidsetEndDecoration(javafx.scene.Node decoration) Sets the end decorationNodeof thisConnectionto the given value.voidsetEndPoint(Point endPoint) voidsetEndPointHint(Point endPositionHint) Sets the end position hint to the given value.voidsetInterpolator(IConnectionInterpolator interpolator) voidReplaces all anchors of thisConnectionwith the givenIAnchors, i.e. the first givenIAnchorreplaces the currently assigned start anchor, the last givenIAnchorreplaces the currently assigned end anchor, and the intermediateIAnchors replace the currently assigned control anchorsByKeys.voidsetRouter(IConnectionRouter router) Sets theIConnectionRouterof thisConnectionto the given value.voidsetStartAnchor(IAnchor anchor) Sets the startIAnchorof thisConnectionto the given value.voidsetStartDecoration(javafx.scene.Node decoration) Sets the start decorationNodeof thisConnectionto the given value.voidsetStartPoint(Point startPoint) voidsetStartPointHint(Point startPositionHint) Sets the start position hint to the given value.javafx.beans.property.ObjectProperty<javafx.scene.Node>Returns anObjectPropertywrapping the start decorationNode.Methods inherited from class javafx.scene.Group
autoSizeChildrenProperty, getChildren, isAutoSizeChildren, layoutChildren, prefHeight, prefWidth, setAutoSizeChildrenMethods inherited from class javafx.scene.Parent
computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods 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, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, 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, 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, lookupAll, managedProperty, 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, pressedProperty, pseudoClassStateChanged, 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, toString, 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
-
Property Details
-
anchorsUnmodifiable
Returns an unmodifiable read-only list property, which contains theIAnchors that determine the start point, control points, and end point of thisConnection.- See Also:
-
curve
public javafx.beans.property.ObjectProperty<javafx.scene.Node> curvePropertyReturns a property wrapping the curveNode.- See Also:
-
endDecoration
public javafx.beans.property.ObjectProperty<javafx.scene.Node> endDecorationPropertyReturns anObjectPropertywrapping the end decorationNode.- See Also:
-
interpolator
Returns theIConnectionInterpolatorproperty. -
pointsUnmodifiable
Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.- See Also:
-
router
Returns a writable property containing theIConnectionRouterof this connection.- See Also:
-
startDecoration
public javafx.beans.property.ObjectProperty<javafx.scene.Node> startDecorationPropertyReturns anObjectPropertywrapping the start decorationNode.- See Also:
-
-
Constructor Details
-
Connection
public Connection()Constructs a newConnectionwhose start and end point are set tonull.
-
-
Method Details
-
addAnchor
Inserts the givenIAnchorinto theanchorsUnmodifiableProperty()of thisConnection. The givenAnchorKeyis attached to theIAnchor. Furthermore, aPCLfor theAnchorKeyis registered on the position property of theIAnchorand the visualization isrefreshed. -
addControlAnchor
Adds the givenIAnchoras a control point anchor for the given index into theanchorsUnmodifiableProperty()of thisConnection.- Parameters:
index- The position where theIAnchoris inserted within the control point anchorsByKeys of thisConnection.anchor- TheIAnchorwhich determines the position of the corresponding control point.
-
addControlPoint
Adds anStaticAnchoryielding the givenPointas a control point anchor for the given index into theanchorsUnmodifiableProperty()of thisConnection.- Parameters:
index- The position where theIAnchoris inserted within the control point anchorsByKeys of thisConnection.controlPoint- The position for the specified control point.
-
anchorsUnmodifiableProperty
Returns an unmodifiable read-only list property, which contains theIAnchors that determine the start point, control points, and end point of thisConnection.- See Also:
-
createPCL
protected javafx.collections.MapChangeListener<? super AnchorKey,? super Point> createPCL(AnchorKey anchorKey) Creates a position change listener (PCL) whichrefreshesthisConnectionupon anchor position changes corresponding to the givenAnchorKey.- Parameters:
anchorKey- TheAnchorKeyfor which a position change will trigger arefresh()with the returned PCL.- Returns:
- A position change listener to
refreshthisConnectionwhen the position for the givenAnchorKeychanges.
-
curveProperty
public javafx.beans.property.ObjectProperty<javafx.scene.Node> curveProperty()Returns a property wrapping the curveNode.- See Also:
-
endDecorationProperty
public javafx.beans.property.ObjectProperty<javafx.scene.Node> endDecorationProperty()Returns anObjectPropertywrapping the end decorationNode.- See Also:
-
getAnchor
Returns the anchor at the given index. The start anchor will be provided forindex == 0, the end anchor for the last defined index. Control anchorsByKeys will be returned for all indices in between.- Parameters:
index- The index of the anchor to retrieve.- Returns:
- The anchor at the given index.
-
getAnchorIndex
Returns the anchor index for the givenAnchorKey. -
getAnchorKey
Returns theAnchorKeyfor the given anchor index, i.e. the reverse ofgetAnchorIndex(AnchorKey). -
getAnchorsUnmodifiable
Returns aListcontaining theIAnchors which are assigned to thisConnectionin the order: start anchor, control point anchorsByKeys, end anchor.- Returns:
- A
Listcontaining theIAnchors which are assigned to thisConnection.
-
getCenter
Computes the 'logical' center point of theConnection, which is the middle control point position (in case the curveProperty consists of an even number of segment) or the middle point of the middle segment.- Returns:
- The logical center of this
Connection.
-
getControlAnchor
-
getControlAnchorIndex
Returns the control anchor index for the givenAnchorKey, i.e.0for the first controlanchor,1for the seconds, etc.- Parameters:
key- TheAnchorKeywhose control anchor index is returned.- Returns:
- The control anchor index for the given
AnchorKey. - Throws:
IllegalArgumentException- when there currently is no controlanchorassigned to thisConnectionfor the givenAnchorKey.
-
getControlAnchorKey
Returns theAnchorKeyfor the given control anchor index. -
getControlAnchors
- Returns:
- A
Listcontaining the controlanchorsByKeyscurrently assigned to thisConnection.
-
getControlPoint
Returns the controlPointfor the given control anchor index within the coordinate system of thisConnectionwhich is determined by querying the anchor position for the correspondingcontrol anchor, ornullif nocontrol anchoris assigned for the given index.- Parameters:
index- The control anchor index for which to return the anchor position.- Returns:
- The start
Pointof thisConnection, ornull.
-
getControlPoints
- Returns:
- A
Listcontaining the controlPoints of thisConnection.
-
getCurve
public javafx.scene.Node getCurve()Returns theNodewhich displays the curveProperty geometry. Will be aGeometryNodeby default.- Returns:
- The
Nodewhich displays the curveProperty geometry.
-
getEndAnchor
- Returns:
- The currently assigned end
anchor, ornull.
-
getEndAnchorKey
Returns the endAnchorKeyfor thisConnection. An endAnchorKeyuses thecurveProperty nodeas its anchored and"end"as its role.- Returns:
- The end
AnchorKeyfor thisConnection.
-
getEndDecoration
public javafx.scene.Node getEndDecoration()- Returns:
- The end decoration
Nodeof thisConnection, ornull.
-
getEndPoint
Returns the endPointof thisConnectionwithin its coordinate system which is determined by querying the anchor position for theend anchor key, ornullwhen noend anchoris assigned.- Returns:
- The end
Pointof thisConnection, ornull.
-
getEndPointHint
Returns the currently set end position hint ornullif no hint is present.- Returns:
- The currently set end position hint or
nullif no hint is present.
-
getInterpolator
Returns theIConnectionInterpolatorof thisConnection.- Returns:
- The
IConnectionInterpolatorof thisConnection.
-
getPoint
Returns the point at the given index. The start point will be provided forindex == 0, the end point for the last defined index. Control points will be returned for all indices in between.- Parameters:
index- The index of the point to retrieve.- Returns:
- The point at the given index.
- See Also:
-
getPointsUnmodifiable
Returns thePoints constituting thisConnectionwithin its coordinate system in the order: start point, control points, end point.- Returns:
- The
Points constituting thisConnection.
-
getRouter
Returns theIConnectionRouterof thisConnection.- Returns:
- The
IConnectionRouterof thisConnection.
-
getStartAnchor
- Returns:
- The currently assigned start
anchor, ornull.
-
getStartAnchorKey
Returns the startAnchorKeyfor thisConnection. A startAnchorKeyuses thecurveProperty nodeas its anchored and"start"as its role.- Returns:
- The start
AnchorKeyfor thisConnection.
-
getStartDecoration
public javafx.scene.Node getStartDecoration()- Returns:
- The start decoration
Nodeof thisConnection, ornull.
-
getStartPoint
Returns the startPointof thisConnectionwithin its coordinate system which is determined by querying the anchor position for thestart anchor key, ornullwhen nostart anchoris assigned.- Returns:
- The start
Pointof thisConnection, ornull.
-
getStartPointHint
Returns the currently set start position hint ornullif no hint is present.- Returns:
- The currently set start position hint or
nullif no hint is present.
-
interpolatorProperty
Returns theIConnectionInterpolatorproperty. -
isConnected
Returntruein case the anchor is bound to an anchorage unequal to this connection.- Parameters:
anchor- The anchor to test- Returns:
trueif the anchor is connected,falseotherwise.
-
isConnected
public boolean isConnected(int index) Returns whether the (start, end, or control) anchor at the respective index is connected.- Parameters:
index- The index, referring to the start, end, or a control point.- Returns:
trueif the anchor at the given index is connected,falseotherwise.
-
isControlConnected
public boolean isControlConnected(int index) Returnstrueif the currently assignedcontrol anchorfor the given index is bound to an anchorage. Otherwise returnsfalse.- Parameters:
index- The control anchor index of the control anchor to test for connectedness.- Returns:
trueif the currently assignedcontrol anchorfor the given index is bound to an anchorage, otherwisefalse.
-
isEndConnected
public boolean isEndConnected()Returnstrueif the currently assignedend anchoris bound to an anchorage. Otherwise returnsfalse.- Returns:
trueif the currently assignedend anchoris bound to an anchorage, otherwisefalse.
-
isStartConnected
public boolean isStartConnected()Returnstrueif the currently assignedstart anchoris bound to an anchorage. Otherwise returnsfalse.- Returns:
trueif the currently assignedstart anchoris bound to an anchorage, otherwisefalse.
-
maxHeight
public double maxHeight(double width) - Overrides:
maxHeightin classjavafx.scene.Node
-
maxWidth
public double maxWidth(double height) - Overrides:
maxWidthin classjavafx.scene.Node
-
minHeight
public double minHeight(double width) - Overrides:
minHeightin classjavafx.scene.Group
-
minWidth
public double minWidth(double height) - Overrides:
minWidthin classjavafx.scene.Group
-
pointsUnmodifiableProperty
Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.- See Also:
-
reattachAnchorKeys
protected void reattachAnchorKeys(javafx.scene.Node oldAnchored, javafx.scene.Node newAnchored) Re-attaches allAnchorKeys that are managed by thisConnection.- Parameters:
oldAnchored- The previous anchoredNode.newAnchored- The new anchoredNode.
-
refresh
protected void refresh()Refreshes the visualization in response to anchor, position, transformation, etc. changes. This method is safe against reentrance, i.e. changes performed byrefresh()are allowed to lead to anotherrefresh()call. However, when this method is called reentrant, it returns immediately.The process of refreshing a
Connectionis somewhat complicated as it involves transforming points according to a transformation change, removing volatile anchors, computing new parameters for its anchors, inserting volatile anchors, computing a curve geometry, and updating the visualization to that geometry. In addition, the position change listeners registered at the individualAbstractAnchor.positionsUnmodifiableProperty()need to be disabled duringrefresh()to preventConcurrentModificationException. The process can be described by the following steps:- The connection unregisters all position change listeners.
- The connection queries all points from its anchors and transforms them from curve to connection coordinates (curve-to-connection-transform, c2ctx).
- The router removes all (previously inserted) volatile anchors.
- => The connection's points are refreshed in-place, because removal
of anchors calls
removeAnchor(AnchorKey, IAnchor), which updates the points straight away. - The router queries the (updated, user-defined) points from the connection and computes parameters for the anchors based on these points (and other criteria).
- => The router computes the
DynamicAnchor.AnchoredReferencePointparameter value within the coordinate system of the connection. - => The parameter is then bound to a binding that depends on the
c2ctx, which transforms the
Pointfrom the coordinate system of the connection to the coordinate system of thegetCurve(). - The anchors compute new positions for the
AnchorKeys for which new parameters were provided or parameter values changed. - The router queries the positions from the anchors and transforms them manually, because the connection did not yet update its points.
- The router inserts volatile anchors according to the routing strategy.
- The connection refreshes its points manually, because the position change listeners are disabled.
- The interpolator computes a new curve geometry and applies it to the connection.
- => The c2ctx changes, that's why the parameters are recomputed from the bindings, which triggers a recomputation of the anchor positions.
- The connection refreshed its points manually again.
- The connection registers all position change listeners.
-
removeAllControlAnchors
public void removeAllControlAnchors()Removes all control points of thisConnection. -
removeAllControlPoints
public void removeAllControlPoints()Removes all control points of thisConnection. -
removeAnchor
-
removeControlAnchor
public void removeControlAnchor(int index) Removes the control anchor specified by the given index from thisConnection.- Parameters:
index- The index specifying which control anchor to remove.
-
removeControlPoint
public void removeControlPoint(int index) Removes the control point specified by the given control anchor index from thisConnection.- Parameters:
index- The control anchor index specifying which control point to remove.
-
routerProperty
Returns a writable property containing theIConnectionRouterof this connection.- See Also:
-
setAnchor
-
setAnchors
Replaces all anchors of thisConnectionwith the givenIAnchors, i.e. the first givenIAnchorreplaces the currently assigned start anchor, the last givenIAnchorreplaces the currently assigned end anchor, and the intermediateIAnchors replace the currently assigned control anchorsByKeys.- Parameters:
anchors- The newIAnchors for thisConnection.- Throws:
IllegalArgumentException- when less than 2IAnchors are given.
-
setControlAnchor
Sets the control anchor for the given control anchor index to the givenIAnchor.- Parameters:
index- The control anchor index of the control anchor to replace.anchor- The new controlIAnchorfor that index.
-
setControlAnchors
- Parameters:
anchors- The new controlIAnchors for thisConnection.
-
setControlPoint
Sets the control anchor for the given control anchor index to anStaticAnchorwhich yields the givenPoint.- Parameters:
index- The control anchor index of the control anchor to replace.controlPoint- The new controlPointfor the respective index within local coordinates of theConnection.
-
setControlPoints
- Parameters:
controlPoints- The new controlPoints for thisConnection.
-
setCurve
public void setCurve(javafx.scene.Node curve) Sets theNodethat is used to render the connection.- Parameters:
curve- The new curveProperty node.
-
setEndAnchor
Sets the endIAnchorof thisConnectionto the given value.- Parameters:
anchor- The new endIAnchorfor thisConnection.
-
setEndDecoration
public void setEndDecoration(javafx.scene.Node decoration) Sets the end decorationNodeof thisConnectionto the given value.- Parameters:
decoration- The new end decorationNodefor thisConnection.
-
setEndPoint
- Parameters:
endPoint- The new endPointwithin local coordinates of theConnection.
-
setEndPointHint
Sets the end position hint to the given value.- Parameters:
endPositionHint- The new end position hint.
-
setInterpolator
- Parameters:
interpolator- The newIConnectionInterpolatorfor thisConnection.
-
setPoints
Replaces all anchors of thisConnectionwith the givenIAnchors, i.e. the first givenIAnchorreplaces the currently assigned start anchor, the last givenIAnchorreplaces the currently assigned end anchor, and the intermediateIAnchors replace the currently assigned control anchorsByKeys.- Parameters:
points- The newPoints for thisConnection.- Throws:
IllegalArgumentException- when less than 2IAnchors are given.
-
setRouter
Sets theIConnectionRouterof thisConnectionto the given value.- Parameters:
router- The newIConnectionRouterfor thisConnection.
-
setStartAnchor
Sets the startIAnchorof thisConnectionto the given value.- Parameters:
anchor- The new startIAnchorfor thisConnection.
-
setStartDecoration
public void setStartDecoration(javafx.scene.Node decoration) Sets the start decorationNodeof thisConnectionto the given value.- Parameters:
decoration- The new start decorationNodefor thisConnection.
-
setStartPoint
- Parameters:
startPoint- The new startPointwithin local coordinates of theConnection.
-
setStartPointHint
Sets the start position hint to the given value.- Parameters:
startPositionHint- The new start position hint.
-
startDecorationProperty
public javafx.beans.property.ObjectProperty<javafx.scene.Node> startDecorationProperty()Returns anObjectPropertywrapping the start decorationNode.- See Also:
-