Class LinearPathMouseMovement

java.lang.Object
net.storm.api.interact.mouse.LinearPathMouseMovement
All Implemented Interfaces:
MouseMovementStrategy

public class LinearPathMouseMovement extends Object implements MouseMovementStrategy
Mouse movement strategy that creates a linear (straight-line) path from current to target. The number of steps determines the smoothness of the path. Execution speed is determined by the InteractManager based on queue size.
  • Constructor Details

    • LinearPathMouseMovement

      public LinearPathMouseMovement(int steps)
      Creates a linear path mouse movement strategy.
      Parameters:
      steps - Number of intermediate points in the path (higher = smoother movement)
    • LinearPathMouseMovement

      public LinearPathMouseMovement()
      Creates a linear path with 10 steps (default).
  • Method Details

    • generatePath

      public MouseMovementStrategy.MousePath generatePath(Point current, Point target)
      Description copied from interface: MouseMovementStrategy
      Generates a mouse movement path from the current position to the target position.

      This method must NOT:

      • Dispatch any events
      • Block the thread
      • Determine execution speed (that's the InteractManager's job)
      Specified by:
      generatePath in interface MouseMovementStrategy
      Parameters:
      current - The current mouse position (can be null if unknown)
      target - The target position to move to
      Returns:
      A MousePath containing the sequence of points defining the path shape