How can i convert local client screen coordinates to remote application coordinates..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajay_Partoti
Posted On:   Wednesday, October 5, 2005 01:44 PM

I am making one application in which i need to map client application coordinates to remote screen coordinates. My application contains one JScrollPane i had already add mousemovelistener to it. I get coordinates from e.getX() and e.getY() under mousemove. How can i convert this coordinate to Screen coordinates on remote computer. I know only these things: // Convert a coordinate relative to a component's bounds to screen coordinates Point pt = new Point(component.getLocation()); SwingUtilities.convertPointToScreen(pt, component); // Convert a coordinate on a screen to a coordinate   More>>

I am making one application in which i need to map client application coordinates

to remote screen coordinates.



My application contains one JScrollPane i had already add mousemovelistener to it.



I get coordinates from e.getX() and e.getY() under mousemove.



How can i convert this coordinate to Screen coordinates on remote computer.



I know only these things:



// Convert a coordinate relative to a component's bounds to screen coordinates


Point pt = new Point(component.getLocation());


SwingUtilities.convertPointToScreen(pt, component);



// Convert a coordinate on a screen to a coordinate relative to a component's // bounds


SwingUtilities.convertPointFromScreen(pt, component);




Is their any magical formula or api to solve this problem?



But how i can implement it. On local computer i stored

Point pt as



pt.x = e.getX();


pt.y = e.getY();



now change it on remote computer as


But here what is the component parameter i don't

know.Please help me to implement it.Or if you have any idea regarding such senario.Please help me with some code...


SwingUtilities.convertPointToScreen(pt,???????);



Thanks in advance!!!!

   <<Less

Re: How can i convert local client screen coordinates to remote application coordinates..

Posted By:   Almagest_FUTT  
Posted On:   Wednesday, October 5, 2005 05:31 PM

Convert to screen coordinates and then translate according to the ratio of client screen resolution versus remote screen resolution, either before you send or afterwards.


.. that is: if you really need the topical information. If you need but semantical information in the end, refactor your approach (that is: think a lot about it).

About | Sitemap | Contact