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.
  • Constructor Details

    • ChopBoxStrategy

      public ChopBoxStrategy()
  • Method Details

    • computeAnchorageReferencePointInLocal

      protected Point computeAnchorageReferencePointInLocal(javafx.scene.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(javafx.scene.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:
    • computePositionInScene

      public Point computePositionInScene(javafx.scene.Node anchorage, javafx.scene.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.