Hey there. Not too sure if I should be posting this query here but it is so general that I wasn't sure where to post it. Basically what I want to do is to record every user interaction that a particular user has with a map representation in some sort of log file. My program renders maps to the screen and the user can switch features on and off and zoom in and out of various regions in the map. The program is set up to catch mouse events so that if the user clicks on, selects or drags on any part of the map, using the mouse, this can then be recorded. So simply is there any particular approach to recording these mouse events in logs or some other format that would best suit the requirements of my system. I am merely looking for advice on what is the best method to record user interaction wit hmy map system. Thanks a lot ... Joe
Hi, Joew - I'm assuming that you're running this on a server. Off the top of my head, I think the simplest solution would go something like the following: Upon startup, your server can open a log file for the day's events, then pass that File object to a FileWriter. Your mouse event handler can write the name of the object triggering the event, and the mouse x-y coordinates, or any other info you may want to capture, to a simple text file using the FileWriter. FileWriter has a write method that appends to an existing file:
Hope that helps.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)
posted 15 years ago
Thanks Jeff. I will give that a shot
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
professionally read, modify and write PDF files from Java