org.eclipse.gef.fx.anchors

## Class ChopBoxStrategy

- java.lang.Object
- - org.eclipse.gef.fx.anchors.ProjectionStrategy
  - - org.eclipse.gef.fx.anchors.ChopBoxStrategy

All Implemented Interfaces:
  IComputationStrategy

    public class ChopBoxStrategy
    extends ProjectionStrategy

A specific projection strategy that is based on a center-projection of the given reference point.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.gef.fx.anchors.IComputationStrategy

`IComputationStrategy.Parameter<T>`

### Constructor Summary

Constructors
Constructor and Description
`ChopBoxStrategy()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected Point` `computeAnchorageReferencePointInLocal(Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInAnchorageLocal)` Computes the anchorage reference position within the coordinate system of the given `IGeometry`.
`protected Point` `computeAnchorageReferencePointInScene(Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInScene)` Computes the anchorage reference position in scene coordinates, based on the given anchorage geometry.
`Point` `computePositionInScene(Node anchorage, Node anchored, Set<IComputationStrategy.Parameter<?>> parameters)` Computes an anchor position based on the given anchorage visual, anchored visual, and anchored reference point.

### Methods inherited from class org.eclipse.gef.fx.anchors.ProjectionStrategy

`computeProjectionInScene, getOutlineSegments, getRequiredParameters`

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

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

### Constructor Detail

#### ChopBoxStrategy

    public ChopBoxStrategy()

### Method Detail

#### computeAnchorageReferencePointInLocal

    protected Point computeAnchorageReferencePointInLocal(Node anchorage,
                                                          IGeometry geometryInLocal,
                                                          Point anchoredReferencePointInAnchorageLocal)

Computes the anchorage reference position within the coordinate system of the given `IGeometry`. Will return the center of a `IShape` or `Path` geometry, if it is contained within the shape or path. Will return `null` otherwise to indicate that the computation should fall back to the nearest projection on the anchorage geometry outline.

Parameters:
  `anchorage` - The anchorage visual.
  `geometryInLocal` - The anchorage geometry within the local coordinate system of the anchorage visual.
  `anchoredReferencePointInAnchorageLocal` - Reference point of the anchored for which to determine the anchorage reference point. Within the local coordinate system of the anchorage.
Returns:
  A position within the given `IGeometry`, or `null` if the computation should rather fall back to the nearest projection.

#### computeAnchorageReferencePointInScene

    protected Point computeAnchorageReferencePointInScene(Node anchorage,
                                                          IGeometry geometryInLocal,
                                                          Point anchoredReferencePointInScene)

Computes the anchorage reference position in scene coordinates, based on the given anchorage geometry.

Parameters:
  `anchorage` - The anchorage visual.
  `geometryInLocal` - The anchorage geometry within the coordinate system of the anchorage visual.
  `anchoredReferencePointInScene` - The reference `Point` of the anchored for which the anchorage reference `Point` is to be determined.
Returns:
  The anchorage reference position in scene coordinates or `null` if the computation should rather fall back to the nearest projection.
See Also:
  `computeAnchorageReferencePointInLocal(Node, IGeometry, Point)`

#### computePositionInScene

    public Point computePositionInScene(Node anchorage,
                                        Node anchored,
                                        Set<IComputationStrategy.Parameter<?>> parameters)

Description copied from interface: `IComputationStrategy`
Computes an anchor position based on the given anchorage visual, anchored visual, and anchored reference point.

Specified by:
  `computePositionInScene` in interface `IComputationStrategy`
Overrides:
  `computePositionInScene` in class `ProjectionStrategy`
Parameters:
  `anchorage` - The anchorage visual.
  `anchored` - The anchored visual.
  `parameters` - The available computation parameters. strategy.
Returns:
  The anchor position.