Skip to main content

Class JtvPoint

public class JtvPoint

An immutable screen-position object encapsulating integer (X, Y) coordinates.

The coordinate origin (0, 0) is the top-left corner of the screen. X increases horizontally to the right; Y increases vertically downwards. All JT Vision views are positioned and sized using TPoint and JtvRect.

org.viktor44.jtvision.core.JtvPoint

Summary​

Constructors​

VisibilitySignature
publicJtvPoint()
publicJtvPoint(int x, int y)

Fields​

ModifiersField nameType
private finalxint
private finalyint

Methods​

ModifiersMethod signatureReturn type
publicadd(JtvPoint other)org.viktor44.jtvision.core.JtvPoint
publicsubtract(JtvPoint other)org.viktor44.jtvision.core.JtvPoint
publicequals(Object obj)boolean
publichashCode()int
publictoString()String
publicgetX()int
publicgetY()int

Constructors​

JtvPoint()​

Constructs the origin point (0, 0).

JtvPoint(int x, int y)​

Constructs a point at the given coordinates.

Parameters

  • x - horizontal position
  • y - vertical position

Fields​

int x​

Horizontal coordinate; 0 is the leftmost column.

int y​

Vertical coordinate; 0 is the topmost row.

Methods​

add(JtvPoint other)​

Returns a new point that is the component-wise sum of this point and other.

Parameters

  • other - the point to add

Returns

new point (x + other.x, y + other.y)

subtract(JtvPoint other)​

Returns a new point that is the component-wise difference of this point and other.

Parameters

  • other - the point to subtract

Returns

new point (x - other.x, y - other.y)

equals(Object obj)​

No method description provided

Parameters

  • obj

hashCode()​

Overrides:

hashCode() in java.lang.Object

No method description provided

toString()​

Overrides:

toString() in java.lang.Object

No method description provided

getX()​

Horizontal coordinate; 0 is the leftmost column.

getY()​

Vertical coordinate; 0 is the topmost row.