Package com.jogamp.nativewindow.util
Class Point
- java.lang.Object
-
- com.jogamp.nativewindow.util.Point
-
- All Implemented Interfaces:
WriteCloneable,PointImmutable,Cloneable,Comparable<PointImmutable>
public class Point extends Object implements Cloneable, PointImmutable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()ObjectcloneMutable()intcompareTo(PointImmutable d)Compares the square of the position.booleanequals(Object obj)Checks whether two points objects are equal.intgetX()intgetY()inthashCode()Pointscale(float sx, float sy)Scale this instance's x- and y-components, i.e.Pointscale(int sx, int sy)Scale this instance's x- and y-components, i.e.PointscaleInv(float sx, float sy)Inverse scale this instance's x- and y-components, i.e.PointscaleInv(int sx, int sy)Inverse scale this instance's x- and y-components, i.e.Pointset(int x, int y)Set this instance's x- and y-component.PointsetX(int x)Set this instance's x--component.PointsetY(int y)Set this instance's y-component.StringtoString()Pointtranslate(int dx, int dy)Translate this instance's x- and y-components, i.e.Pointtranslate(Point pd)Translate this instance's x- and y-components, i.e.Pointtranslate(PointImmutable pd)Translate this instance's x- and y-components, i.e.
-
-
-
Method Detail
-
cloneMutable
public Object cloneMutable()
- Specified by:
cloneMutablein interfaceWriteCloneable
-
clone
public Object clone()
-
compareTo
public int compareTo(PointImmutable d)
Description copied from interface:PointImmutableCompares the square of the position.
- Specified by:
compareToin interfaceComparable<PointImmutable>- Specified by:
compareToin interfacePointImmutable
-
equals
public boolean equals(Object obj)
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
-
set
public final Point set(int x, int y)
Set this instance's x- and y-component.- Parameters:
x- value for x-componenty- value for y-component- Returns:
- this instance for scaling
-
setX
public final Point setX(int x)
Set this instance's x--component.- Parameters:
x- value for x-component- Returns:
- this instance for scaling
-
setY
public final Point setY(int y)
Set this instance's y-component.- Parameters:
y- value for y-component- Returns:
- this instance for scaling
-
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(PointImmutable 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 xdy- 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 xsy- 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 xsy- 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 xsy- 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 xsy- inverse scale factor for y- Returns:
- this instance for scaling
-
-