Package org.eclipse.gef.mvc.fx.providers
Class BoundsSnappingLocationProvider
java.lang.Object
org.eclipse.gef.mvc.fx.providers.BoundsSnappingLocationProvider
- All Implemented Interfaces:
ISnappingLocationProvider
- Direct Known Subclasses:
CenterSnappingLocationProvider,TopLeftSnappingLocationProvider
The
BoundsSnappingLocationProvider determines
SnappingModel.SnappingLocations along the bounds of the individual
IContentParts that contribute to snapping. By default, only the
minimum and maximum locations within the bounds are used for snapping.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHorizontalSnappingLocations(IContentPart<? extends javafx.scene.Node> part) Returns the horizontalSnappingModel.SnappingLocations for the givenIContentPart.protected List<SnappingModel.SnappingLocation>getSnappingLocations(IContentPart<? extends javafx.scene.Node> part, javafx.geometry.Orientation orient, double... ratios) Iterates over the given ratios and interpolates positions within the bounds for the individual ratios.getVerticalSnappingLocations(IContentPart<? extends javafx.scene.Node> part) Returns the verticalSnappingModel.SnappingLocations for the givenIContentPart.
-
Constructor Details
-
BoundsSnappingLocationProvider
public BoundsSnappingLocationProvider()
-
-
Method Details
-
getHorizontalSnappingLocations
public List<SnappingModel.SnappingLocation> getHorizontalSnappingLocations(IContentPart<? extends javafx.scene.Node> part) Description copied from interface:ISnappingLocationProviderReturns the horizontalSnappingModel.SnappingLocations for the givenIContentPart.- Specified by:
getHorizontalSnappingLocationsin interfaceISnappingLocationProvider- Parameters:
part- TheIContentPartfor which to compute theSnappingModel.SnappingLocations.- Returns:
- A
Listof all horizontalSnappingModel.SnappingLocations for the givenIContentPart.
-
getSnappingLocations
protected List<SnappingModel.SnappingLocation> getSnappingLocations(IContentPart<? extends javafx.scene.Node> part, javafx.geometry.Orientation orient, double... ratios) Iterates over the given ratios and interpolates positions within the bounds for the individual ratios.- Parameters:
part- TheIContentPartfor whichSnappingModel.SnappingLocations are computed.orient- TheOrientationfor theSnappingModel.SnappingLocations.ratios- The ratios at which snapping locations should be placed along the bounds.- Returns:
- The
SnappingModel.SnappingLocations for the givenIContentPartaccording to its bounds and the given ratios.
-
getVerticalSnappingLocations
public List<SnappingModel.SnappingLocation> getVerticalSnappingLocations(IContentPart<? extends javafx.scene.Node> part) Description copied from interface:ISnappingLocationProviderReturns the verticalSnappingModel.SnappingLocations for the givenIContentPart.- Specified by:
getVerticalSnappingLocationsin interfaceISnappingLocationProvider- Parameters:
part- TheIContentPartfor which to compute theSnappingModel.SnappingLocations.- Returns:
- A
Listof all verticalSnappingModel.SnappingLocations for the givenIContentPart.
-