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()intCompares the square of the position.booleanChecks whether two points objects are equal.final intgetX()final intgetY()inthashCode()final Pointscale(float sx, float sy) Scale this instance's x- and y-components, i.e.final Pointscale(int sx, int sy) Scale this instance's x- and y-components, i.e.final PointscaleInv(float sx, float sy) Inverse scale this instance's x- and y-components, i.e.final PointscaleInv(int sx, int sy) Inverse scale this instance's x- and y-components, i.e.final voidset(int x, int y) final voidsetX(int x) final voidsetY(int y) toString()final Pointtranslate(int dx, int dy) Translate this instance's x- and y-components, i.e.final PointTranslate 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:
cloneMutablein interfacecom.jogamp.common.type.WriteCloneable
-
clone
-
compareTo
Description copied from interface:PointImmutableCompares the square of the position.
- Specified by:
compareToin interfaceComparable<PointImmutable>- Specified by:
compareToin interfacePointImmutable
-
equals
Description copied from interface:PointImmutableChecks whether two points objects are equal. Two instances ofPointReadOnlyare equal if the two componentsyandxare equal.- Specified by:
equalsin interfacePointImmutable- Overrides:
equalsin classObject- Returns:
trueif the two points are equal; otherwisefalse.
-
getX
public final int getX()- Specified by:
getXin interfacePointImmutable
-
getY
public final int getY()- Specified by:
getYin interfacePointImmutable
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacePointImmutable- Overrides:
hashCodein 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
-