Class Point

java.lang.Object
com.jogamp.nativewindow.util.Point
All Implemented Interfaces:
com.jogamp.common.type.WriteCloneable, PointImmutable, Cloneable, Comparable<PointImmutable>

public class Point extends Object implements Cloneable, PointImmutable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Point(int x, int y)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    int
    Compares the square of the position.
    boolean
    Checks whether two points objects are equal.
    final int
     
    final int
     
    int
     
    final Point
    scale(float sx, float sy)
    Scale this instance's x- and y-components, i.e.
    final Point
    scale(int sx, int sy)
    Scale this instance's x- and y-components, i.e.
    final Point
    scaleInv(float sx, float sy)
    Inverse scale this instance's x- and y-components, i.e.
    final Point
    scaleInv(int sx, int sy)
    Inverse scale this instance's x- and y-components, i.e.
    final void
    set(int x, int y)
     
    final void
    setX(int x)
     
    final void
    setY(int y)
     
     
    final Point
    translate(int dx, int dy)
    Translate this instance's x- and y-components, i.e.
    final Point
    Translate this instance's x- and y-components, i.e.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Point

      public Point(int x, int y)
    • Point

      public Point()
  • Method Details

    • cloneMutable

      public Object cloneMutable()
      Specified by:
      cloneMutable in interface com.jogamp.common.type.WriteCloneable
    • clone

      public Object clone()
    • compareTo

      public int compareTo(PointImmutable d)
      Description copied from interface: PointImmutable

      Compares the square of the position.

      Specified by:
      compareTo in interface Comparable<PointImmutable>
      Specified by:
      compareTo in interface PointImmutable
    • equals

      public boolean equals(Object obj)
      Description copied from interface: PointImmutable
      Checks whether two points objects are equal. Two instances of PointReadOnly are equal if the two components y and x are equal.
      Specified by:
      equals in interface PointImmutable
      Overrides:
      equals in class Object
      Returns:
      true if the two points are equal; otherwise false.
    • getX

      public final int getX()
      Specified by:
      getX in interface PointImmutable
    • getY

      public final int getY()
      Specified by:
      getY in interface PointImmutable
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface PointImmutable
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • set

      public final void set(int x, int y)
    • setX

      public final void setX(int x)
    • setY

      public final void setY(int y)
    • translate

      public final Point translate(Point pd)
      Translate this instance's x- and y-components, i.e. add the values of the given delta point to them.
      Parameters:
      pd - delta point
      Returns:
      this instance for scaling
    • translate

      public final Point translate(int dx, int dy)
      Translate this instance's x- and y-components, i.e. add the given deltas to them.
      Parameters:
      dx - delta for x
      dy - delta for y
      Returns:
      this instance for scaling
    • scale

      public final Point scale(int sx, int sy)
      Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.
      Parameters:
      sx - scale factor for x
      sy - scale factor for y
      Returns:
      this instance for scaling
    • scale

      public final Point scale(float sx, float sy)
      Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

      The product is rounded back to integer.

      Parameters:
      sx - scale factor for x
      sy - scale factor for y
      Returns:
      this instance for scaling
    • scaleInv

      public final Point scaleInv(int sx, int sy)
      Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.
      Parameters:
      sx - inverse scale factor for x
      sy - inverse scale factor for y
      Returns:
      this instance for scaling
    • scaleInv

      public final Point scaleInv(float sx, float sy)
      Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

      The product is rounded back to integer.

      Parameters:
      sx - inverse scale factor for x
      sy - inverse scale factor for y
      Returns:
      this instance for scaling