Class TouchPoint.Builder

java.lang.Object
com.teamdev.jxbrowser.ui.TouchPoint.Builder
Enclosing interface:
TouchPoint

public static final class TouchPoint.Builder extends Object
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 Details

    • force

      public TouchPoint.Builder force(float 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

      public TouchPoint.Builder rotationAngle(float rotationAngle)
      Sets the rotation angle of the touch.
      Parameters:
      rotationAngle - the orientation of a touch ellipse.
      Returns:
      this builder
    • positionInWidget

      public TouchPoint.Builder positionInWidget(Point widgetPosition)
      Sets the touch position relative to the bounds of the widget.
      Parameters:
      widgetPosition - the touch position
      Returns:
      this builder
    • radiusX

      public TouchPoint.Builder radiusX(float 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

      public TouchPoint.Builder radiusY(float 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

      public TouchPoint build()
      Returns a new TouchPoint instance built from the current state of this builder.
      Returns:
      a new TouchPoint instance