Get Chart (not Easy Chart) mode in script

I put the code below in mouseReleased and now I can detect if zoom is selected. The timing is off, I check before the popup is opened, and I need to loop over the rest of the radiobuttons, but I think I'm on the right track.

from org.jfree.chart import ChartPanel, JFreeChart
from org.jfree.chart.plot import Plot

def findJFChart(src):
	"""IA's EasyChart and XYPlot components have their JFreeChart objects at different positions 
	in the Container/Component hierarchy. This helper function scans the hierarchy, given a container or 
	component as a starting point, and returns a tuple containing the parent JFreeChartPanel and 
	the targeted JFreeChart. Note: The hierarchy is searched depth-first! """  
	#from app.scriptmodule import findJFChart 
	try: 
		return (src, src.chart) 
	except: pass 
	try: 
		for x in range(src.componentCount): 
			try: return findJFChart(src.getComponent(x)) 
			except: pass 
	except: pass 
	raise ValueError, "Unable to Find a JFreeChart Instance"

if event.popupTrigger == 1:
	print "Popup triggered!"
	chart = event.source #parent.getComponent("Easy Chart")
	ch = findJFChart(chart)
	print(str(ch[0].getPopupMenu().getSubElements()[0].getComponent().getItem(0).isSelected()))