Package com.jogamp.nativewindow.util
Class Point
java.lang.Object
com.jogamp.nativewindow.util.Point
- All Implemented Interfaces:
com.jogamp.common.type.WriteCloneable
,PointImmutable
,Cloneable
,Comparable<PointImmutable>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
Compares the square of the position.boolean
Checks whether two points objects are equal.final int
getX()
final int
getY()
int
hashCode()
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) toString()
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.
-
Constructor Details
-
Point
public Point(int x, int y) -
Point
public Point()
-
-
Method Details
-
cloneMutable
- Specified by:
cloneMutable
in interfacecom.jogamp.common.type.WriteCloneable
-
clone
-
compareTo
Description copied from interface:PointImmutable
Compares the square of the position.
- Specified by:
compareTo
in interfaceComparable<PointImmutable>
- Specified by:
compareTo
in interfacePointImmutable
-
equals
Description copied from interface:PointImmutable
Checks whether two points objects are equal. Two instances ofPointReadOnly
are equal if the two componentsy
andx
are equal.- Specified by:
equals
in interfacePointImmutable
- Overrides:
equals
in classObject
- Returns:
true
if the two points are equal; otherwisefalse
.
-
getX
public final int getX()- Specified by:
getX
in interfacePointImmutable
-
getY
public final int getY()- Specified by:
getY
in interfacePointImmutable
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacePointImmutable
- Overrides:
hashCode
in classObject
-
toString
-
set
public final void set(int x, int y) -
setX
public final void setX(int x) -
setY
public final void setY(int y) -
translate
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
Translate this instance's x- and y-components, i.e. add the given deltas to them.- Parameters:
dx
- delta for xdy
- delta for y- Returns:
- this instance for scaling
-
scale
Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.- Parameters:
sx
- scale factor for xsy
- scale factor for y- Returns:
- this instance for scaling
-
scale
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 xsy
- scale factor for y- Returns:
- this instance for scaling
-
scaleInv
Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.- Parameters:
sx
- inverse scale factor for xsy
- inverse scale factor for y- Returns:
- this instance for scaling
-
scaleInv
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 xsy
- inverse scale factor for y- Returns:
- this instance for scaling
-