Class Pointer

java.lang.Object
nl.colorize.multimedialib.renderer.Pointer

public class Pointer extends Object
Represents a pointer device, which can be a mouse, a trackpad, or touch controls, depending on the current platform and device.

Devices that support multi-touch will allow multiple pointers to be active simultaneously. In such situations the render will provide access to multiple Pointer instances that can be tracked individually, using getId() to identify each pointer.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    int
     
    boolean
    Returns true if this pointer is currently in the pressed state, regardless of the pointer's current position.
    boolean
    isPressed(Rect bounds)
    Returns true if this pointer is currently in the pressed state and the pointer's position is currently located within the specified area.
    boolean
    Returns true if this pointer is currently in the released state, regardless of the pointer's current position.
    boolean
    isReleased(Rect bounds)
    Returns true if this pointer is currently in the released state and the pointer's position is currently located within the specified area.
    void
     
    void
    setPosition(Point2D position)
     
    void
    setState(int state)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Pointer

      public Pointer(String id)
  • Method Details

    • isPressed

      public boolean isPressed()
      Returns true if this pointer is currently in the pressed state, regardless of the pointer's current position.
    • isPressed

      public boolean isPressed(Rect bounds)
      Returns true if this pointer is currently in the pressed state and the pointer's position is currently located within the specified area.
    • isReleased

      public boolean isReleased()
      Returns true if this pointer is currently in the released state, regardless of the pointer's current position.
    • isReleased

      public boolean isReleased(Rect bounds)
      Returns true if this pointer is currently in the released state and the pointer's position is currently located within the specified area.
    • getId

      public String getId()
    • getPosition

      public Point2D getPosition()
    • getState

      public int getState()
    • setId

      public void setId(String id)
    • setPosition

      public void setPosition(Point2D position)
    • setState

      public void setState(int state)