Package org.eclipse.gef.mvc.fx.parts

# Class AbstractSegmentHandlePart<N extends javafx.scene.Node>

java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
org.eclipse.gef.mvc.fx.parts.AbstractHandlePart<N>
org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<N>

Type Parameters:
  `N` - The type of visual used by this handle. Needs to be a sub-type of `Node`.

All Implemented Interfaces:
  `Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>`, `IActivatable`, `IAdaptable`, `IAdaptable.Bound<IViewer>`, `IDisposable`, `IHandlePart<N>`, `IVisualPart<N>`

Direct Known Subclasses:
  `CircleSegmentHandlePart`, `RectangleSegmentHandlePart`, `SquareSegmentHandlePart`

public abstract class AbstractSegmentHandlePart<N extends javafx.scene.Node> extends AbstractHandlePart<N> implements Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>
An `AbstractSegmentHandlePart` is bound to a segment of a poly-bezier handle geometry, represented by an array of `BezierCurve`s. The segmentIndex of the `AbstractSegmentHandlePart` identifies that segment (0, 1, 2, ...). The segmentParameter specifies the position of this handle part on the segment (0 = start, 0.5 = mid, 1 = end).

## Property Summary

### Properties inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart

`active, adaptable, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual`

### Properties inherited from interface org.eclipse.gef.common.activate.IActivatable

`active`

### Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`adapters`

### Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`adaptable`

### Properties inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual`

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`IAdaptable.Bound<A extends IAdaptable>`

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`IAdaptable.Bound.Impl<T extends IAdaptable>`

## Field Summary

### Fields inherited from interface org.eclipse.gef.common.activate.IActivatable

`ACTIVE_PROPERTY`

### Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`ADAPTERS_PROPERTY`

### Fields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY`

## Constructor Summary

Constructors
Constructor
Description
`AbstractSegmentHandlePart()`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(AbstractSegmentHandlePart<? extends javafx.scene.Node> o)`
`void`
`doRefreshVisual(N visual)`
Refreshes this part's visualization based on this part's content.
`protected BezierCurve`
`getBezierSegmentInParent()`
Returns the `BezierCurve` at which this handle part is anchored (depending on segment index), or `null` if that `BezierCurve` cannot be determined.
`protected javafx.scene.paint.Color`
`getConnectedFill()`
Returns the `Color` that is used to fill connected handles.
`protected javafx.scene.paint.Color`
`getInsertFill()`
Returns the `Color` that is used to fill insertion handles.
`protected javafx.scene.paint.Color`
`getMoveFill()`
Returns the `Color` that is used to fill movement handles.
`protected Point`
`getPosition(BezierCurve segment)`
Returns the position of this `AbstractSegmentHandlePart` on the given segment using the segment parameter that is assigned to this part.
`int`
`getSegmentCount()`
Returns the number of segments that are provided to this part.
`int`
`getSegmentIndex()`
The segmentIndex specifies the segment of the IGeometry provided by the handle geometry provider on which this selection handle part is positioned.
`double`
`getSegmentParameter()`
The segmentParameter is a value between 0 and 1.
`protected BezierCurve[]`
`getSegmentsInScene()`
Returns the `BezierCurve`s that are provided to this part in the coordinate system of the `Scene`.
`protected javafx.scene.paint.Color`
`getStroke()`
Returns the `Color` that is used to stroke handles.
`void`
`setSegmentIndex(int segmentIndex)`
Sets the segment index and refreshes the visual.
`void`
`setSegmentParameter(double segmentParameter)`
Sets the segment parameter and refreshes the visual.
`void`
`setSegmentsProvider(Provider<BezierCurve[]> segmentsProvider)`
Sets the `Provider<BezierCurve[]>` for this part to the given value.
`protected void`
`updateLocation(N visual)`
Computes the location for this part and relocates its visual to that location.

### Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractHandlePart

`doAddChildVisual, doAttachToAnchorageVisual, doDetachFromAnchorageVisual, doRemoveChildVisual`

### Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart

`activate, activateAdapters, activateChildren, activeProperty, adaptableProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, deactivate, deactivateAdapters, deactivateChildren, detachAnchored, detachFromAnchorage, detachFromAnchorage, determineViewer, dispose, doActivate, doCreateVisual, doDeactivate, getAdaptable, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, register, registerAtVisualPartMap, removeChild, removeChildren, reorderChild, setAdaptable, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregister, unregisterFromVisualPartMap, unsetAdapter`

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

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

### Methods inherited from interface org.eclipse.gef.common.activate.IActivatable

`activate, activeProperty, deactivate, isActive`

### Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter`

### Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`adaptableProperty, getAdaptable, setAdaptable`

### Methods inherited from interface org.eclipse.gef.common.dispose.IDisposable

`dispose`

### Methods inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getViewer, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual`

## Constructor Details

### AbstractSegmentHandlePart

public AbstractSegmentHandlePart()

## Method Details

### compareTo

public int compareTo(AbstractSegmentHandlePart<? extends javafx.scene.Node> o)

Specified by:
  `compareTo` in interface `Comparable<N extends javafx.scene.Node>`

### doRefreshVisual

public void doRefreshVisual(N visual)
Description copied from class: `AbstractVisualPart`
Refreshes this part's visualization based on this part's content.

Specified by:
  `doRefreshVisual` in class `AbstractVisualPart<N extends javafx.scene.Node>`
Parameters:
  `visual` - This part's visual.

### getBezierSegmentInParent

protected BezierCurve getBezierSegmentInParent()
Returns the `BezierCurve` at which this handle part is anchored (depending on segment index), or `null` if that `BezierCurve` cannot be determined.

Returns:
  The `BezierCurve` at which this handle part is anchored, or `null` if that `BezierCurve` cannot be determined.

### getConnectedFill

protected javafx.scene.paint.Color getConnectedFill()
Returns the `Color` that is used to fill connected handles.

Returns:
  The `Color` that is used to fill connected handles.

### getInsertFill

protected javafx.scene.paint.Color getInsertFill()
Returns the `Color` that is used to fill insertion handles.

Returns:
  The `Color` that is used to fill insertion handles.

### getMoveFill

protected javafx.scene.paint.Color getMoveFill()
Returns the `Color` that is used to fill movement handles.

Returns:
  The `Color` that is used to fill movement handles.

### getPosition

protected Point getPosition(BezierCurve segment)
Returns the position of this `AbstractSegmentHandlePart` on the given segment using the segment parameter that is assigned to this part.

Parameters:
  `segment` - The `BezierCurve` on which the position is evaluated.
Returns:
  The position of this part on the given segment using the segment parameter of this part.

### getSegmentCount

public int getSegmentCount()
Returns the number of segments that are provided to this part.

Returns:
  The number of segments that are provided to this part.

### getSegmentIndex

public int getSegmentIndex()
The segmentIndex specifies the segment of the IGeometry provided by the handle geometry provider on which this selection handle part is positioned. For a shape geometry, segments are determined by the `IShape.getOutlineSegments()` method. For a curve geometry, segments are determined by the `ICurve.toBezier()` method. The exact position on the segment is specified by the `segmentParameter`.

Returns:
  segmentIndex

### getSegmentParameter

public double getSegmentParameter()
The segmentParameter is a value between 0 and 1. It determines the final point on the segment which this selection handle part belongs to.

Returns:
  segmentParameter

### getSegmentsInScene

protected BezierCurve[] getSegmentsInScene()
Returns the `BezierCurve`s that are provided to this part in the coordinate system of the `Scene`.

Returns:
  The `BezierCurve`s that are provided to this part in the coordinate system of the `Scene`.

### getStroke

protected javafx.scene.paint.Color getStroke()
Returns the `Color` that is used to stroke handles.

Returns:
  The `Color` that is used to stroke handles.

### setSegmentIndex

public void setSegmentIndex(int segmentIndex)
Sets the segment index and refreshes the visual.

Parameters:
  `segmentIndex` - The segment index to set.
See Also:
  - `getSegmentIndex()`

### setSegmentParameter

public void setSegmentParameter(double segmentParameter)
Sets the segment parameter and refreshes the visual.

Parameters:
  `segmentParameter` - The segment parameter to set.
See Also:
  - `getSegmentParameter()`

### setSegmentsProvider

public void setSegmentsProvider(Provider<BezierCurve[]> segmentsProvider)
Sets the `Provider<BezierCurve[]>` for this part to the given value.

Parameters:
  `segmentsProvider` - The new `Provider<BezierCurve[]>` for this part.

### updateLocation

protected void updateLocation(N visual)
Computes the location for this part and relocates its visual to that location. The visual is made invisible if this part has an invalid index (out of bounds), i.e. when no location can be computed.

Parameters:
  `visual` - This part's visual for convenience.