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.SnappingLocation
s along the bounds of the individual
IContentPart
s that contribute to snapping. By default, only the
minimum and maximum locations within the bounds are used for snapping.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetHorizontalSnappingLocations
(IContentPart<? extends javafx.scene.Node> part) Returns the horizontalSnappingModel.SnappingLocation
s 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.SnappingLocation
s 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: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 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 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
.
-