T
- The type of the items this class can snappublic interface IGridConstraintProvider<T>
GridConstraintProvider
Modifier and Type | Method and Description |
---|---|
PointD |
getGridOrigin()
Gets the canonic origin of the grid.
|
double |
getHorizontalGridWidth()
Gets the canonic grid width in horizontal direction.
|
double |
getVerticalGridWidth()
Gets the canonic grid width in vertical direction.
|
boolean |
snapToGrid(IInputModeContext context,
T item,
IMutablePoint location,
SnapPolicy xSnapPolicy,
SnapPolicy ySnapPolicy)
Performs the actual snapping to grid coordinates.
|
PointD getGridOrigin()
double getHorizontalGridWidth()
double getVerticalGridWidth()
boolean snapToGrid(IInputModeContext context, T item, IMutablePoint location, SnapPolicy xSnapPolicy, SnapPolicy ySnapPolicy)
context
- The context in which the snapping should occur.item
- The item of which the coordinates should be snapped.location
- The coordinates to snap.xSnapPolicy
- The policy for the x coordinate.ySnapPolicy
- The policy for the y coordinate.