Package com.io7m.jcamera

# Class JCameraFPSStyleMouseRegion

java.lang.Object
com.io7m.jcamera.JCameraFPSStyleMouseRegion

All Implemented Interfaces:
  `JCameraFPSStyleMouseRegionType`

public final class JCameraFPSStyleMouseRegion extends Object implements JCameraFPSStyleMouseRegionType
An immutable rectangular region that maps mouse positions to movements.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `JCameraFPSStyleMouseRegion.Builder`
  Builds instances of type `JCameraFPSStyleMouseRegion`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static JCameraFPSStyleMouseRegion.Builder`
  `builder()`
  Creates a builder for `JCameraFPSStyleMouseRegion`.
  `double`
  `centerX()`
  `double`
  `centerY()`
  `static JCameraFPSStyleMouseRegion`
  `copyOf(JCameraFPSStyleMouseRegionType instance)`
  Creates an immutable copy of a `JCameraFPSStyleMouseRegionType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `JCameraFPSStyleMouseRegion` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `origin`, `width`, `height`, `centerX`, `centerY`.
  `double`
  `height()`
  `static JCameraFPSStyleMouseRegion`
  `of(JCameraScreenOrigin origin, double width, double height)`
  Construct a new immutable `JCameraFPSStyleMouseRegion` instance.
  `JCameraScreenOrigin`
  `origin()`
  `String`
  `toString()`
  Prints the immutable value `JCameraFPSStyleMouseRegion` with attribute values.
  `double`
  `width()`
  `final JCameraFPSStyleMouseRegion`
  `withHeight(double value)`
  Copy the current immutable object by setting a value for the `height` attribute.
  `final JCameraFPSStyleMouseRegion`
  `withOrigin(JCameraScreenOrigin value)`
  Copy the current immutable object by setting a value for the `origin` attribute.
  `final JCameraFPSStyleMouseRegion`
  `withWidth(double value)`
  Copy the current immutable object by setting a value for the `width` attribute.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.io7m.jcamera.JCameraFPSStyleMouseRegionType

  `checkPreconditions, coefficients`

- ## Method Details

  - ### origin

    public JCameraScreenOrigin origin()
    Specified by:
      `origin` in interface `JCameraFPSStyleMouseRegionType`
    Returns:
      The current screen origin

  - ### width

    public double width()
    Specified by:
      `width` in interface `JCameraFPSStyleMouseRegionType`
    Returns:
      The width of the region

  - ### height

    public double height()
    Specified by:
      `height` in interface `JCameraFPSStyleMouseRegionType`
    Returns:
      The height of the region

  - ### centerX

    public double centerX()
    Specified by:
      `centerX` in interface `JCameraFPSStyleMouseRegionType`
    Returns:
      The X coordinate of the center of the region

  - ### centerY

    public double centerY()
    Specified by:
      `centerY` in interface `JCameraFPSStyleMouseRegionType`
    Returns:
      The Y coordinate of the center of the region

  - ### withOrigin

    public final JCameraFPSStyleMouseRegion withOrigin(JCameraScreenOrigin value)
    Copy the current immutable object by setting a value for the `origin` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for origin
    Returns:
      A modified copy of the `this` object

  - ### withWidth

    public final JCameraFPSStyleMouseRegion withWidth(double value)
    Copy the current immutable object by setting a value for the `width` attribute. A value strict bits equality used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for width
    Returns:
      A modified copy of the `this` object

  - ### withHeight

    public final JCameraFPSStyleMouseRegion withHeight(double value)
    Copy the current immutable object by setting a value for the `height` attribute. A value strict bits equality used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for height
    Returns:
      A modified copy of the `this` object

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `JCameraFPSStyleMouseRegion` that have equal attribute values.
    Overrides:
      `equals` in class `Object`
    Returns:
      `true` if `this` is equal to `another` instance

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `origin`, `width`, `height`, `centerX`, `centerY`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

    public String toString()
    Prints the immutable value `JCameraFPSStyleMouseRegion` with attribute values.
    Overrides:
      `toString` in class `Object`
    Returns:
      A string representation of the value

  - ### of

    public static JCameraFPSStyleMouseRegion of(JCameraScreenOrigin origin, double width, double height)
    Construct a new immutable `JCameraFPSStyleMouseRegion` instance.
    Parameters:
      `origin` - The value for the `origin` attribute
      `width` - The value for the `width` attribute
      `height` - The value for the `height` attribute
    Returns:
      An immutable JCameraFPSStyleMouseRegion instance

  - ### copyOf

    public static JCameraFPSStyleMouseRegion copyOf(JCameraFPSStyleMouseRegionType instance)
    Creates an immutable copy of a `JCameraFPSStyleMouseRegionType` value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
    Parameters:
      `instance` - The instance to copy
    Returns:
      A copied immutable JCameraFPSStyleMouseRegion instance

  - ### builder

    public static JCameraFPSStyleMouseRegion.Builder builder()
    Creates a builder for `JCameraFPSStyleMouseRegion`.

         JCameraFPSStyleMouseRegion.builder()
            .setOrigin(com.io7m.jcamera.JCameraScreenOrigin) // required origin
            .setWidth(double) // required width
            .setHeight(double) // required height
            .build();

    Returns:
      A new JCameraFPSStyleMouseRegion builder