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
public class BoundsSnappingLocationProvider extends java.lang.Object implements ISnappingLocationProvider
TheBoundsSnappingLocationProviderdeterminesSnappingModel.SnappingLocations along the bounds of the individualIContentParts that contribute to snapping. By default, only the minimum and maximum locations within the bounds are used for snapping.
-
-
Constructor Summary
Constructors Constructor Description BoundsSnappingLocationProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SnappingModel.SnappingLocation>getHorizontalSnappingLocations(IContentPart<? extends javafx.scene.Node> part)Returns the horizontalSnappingModel.SnappingLocations for the givenIContentPart.protected java.util.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.java.util.List<SnappingModel.SnappingLocation>getVerticalSnappingLocations(IContentPart<? extends javafx.scene.Node> part)Returns the verticalSnappingModel.SnappingLocations for the givenIContentPart.
-
-
-
Method Detail
-
getHorizontalSnappingLocations
public java.util.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 java.util.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 java.util.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.
-
-