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
| Visibility | Signature |
|---|---|
| public | JtvPoint() |
| public | JtvPoint(int x, int y) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private final | x | int |
| private final | y | int |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | add(JtvPoint other) | org.viktor44.jtvision.core.JtvPoint |
| public | subtract(JtvPoint other) | org.viktor44.jtvision.core.JtvPoint |
| public | equals(Object obj) | boolean |
| public | hashCode() | int |
| public | toString() | String |
| public | getX() | int |
| public | getY() | int |
Constructors
JtvPoint()
Constructs the origin point (0, 0).
JtvPoint(int x, int y)
Constructs a point at the given coordinates.
Parameters
x- horizontal positiony- 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.