[Java] Old Region constructror deprecated: how do i create a Region?

Asked by Uwin Adri

Hi everyone,
Does anyone know what replaced the class Region's constructor? I am doing like this to create my region:
Region r = new Region(x, y, w, h);
The problem is that the constructor is depricated.
Thanks for your help again...

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Roman Podolyan
Solved:
Last query:
Last reply:
Revision history for this message
Best Roman Podolyan (podolyan-roman) said :
#1

I think you may find the info you look for in Sukili Region source code.
It's open and available on GitHub.
https://github.com/sikuli/sikuli/blob/develop/sikuli-script/src/main/java/org/sikuli/script/Region.java

I'm not good at Java, but public static Region create(int x_, int y_, int w_, int h_) looks like what you need. The comments states the same:

 @deprecated Not for public use in Java. =Use Region.create() instead.=

Revision history for this message
Uwin Adri (auwindekwe) said :
#2

Thanks Roman Podolyan, that solved my question.