org.eclipse.gef.fx.nodes

## Class Connection

- java.lang.Object
- - javafx.scene.Node
  - - javafx.scene.Parent
    - - javafx.scene.Group
      - - org.eclipse.gef.fx.nodes.Connection

All Implemented Interfaces:
  javafx.css.Styleable, javafx.event.EventTarget

    public class Connection
    extends javafx.scene.Group

A (binary) `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

All Methods Instance Methods Concrete Methods
`javafx.beans.property.ReadOnlyListProperty<IAnchor>` `anchorsUnmodifiable` Returns an unmodifiable read-only list property, which contains the `IAnchor`s that determine the start point, control points, and end point of this `Connection`.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `curve` Returns a property wrapping the curve `Node`.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `endDecoration` Returns an `ObjectProperty` wrapping the end decoration `Node`.
`javafx.beans.property.ObjectProperty<IConnectionInterpolator>` `interpolator` Returns the `IConnectionInterpolator` property.
`javafx.beans.property.ReadOnlyListProperty<Point>` `pointsUnmodifiable` Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.
`javafx.beans.property.ObjectProperty<IConnectionRouter>` `router` Returns a writable property containing the `IConnectionRouter` of this connection.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `startDecoration` Returns an `ObjectProperty` wrapping the start decoration `Node`.

### Properties inherited from class javafx.scene.Group

`autoSizeChildren`

### Properties inherited from class javafx.scene.Parent

`impl_traversalEngine, needsLayout`

### Properties 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, impl_showMnemonics, impl_treeVisible, 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, visible`

### Field Summary

### Fields inherited from class javafx.scene.Node

`BASELINE_OFFSET_SAME_AS_HEIGHT`

### Constructor Summary

Constructors
Constructor and Description
`Connection()` Constructs a new `Connection` whose start and end point are set to `null`.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `addAnchor(AnchorKey anchorKey, IAnchor anchor)` Inserts the given `IAnchor` into the `anchorsUnmodifiableProperty()` of this `Connection`.
`void` `addControlAnchor(int index, IAnchor anchor)` Adds the given `IAnchor` as a control point anchor for the given index into the `anchorsUnmodifiableProperty()` of this `Connection`.
`void` `addControlPoint(int index, Point controlPoint)` Adds an `StaticAnchor` yielding the given `Point` as a control point anchor for the given index into the `anchorsUnmodifiableProperty()` of this `Connection`.
`javafx.beans.property.ReadOnlyListProperty<IAnchor>` `anchorsUnmodifiableProperty()` Returns an unmodifiable read-only list property, which contains the `IAnchor`s that determine the start point, control points, and end point of this `Connection`.
`protected javafx.collections.MapChangeListener<? super AnchorKey,? super Point>` `createPCL(AnchorKey anchorKey)` Creates a position change listener (PCL) which `refreshes` this `Connection` upon anchor position changes corresponding to the given `AnchorKey`.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `curveProperty()` Returns a property wrapping the curve `Node`.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `endDecorationProperty()` Returns an `ObjectProperty` wrapping the end decoration `Node`.
`IAnchor` `getAnchor(int index)` Returns the anchor at the given index.
`protected int` `getAnchorIndex(AnchorKey anchorKey)` Returns the anchor index for the given `AnchorKey`.
`protected AnchorKey` `getAnchorKey(int anchorIndex)` Returns the `AnchorKey` for the given anchor index, i.e. the reverse of `getAnchorIndex(AnchorKey)`.
`javafx.collections.ObservableList<IAnchor>` `getAnchorsUnmodifiable()` Returns a `List` containing the `IAnchor`s which are assigned to this `Connection` in the order: start anchor, control point anchorsByKeys, end anchor.
`Point` `getCenter()` Computes the 'logical' center point of the `Connection`, 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.
`IAnchor` `getControlAnchor(int index)` Returns the control `anchor` for the given control anchor index which is currently assigned, or `null` if no control `anchor` is assigned for that index.
`protected int` `getControlAnchorIndex(AnchorKey key)` Returns the control anchor index for the given `AnchorKey`, i.e.
`protected AnchorKey` `getControlAnchorKey(int index)` Returns the `AnchorKey` for the given control anchor index.
`java.util.List<IAnchor>` `getControlAnchors()` Returns a `List` containing the control `anchorsByKeys` currently assigned to this `Connection`.
`Point` `getControlPoint(int index)` Returns the control `Point` for the given control anchor index within the coordinate system of this `Connection` which is determined by querying the anchor position for the corresponding `control anchor`, or `null` if no `control anchor` is assigned for the given index.
`java.util.List<Point>` `getControlPoints()` Returns a `List` containing the control `Point`s of this `Connection`.
`javafx.scene.Node` `getCurve()` Returns the `Node` which displays the curveProperty geometry.
`IAnchor` `getEndAnchor()` Returns the currently assigned end `anchor`, or `null` if no end `anchor` is assigned.
`protected AnchorKey` `getEndAnchorKey()` Returns the end `AnchorKey` for this `Connection`.
`javafx.scene.Node` `getEndDecoration()` Returns the end decoration `Node` of this `Connection`, or `null`.
`Point` `getEndPoint()` Returns the end `Point` of this `Connection` within its coordinate system which is determined by querying the anchor position for the `end anchor key`, or `null` when no `end anchor` is assigned.
`Point` `getEndPointHint()` Returns the currently set end position hint or `null` if no hint is present.
`IConnectionInterpolator` `getInterpolator()` Returns the `IConnectionInterpolator` of this `Connection`.
`Point` `getPoint(int index)` Returns the point at the given index.
`javafx.collections.ObservableList<Point>` `getPointsUnmodifiable()` Returns the `Point`s constituting this `Connection` within its coordinate system in the order: start point, control points, end point.
`IConnectionRouter` `getRouter()` Returns the `IConnectionRouter` of this `Connection`.
`IAnchor` `getStartAnchor()` Returns the currently assigned start `anchor`, or `null` if no start `anchor` is assigned.
`protected AnchorKey` `getStartAnchorKey()` Returns the start `AnchorKey` for this `Connection`.
`javafx.scene.Node` `getStartDecoration()` Returns the start decoration `Node` of this `Connection`, or `null`.
`Point` `getStartPoint()` Returns the start `Point` of this `Connection` within its coordinate system which is determined by querying the anchor position for the `start anchor key`, or `null` when no `start anchor` is assigned.
`Point` `getStartPointHint()` Returns the currently set start position hint or `null` if no hint is present.
`javafx.beans.property.ObjectProperty<IConnectionInterpolator>` `interpolatorProperty()` Returns the `IConnectionInterpolator` property.
`boolean` `isConnected(IAnchor anchor)` Return `true` in case the anchor is bound to an anchorage unequal to this connection.
`boolean` `isConnected(int index)` Returns whether the (start, end, or control) anchor at the respective index is connected.
`boolean` `isControlConnected(int index)` Returns `true` if the currently assigned `control anchor` for the given index is bound to an anchorage.
`boolean` `isEndConnected()` Returns `true` if the currently assigned `end anchor` is bound to an anchorage.
`boolean` `isStartConnected()` Returns `true` if the currently assigned `start anchor` is bound to an anchorage.
`double` `maxHeight(double width)`
`double` `maxWidth(double height)`
`double` `minHeight(double width)`
`double` `minWidth(double height)`
`javafx.beans.property.ReadOnlyListProperty<Point>` `pointsUnmodifiableProperty()` Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.
`protected void` `reattachAnchorKeys(javafx.scene.Node oldAnchored, javafx.scene.Node newAnchored)` Re-attaches all `AnchorKey`s that are managed by this `Connection`.
`protected void` `refresh()` Refreshes the visualization in response to anchor, position, transformation, etc. changes.
`void` `removeAllControlAnchors()` Removes all control points of this `Connection`.
`void` `removeAllControlPoints()` Removes all control points of this `Connection`.
`protected void` `removeAnchor(AnchorKey anchorKey, IAnchor anchor)` Removes the given `AnchorKey` (and corresponding `IAnchor`) from this `Connection`.
`void` `removeControlAnchor(int index)` Removes the control anchor specified by the given index from this `Connection`.
`void` `removeControlPoint(int index)` Removes the control point specified by the given control anchor index from this `Connection`.
`javafx.beans.property.ObjectProperty<IConnectionRouter>` `routerProperty()` Returns a writable property containing the `IConnectionRouter` of this connection.
`protected void` `setAnchor(AnchorKey anchorKey, IAnchor anchor)` Replaces the anchor currently registered for the given `AnchorKey` with the given `IAnchor`.
`void` `setAnchors(java.util.List<IAnchor> anchors)` Replaces all anchors of this `Connection` with the given `IAnchor`s, i.e. the first given `IAnchor` replaces the currently assigned start anchor, the last given `IAnchor` replaces the currently assigned end anchor, and the intermediate `IAnchor`s replace the currently assigned control anchorsByKeys.
`void` `setControlAnchor(int index, IAnchor anchor)` Sets the control anchor for the given control anchor index to the given `IAnchor`.
`void` `setControlAnchors(java.util.List<IAnchor> anchors)` Replaces all control anchorsByKeys of this `Connection` with the given `List` of `IAnchor`s.
`void` `setControlPoint(int index, Point controlPoint)` Sets the control anchor for the given control anchor index to an `StaticAnchor` which yields the given `Point`.
`void` `setControlPoints(java.util.List<Point> controlPoints)` Replaces all control anchorsByKeys of this `Connection` with `StaticAnchor`s yielding the given `Point`s.
`void` `setCurve(javafx.scene.Node curve)` Sets the `Node` that is used to render the connection.
`void` `setEndAnchor(IAnchor anchor)` Sets the end `IAnchor` of this `Connection` to the given value.
`void` `setEndDecoration(javafx.scene.Node decoration)` Sets the end decoration `Node` of this `Connection` to the given value.
`void` `setEndPoint(Point endPoint)` Sets the `end anchor` of this `Connection` to an `StaticAnchor` yielding the given `Point`.
`void` `setEndPointHint(Point endPositionHint)` Sets the end position hint to the given value.
`void` `setInterpolator(IConnectionInterpolator interpolator)` Sets the `IConnectionInterpolator` of this `Connection` to the given `IConnectionInterpolator`.
`void` `setPoints(java.util.List<Point> points)` Replaces all anchors of this `Connection` with the given `IAnchor`s, i.e. the first given `IAnchor` replaces the currently assigned start anchor, the last given `IAnchor` replaces the currently assigned end anchor, and the intermediate `IAnchor`s replace the currently assigned control anchorsByKeys.
`void` `setRouter(IConnectionRouter router)` Sets the `IConnectionRouter` of this `Connection` to the given value.
`void` `setStartAnchor(IAnchor anchor)` Sets the start `IAnchor` of this `Connection` to the given value.
`void` `setStartDecoration(javafx.scene.Node decoration)` Sets the start decoration `Node` of this `Connection` to the given value.
`void` `setStartPoint(Point startPoint)` Sets the `start anchor` of this `Connection` to an `StaticAnchor` yielding the given `Point`.
`void` `setStartPointHint(Point startPositionHint)` Sets the start position hint to the given value.
`javafx.beans.property.ObjectProperty<javafx.scene.Node>` `startDecorationProperty()` Returns an `ObjectProperty` wrapping the start decoration `Node`.

### Methods inherited from class javafx.scene.Group

`autoSizeChildrenProperty, getChildren, impl_computeLayoutBounds, isAutoSizeChildren, layoutChildren, prefHeight, prefWidth, setAutoSizeChildren`

### Methods inherited from class javafx.scene.Parent

`computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_computeContains, impl_computeGeomBounds, impl_createPeer, impl_getAllParentStylesheets, impl_pickNodeLocal, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, impl_updatePeer, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds`

### Methods inherited from class javafx.scene.Node

`accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, 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, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_notifyLayoutBoundsChanged, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Property Detail

#### anchorsUnmodifiable

    public javafx.beans.property.ReadOnlyListProperty<IAnchor> anchorsUnmodifiableProperty

Returns an unmodifiable read-only list property, which contains the `IAnchor`s that determine the start point, control points, and end point of this `Connection`.

See Also:
  `getAnchorsUnmodifiable()`

#### curve

    public javafx.beans.property.ObjectProperty<javafx.scene.Node> curveProperty

Returns a property wrapping the curve `Node`.

See Also:
  `getCurve()`, `setCurve(Node)`

#### endDecoration

    public javafx.beans.property.ObjectProperty<javafx.scene.Node> endDecorationProperty

Returns an `ObjectProperty` wrapping the end decoration `Node`.

See Also:
  `getEndDecoration()`, `setEndDecoration(Node)`

#### interpolator

    public javafx.beans.property.ObjectProperty<IConnectionInterpolator> interpolatorProperty

Returns the `IConnectionInterpolator` property.

See Also:
  `getInterpolator()`, `setInterpolator(IConnectionInterpolator)`

#### pointsUnmodifiable

    public javafx.beans.property.ReadOnlyListProperty<Point> pointsUnmodifiableProperty

Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.

See Also:
  `getPointsUnmodifiable()`

#### router

    public javafx.beans.property.ObjectProperty<IConnectionRouter> routerProperty

Returns a writable property containing the `IConnectionRouter` of this connection.

See Also:
  `getRouter()`, `setRouter(IConnectionRouter)`

#### startDecoration

    public javafx.beans.property.ObjectProperty<javafx.scene.Node> startDecorationProperty

Returns an `ObjectProperty` wrapping the start decoration `Node`.

See Also:
  `getStartDecoration()`, `setStartDecoration(Node)`

### Constructor Detail

#### Connection

    public Connection()

Constructs a new `Connection` whose start and end point are set to `null`.

### Method Detail

#### addAnchor

    protected void addAnchor(AnchorKey anchorKey,
                             IAnchor anchor)

Inserts the given `IAnchor` into the `anchorsUnmodifiableProperty()` of this `Connection`. The given `AnchorKey` is attached to the `IAnchor`. Furthermore, a `PCL` for the `AnchorKey` is registered on the position property of the `IAnchor` and the visualization is `refreshed`.

Parameters:
  `anchorKey` - The `AnchorKey` under which the `IAnchor` is to be registered.
  `anchor` - The `IAnchor` which is inserted.

#### addControlAnchor

    public void addControlAnchor(int index,
                                 IAnchor anchor)

Adds the given `IAnchor` as a control point anchor for the given index into the `anchorsUnmodifiableProperty()` of this `Connection`.

Parameters:
  `index` - The position where the `IAnchor` is inserted within the control point anchorsByKeys of this `Connection`.
  `anchor` - The `IAnchor` which determines the position of the corresponding control point.

#### addControlPoint

    public void addControlPoint(int index,
                                Point controlPoint)

Adds an `StaticAnchor` yielding the given `Point` as a control point anchor for the given index into the `anchorsUnmodifiableProperty()` of this `Connection`.

Parameters:
  `index` - The position where the `IAnchor` is inserted within the control point anchorsByKeys of this `Connection`.
  `controlPoint` - The position for the specified control point.

#### anchorsUnmodifiableProperty

    public javafx.beans.property.ReadOnlyListProperty<IAnchor> anchorsUnmodifiableProperty()

Returns an unmodifiable read-only list property, which contains the `IAnchor`s that determine the start point, control points, and end point of this `Connection`.

See Also:
  `getAnchorsUnmodifiable()`

#### createPCL

    protected javafx.collections.MapChangeListener<? super AnchorKey,? super Point> createPCL(AnchorKey anchorKey)

Creates a position change listener (PCL) which `refreshes` this `Connection` upon anchor position changes corresponding to the given `AnchorKey`.

Parameters:
  `anchorKey` - The `AnchorKey` for which a position change will trigger a `refresh()` with the returned PCL.
Returns:
  A position change listener to `refresh` this `Connection` when the position for the given `AnchorKey` changes.

#### curveProperty

    public javafx.beans.property.ObjectProperty<javafx.scene.Node> curveProperty()

Returns a property wrapping the curve `Node`.

See Also:
  `getCurve()`, `setCurve(Node)`

#### endDecorationProperty

    public javafx.beans.property.ObjectProperty<javafx.scene.Node> endDecorationProperty()

Returns an `ObjectProperty` wrapping the end decoration `Node`.

See Also:
  `getEndDecoration()`, `setEndDecoration(Node)`

#### getAnchor

    public IAnchor getAnchor(int index)

Returns the anchor at the given index. The start anchor will be provided for `index == 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

    protected int getAnchorIndex(AnchorKey anchorKey)

Returns the anchor index for the given `AnchorKey`.

Parameters:
  `anchorKey` - The `AnchorKey` for which the anchor index is determined.
Returns:
  The anchor index for the given `AnchorKey` or `-1` in case the anchor key is not contained.

#### getAnchorKey

    protected AnchorKey getAnchorKey(int anchorIndex)

Returns the `AnchorKey` for the given anchor index, i.e. the reverse of `getAnchorIndex(AnchorKey)`.

Parameters:
  `anchorIndex` - The anchor index for which to determine the `AnchorKey`.
Returns:
  The `AnchorKey` for the given anchor index.

#### getAnchorsUnmodifiable

    public javafx.collections.ObservableList<IAnchor> getAnchorsUnmodifiable()

Returns a `List` containing the `IAnchor`s which are assigned to this `Connection` in the order: start anchor, control point anchorsByKeys, end anchor.

Returns:
  A `List` containing the `IAnchor`s which are assigned to this `Connection`.

#### getCenter

    public Point getCenter()

Computes the 'logical' center point of the `Connection`, 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

    public IAnchor getControlAnchor(int index)

Returns the control `anchor` for the given control anchor index which is currently assigned, or `null` if no control `anchor` is assigned for that index.

Parameters:
  `index` - The control anchor index determining which control `anchor` to return.
Returns:
  The control `anchor` for the given index, or `null`.

#### getControlAnchorIndex

    protected int getControlAnchorIndex(AnchorKey key)

Returns the control anchor index for the given `AnchorKey`, i.e. `0` for the first control `anchor`, `1` for the seconds, etc.

Parameters:
  `key` - The `AnchorKey` whose control anchor index is returned.
Returns:
  The control anchor index for the given `AnchorKey`.
Throws:
  `java.lang.IllegalArgumentException` - when there currently is no control `anchor` assigned to this `Connection` for the given `AnchorKey`.

#### getControlAnchorKey

    protected AnchorKey getControlAnchorKey(int index)

Returns the `AnchorKey` for the given control anchor index.

Parameters:
  `index` - The control anchor index for which the `AnchorKey` is returned.
Returns:
  The `AnchorKey` for the given control anchor index.

#### getControlAnchors

    public java.util.List<IAnchor> getControlAnchors()

Returns a `List` containing the control `anchorsByKeys` currently assigned to this `Connection`.

Returns:
  A `List` containing the control `anchorsByKeys` currently assigned to this `Connection`.

#### getControlPoint

    public Point getControlPoint(int index)

Returns the control `Point` for the given control anchor index within the coordinate system of this `Connection` which is determined by querying the anchor position for the corresponding `control anchor`, or `null` if no `control anchor` is assigned for the given index.

Parameters:
  `index` - The control anchor index for which to return the anchor position.
Returns:
  The start `Point` of this `Connection`, or `null`.

#### getControlPoints

    public java.util.List<Point> getControlPoints()

Returns a `List` containing the control `Point`s of this `Connection`.

Returns:
  A `List` containing the control `Point`s of this `Connection`.

#### getCurve

    public javafx.scene.Node getCurve()

Returns the `Node` which displays the curveProperty geometry. Will be a `GeometryNode` by default.

Returns:
  The `Node` which displays the curveProperty geometry.

#### getEndAnchor

    public IAnchor getEndAnchor()

Returns the currently assigned end `anchor`, or `null` if no end `anchor` is assigned.

Returns:
  The currently assigned end `anchor`, or `null`.

#### getEndAnchorKey

    protected AnchorKey getEndAnchorKey()

Returns the end `AnchorKey` for this `Connection`. An end `AnchorKey` uses the `curveProperty node` as its anchored and `"end"` as its role.

Returns:
  The end `AnchorKey` for this `Connection`.

#### getEndDecoration

    public javafx.scene.Node getEndDecoration()

Returns the end decoration `Node` of this `Connection`, or `null`.

Returns:
  The end decoration `Node` of this `Connection`, or `null`.

#### getEndPoint

    public Point getEndPoint()

Returns the end `Point` of this `Connection` within its coordinate system which is determined by querying the anchor position for the `end anchor key`, or `null` when no `end anchor` is assigned.

Returns:
  The end `Point` of this `Connection`, or `null`.

#### getEndPointHint

    public Point getEndPointHint()

Returns the currently set end position hint or `null` if no hint is present.

Returns:
  The currently set end position hint or `null` if no hint is present.

#### getInterpolator

    public IConnectionInterpolator getInterpolator()

Returns the `IConnectionInterpolator` of this `Connection`.

Returns:
  The `IConnectionInterpolator` of this `Connection`.

#### getPoint

    public Point getPoint(int index)

Returns the point at the given index. The start point will be provided for `index == 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()`

#### getPointsUnmodifiable

    public javafx.collections.ObservableList<Point> getPointsUnmodifiable()

Returns the `Point`s constituting this `Connection` within its coordinate system in the order: start point, control points, end point.

Returns:
  The `Point`s constituting this `Connection`.

#### getRouter

    public IConnectionRouter getRouter()

Returns the `IConnectionRouter` of this `Connection`.

Returns:
  The `IConnectionRouter` of this `Connection`.

#### getStartAnchor

    public IAnchor getStartAnchor()

Returns the currently assigned start `anchor`, or `null` if no start `anchor` is assigned.

Returns:
  The currently assigned start `anchor`, or `null`.

#### getStartAnchorKey

    protected AnchorKey getStartAnchorKey()

Returns the start `AnchorKey` for this `Connection`. A start `AnchorKey` uses the `curveProperty node` as its anchored and `"start"` as its role.

Returns:
  The start `AnchorKey` for this `Connection`.

#### getStartDecoration

    public javafx.scene.Node getStartDecoration()

Returns the start decoration `Node` of this `Connection`, or `null`.

Returns:
  The start decoration `Node` of this `Connection`, or `null`.

#### getStartPoint

    public Point getStartPoint()

Returns the start `Point` of this `Connection` within its coordinate system which is determined by querying the anchor position for the `start anchor key`, or `null` when no `start anchor` is assigned.

Returns:
  The start `Point` of this `Connection`, or `null`.

#### getStartPointHint

    public Point getStartPointHint()

Returns the currently set start position hint or `null` if no hint is present.

Returns:
  The currently set start position hint or `null` if no hint is present.

#### interpolatorProperty

    public javafx.beans.property.ObjectProperty<IConnectionInterpolator> interpolatorProperty()

Returns the `IConnectionInterpolator` property.

See Also:
  `getInterpolator()`, `setInterpolator(IConnectionInterpolator)`

#### isConnected

    public boolean isConnected(IAnchor anchor)

Return `true` in case the anchor is bound to an anchorage unequal to this connection.

Parameters:
  `anchor` - The anchor to test
Returns:
  `true` if the anchor is connected, `false` otherwise.

#### 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:
  `true` if the anchor at the given index is connected, `false` otherwise.

#### isControlConnected

    public boolean isControlConnected(int index)

Returns `true` if the currently assigned `control anchor` for the given index is bound to an anchorage. Otherwise returns `false`.

Parameters:
  `index` - The control anchor index of the control anchor to test for connectedness.
Returns:
  `true` if the currently assigned `control anchor` for the given index is bound to an anchorage, otherwise `false`.

#### isEndConnected

    public boolean isEndConnected()

Returns `true` if the currently assigned `end anchor` is bound to an anchorage. Otherwise returns `false`.

Returns:
  `true` if the currently assigned `end anchor` is bound to an anchorage, otherwise `false`.

#### isStartConnected

    public boolean isStartConnected()

Returns `true` if the currently assigned `start anchor` is bound to an anchorage. Otherwise returns `false`.

Returns:
  `true` if the currently assigned `start anchor` is bound to an anchorage, otherwise `false`.

#### maxHeight

    public double maxHeight(double width)

Overrides:
  `maxHeight` in class `javafx.scene.Node`

#### maxWidth

    public double maxWidth(double height)

Overrides:
  `maxWidth` in class `javafx.scene.Node`

#### minHeight

    public double minHeight(double width)

Overrides:
  `minHeight` in class `javafx.scene.Group`

#### minWidth

    public double minWidth(double height)

Overrides:
  `minWidth` in class `javafx.scene.Group`

#### pointsUnmodifiableProperty

    public javafx.beans.property.ReadOnlyListProperty<Point> pointsUnmodifiableProperty()

Returns an unmodifiable read-only list property, which contains the points (start, control, end) that constitute this connection.

See Also:
  `getPointsUnmodifiable()`

#### reattachAnchorKeys

    protected void reattachAnchorKeys(javafx.scene.Node oldAnchored,
                                      javafx.scene.Node newAnchored)

Re-attaches all `AnchorKey`s that are managed by this `Connection`.

Parameters:
  `oldAnchored` - The previous anchored `Node`.
  `newAnchored` - The new anchored `Node`.

#### 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 by `refresh()` are allowed to lead to another `refresh()` call. However, when this method is called reentrant, it returns immediately.

The process of refreshing a `Connection` is 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 individual `AbstractAnchor.positionsUnmodifiableProperty()` need to be disabled during `refresh()` to prevent `ConcurrentModificationException`. The process can be described by the following steps:

1. The connection unregisters all position change listeners.
2. The connection queries all points from its anchors and transforms them from curve to connection coordinates (curve-to-connection-transform, c2ctx).
3. The router removes all (previously inserted) volatile anchors.
4. => The connection's points are refreshed in-place, because removal of anchors calls `removeAnchor(AnchorKey, IAnchor)`, which updates the points straight away.
5. The router queries the (updated, user-defined) points from the connection and computes parameters for the anchors based on these points (and other criteria).
6. => The router computes the `DynamicAnchor.AnchoredReferencePoint` parameter value within the coordinate system of the connection.
7. => The parameter is then bound to a binding that depends on the c2ctx, which transforms the `Point` from the coordinate system of the connection to the coordinate system of the `getCurve()`.
8. The anchors compute new positions for the `AnchorKey`s for which new parameters were provided or parameter values changed.
9. The router queries the positions from the anchors and transforms them manually, because the connection did not yet update its points.
10. The router inserts volatile anchors according to the routing strategy.
11. The connection refreshes its points manually, because the position change listeners are disabled.
12. The interpolator computes a new curve geometry and applies it to the connection.
13. => The c2ctx changes, that's why the parameters are recomputed from the bindings, which triggers a recomputation of the anchor positions.
14. The connection refreshed its points manually again.
15. The connection registers all position change listeners.

#### removeAllControlAnchors

    public void removeAllControlAnchors()

Removes all control points of this `Connection`.

#### removeAllControlPoints

    public void removeAllControlPoints()

Removes all control points of this `Connection`.

#### removeAnchor

    protected void removeAnchor(AnchorKey anchorKey,
                                IAnchor anchor)

Removes the given `AnchorKey` (and corresponding `IAnchor`) from this `Connection`.

Parameters:
  `anchorKey` - The `AnchorKey` to remove.
  `anchor` - The corresponding `IAnchor`.

#### removeControlAnchor

    public void removeControlAnchor(int index)

Removes the control anchor specified by the given index from this `Connection`.

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 this `Connection`.

Parameters:
  `index` - The control anchor index specifying which control point to remove.

#### routerProperty

    public javafx.beans.property.ObjectProperty<IConnectionRouter> routerProperty()

Returns a writable property containing the `IConnectionRouter` of this connection.

See Also:
  `getRouter()`, `setRouter(IConnectionRouter)`

#### setAnchor

    protected void setAnchor(AnchorKey anchorKey,
                             IAnchor anchor)

Replaces the anchor currently registered for the given `AnchorKey` with the given `IAnchor`.

Parameters:
  `anchorKey` - The `AnchorKey` under which the `IAnchor` is to be registered.
  `anchor` - The `IAnchor` which is inserted.

#### setAnchors

    public void setAnchors(java.util.List<IAnchor> anchors)

Replaces all anchors of this `Connection` with the given `IAnchor`s, i.e. the first given `IAnchor` replaces the currently assigned start anchor, the last given `IAnchor` replaces the currently assigned end anchor, and the intermediate `IAnchor`s replace the currently assigned control anchorsByKeys.

Parameters:
  `anchors` - The new `IAnchor`s for this `Connection`.
Throws:
  `java.lang.IllegalArgumentException` - when less than 2 `IAnchor`s are given.

#### setControlAnchor

    public void setControlAnchor(int index,
                                 IAnchor anchor)

Sets the control anchor for the given control anchor index to the given `IAnchor`.

Parameters:
  `index` - The control anchor index of the control anchor to replace.
  `anchor` - The new control `IAnchor` for that index.

#### setControlAnchors

    public void setControlAnchors(java.util.List<IAnchor> anchors)

Replaces all control anchorsByKeys of this `Connection` with the given `List` of `IAnchor`s.

Parameters:
  `anchors` - The new control `IAnchor`s for this `Connection`.

#### setControlPoint

    public void setControlPoint(int index,
                                Point controlPoint)

Sets the control anchor for the given control anchor index to an `StaticAnchor` which yields the given `Point`.

Parameters:
  `index` - The control anchor index of the control anchor to replace.
  `controlPoint` - The new control `Point` for the respective index within local coordinates of the `Connection`.

#### setControlPoints

    public void setControlPoints(java.util.List<Point> controlPoints)

Replaces all control anchorsByKeys of this `Connection` with `StaticAnchor`s yielding the given `Point`s.

Parameters:
  `controlPoints` - The new control `Point`s for this `Connection`.

#### setCurve

    public void setCurve(javafx.scene.Node curve)

Sets the `Node` that is used to render the connection.

Parameters:
  `curve` - The new curveProperty node.

#### setEndAnchor

    public void setEndAnchor(IAnchor anchor)

Sets the end `IAnchor` of this `Connection` to the given value.

Parameters:
  `anchor` - The new end `IAnchor` for this `Connection`.

#### setEndDecoration

    public void setEndDecoration(javafx.scene.Node decoration)

Sets the end decoration `Node` of this `Connection` to the given value.

Parameters:
  `decoration` - The new end decoration `Node` for this `Connection`.

#### setEndPoint

    public void setEndPoint(Point endPoint)

Sets the `end anchor` of this `Connection` to an `StaticAnchor` yielding the given `Point`.

Parameters:
  `endPoint` - The new end `Point` within local coordinates of the `Connection`.

#### setEndPointHint

    public void setEndPointHint(Point endPositionHint)

Sets the end position hint to the given value.

Parameters:
  `endPositionHint` - The new end position hint.

#### setInterpolator

    public void setInterpolator(IConnectionInterpolator interpolator)

Sets the `IConnectionInterpolator` of this `Connection` to the given `IConnectionInterpolator`.

Parameters:
  `interpolator` - The new `IConnectionInterpolator` for this `Connection`.

#### setPoints

    public void setPoints(java.util.List<Point> points)

Replaces all anchors of this `Connection` with the given `IAnchor`s, i.e. the first given `IAnchor` replaces the currently assigned start anchor, the last given `IAnchor` replaces the currently assigned end anchor, and the intermediate `IAnchor`s replace the currently assigned control anchorsByKeys.

Parameters:
  `points` - The new `Point`s for this `Connection`.
Throws:
  `java.lang.IllegalArgumentException` - when less than 2 `IAnchor`s are given.

#### setRouter

    public void setRouter(IConnectionRouter router)

Sets the `IConnectionRouter` of this `Connection` to the given value.

Parameters:
  `router` - The new `IConnectionRouter` for this `Connection`.

#### setStartAnchor

    public void setStartAnchor(IAnchor anchor)

Sets the start `IAnchor` of this `Connection` to the given value.

Parameters:
  `anchor` - The new start `IAnchor` for this `Connection`.

#### setStartDecoration

    public void setStartDecoration(javafx.scene.Node decoration)

Sets the start decoration `Node` of this `Connection` to the given value.

Parameters:
  `decoration` - The new start decoration `Node` for this `Connection`.

#### setStartPoint

    public void setStartPoint(Point startPoint)

Sets the `start anchor` of this `Connection` to an `StaticAnchor` yielding the given `Point`.

Parameters:
  `startPoint` - The new start `Point` within local coordinates of the `Connection`.

#### setStartPointHint

    public void setStartPointHint(Point startPositionHint)

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 an `ObjectProperty` wrapping the start decoration `Node`.

See Also:
  `getStartDecoration()`, `setStartDecoration(Node)`