Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a bit of advice

 
joew weakers
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
joew weakers
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeff. I will give that a shot
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic