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
TheBoundsSnappingLocationProvider
determinesSnappingModel.SnappingLocation
s along the bounds of the individualIContentPart
s 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.SnappingLocation
s 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.SnappingLocation
s for the givenIContentPart
.
-
-
-
Method Detail
-
getHorizontalSnappingLocations
public java.util.List<SnappingModel.SnappingLocation> getHorizontalSnappingLocations(IContentPart<? extends javafx.scene.Node> part)
Description copied from interface:ISnappingLocationProvider
Returns the horizontalSnappingModel.SnappingLocation
s for the givenIContentPart
.- Specified by:
getHorizontalSnappingLocations
in interfaceISnappingLocationProvider
- Parameters:
part
- TheIContentPart
for which to compute theSnappingModel.SnappingLocation
s.- Returns:
- A
List
of all horizontalSnappingModel.SnappingLocation
s 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
- TheIContentPart
for whichSnappingModel.SnappingLocation
s are computed.orient
- TheOrientation
for theSnappingModel.SnappingLocation
s.ratios
- The ratios at which snapping locations should be placed along the bounds.- Returns:
- The
SnappingModel.SnappingLocation
s for the givenIContentPart
according 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:ISnappingLocationProvider
Returns the verticalSnappingModel.SnappingLocation
s for the givenIContentPart
.- Specified by:
getVerticalSnappingLocations
in interfaceISnappingLocationProvider
- Parameters:
part
- TheIContentPart
for which to compute theSnappingModel.SnappingLocation
s.- Returns:
- A
List
of all verticalSnappingModel.SnappingLocation
s for the givenIContentPart
.
-
-