Package com.teamdev.jxbrowser.ui
Class TouchPoint.Builder
java.lang.Object
com.teamdev.jxbrowser.ui.TouchPoint.Builder
- Enclosing interface:
- TouchPoint
A builder of
TouchPoint.
Builders are created by invoking TouchPoint.newBuilder(int, Point, State)}.
Each of the setter methods modifies the state of the builder and returns the same instance.
Builders are not thread-safe and should not be used concurrently from multiple threads
without external synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newTouchPointinstance built from the current state of this builder.force(float force) Sets the applied force of the touch point.positionInWidget(Point widgetPosition) Sets the touch position relative to the bounds of the widget.radiusX(float radiusX) Sets the X axis radius of the touch ellipse.radiusY(float radiusY) Sets the Y axis radius of the touch ellipse.rotationAngle(float rotationAngle) Sets the rotation angle of the touch.
-
Method Details
-
force
Sets the applied force of the touch point.- Parameters:
force- the value of the applied force, in range [0, 1], where 0 - no pressure, 1 - some maximum pressure.- Returns:
- this builder
-
rotationAngle
Sets the rotation angle of the touch.- Parameters:
rotationAngle- the orientation of a touch ellipse.- Returns:
- this builder
-
positionInWidget
Sets the touch position relative to the bounds of the widget.- Parameters:
widgetPosition- the touch position- Returns:
- this builder
-
radiusX
Sets the X axis radius of the touch ellipse.- Parameters:
radiusX- the major X axis length of the touch ellipse- Returns:
- this builder
-
radiusY
Sets the Y axis radius of the touch ellipse.- Parameters:
radiusY- the major Y axis length of the touch ellipse- Returns:
- this builder
-
build
Returns a newTouchPointinstance built from the current state of this builder.- Returns:
- a new
TouchPointinstance
-