chance clickpoints on Eclipse

Asked by emrah kara

How can i chance the clickpoints in java on Eclipse? I know it is really easy if i use Sikuli IDE, but how can i do on Java?
Like here:
s.type(bfi, adresse, 127);
i can say only the X coordinates, but not Y coordinates?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--- for the Java API look:
http://sikuli.org/doc/java-x/

--- s.type(bfi, adresse, 127); i can say only the X coordinates, but not Y coordinates?
type does not accept any X coordinates.

The general signature is:
public <PSRML> int type(PSRML target, java.lang.String text)

where target denotes the location to click as a (PS) text or image to search, whose match target offset (standard center) is used to click, or (R) a region, whose center is clicked or (M) a match (same as image, but no search) or (L) Location (x,y) coordinate. after the click is done, the text is typed.

This is the same as in the IDE, but in Java you have to specify a screen or region object as xxxx.type()

Revision history for this message
emrah kara (emrah-karakoc) said :
#2

Ok but how can i change where target denotes the location to click in Java? How can i give the "xxx.type()" methode the Location(x,y) x and y coordinates to click? or how can i give the methode with my mouse click, to click, what i can do really easy on Sikuli IDE ?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Ok, I think I now understand your problem:
You are missing the capture feature in Eclipse, to screenshot the targets.

People normally use Sikuli in parallel for that, to only get the images, they want to use in there java code together with some personal naming convention (the IDE has an option (preferences) to name your screenshots yourself and/or rename them using the Preview pane.

Revision history for this message
emrah kara (emrah-karakoc) said :
#4

My problem is that:
http://www.myimg.de/?img=Unbenannt58ea8.jpg
if you look at the Screenshot that i made, there is "clickpunkt verschiebung" (clickpoints moving), where i change the x,y coordinations of the clickingtarget. How can i give such parameters in java where to click on the screenshot?

Revision history for this message
Best RaiMan (raimund-hocke) said :
#5

After using the "clickpunkt verschiebung" feature the IDE changes the code behind the image thumbnail from

"some-image.png"

to

Pattern("some-image.png").targetOffset(43,-81)

this you have to do "manually" in your Java code (but you can still use the IDE as mentioned above to see the values - use cancel in this case)

Revision history for this message
emrah kara (emrah-karakoc) said :
#6

Thanks RaiMan, that solved my question.