From: David P. <Dav...@be...> - 2010-01-11 16:55:21
|
Hi, After inspecting the source for the various components I found one fairly inefficient solution that requires iterating through all leaves: Add a MouseListener to the JTreeMap object: jTreeMap.addMouseListener(new ClickListener(this)); Inside ClickListener() in the mousePressed call: TreeMapNode node = map.curTree.getActiveLeaf().getActiveLeaf(arg0.getX(), arg0.getY()); Gives me the leaf in question, which I can then extract whatever info I need from. The getActiveLeaf call is where the iteration happens. It's effectively searching for which leaf is at the x,y specified. David From: David Prime [mailto:Dav...@be...] Sent: 11 January 2010 11:40 To: jtr...@li... Subject: [Jtreemap-user] on click event hooks on leaf nodes Hi All, I was bored on Friday and decided to attach a jtreeview program to the live market data feed from betfair.com to show relative market activity. What I'd now like to be able to do is hook into the click events for the leaf nodes so I can add some custom behaviour. I had a poke around in the docs but couldn't find anything. Thanks for the great work so far on the lib! Cheers, David Prime Betfair ________________________________________________________________________ In order to protect our email recipients, Betfair Group use SkyScan from MessageLabs to scan all Incoming and Outgoing mail for viruses. ________________________________________________________________________ ________________________________________________________________________ In order to protect our email recipients, Betfair Group use SkyScan from MessageLabs to scan all Incoming and Outgoing mail for viruses. ________________________________________________________________________ |