List of usage examples for org.jfree.chart.imagemap OverLIBToolTipTagFragmentGenerator OverLIBToolTipTagFragmentGenerator
public OverLIBToolTipTagFragmentGenerator()
From source file:org.webguitoolkit.ui.controls.chart.Chart.java
/** * generate the image an send the url to the client *///from w w w .j ava2 s . c o m public void load() { HttpSession session = Page.getServletRequest().getSession(true); ChartRenderingInfo info = new ChartRenderingInfo(); JFreeChart chart = getModel().getChart(); if (chart == null) return; // happen for example in the init process try { String filename = ServletUtilities.saveChartAsPNG(chart, getWidth(), getHeight(), info, session); filename = URLEncoder.encode(filename, "UTF-8"); String mapName = id4Map() + filename + ".name"; String imagemap = ImageMapUtilities.getImageMap(mapName, info, new OverLIBToolTipTagFragmentGenerator(), null); // no urls // transfer image map to clinet getContext().add(id4Map(), imagemap, IContext.TYPE_HTML, IContext.STATUS_NOT_EDITABLE); // the img-tag to use the map getContext().add(id4Img() + ".usemap", "#" + mapName, IContext.TYPE_ATT, IContext.STATUS_NOT_EDITABLE); // transfer src- atribute to client String imageUrl = "Chart/DisplayChart?filename=" + filename; getContext().add(id4Img() + ".src", imageUrl, IContext.TYPE_ATT, IContext.STATUS_NOT_EDITABLE); } catch (IOException e) { e.printStackTrace(); throw new WGTException(e); } }