当前位置: 首页>>代码示例>>Java>>正文


Java ImageMapUtilities类代码示例

本文整理汇总了Java中org.jfree.chart.imagemap.ImageMapUtilities的典型用法代码示例。如果您正苦于以下问题:Java ImageMapUtilities类的具体用法?Java ImageMapUtilities怎么用?Java ImageMapUtilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImageMapUtilities类属于org.jfree.chart.imagemap包,在下文中一共展示了ImageMapUtilities类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHTMLEscape

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Some checks for the htmlEscape() method.
 */
public void testHTMLEscape() {
    assertEquals("", ImageMapUtilities.htmlEscape(""));
    assertEquals("abc", ImageMapUtilities.htmlEscape("abc"));
    assertEquals("&", ImageMapUtilities.htmlEscape("&"));
    assertEquals(""", ImageMapUtilities.htmlEscape("\""));
    assertEquals("&lt;", ImageMapUtilities.htmlEscape("<"));
    assertEquals("&gt;", ImageMapUtilities.htmlEscape(">"));
    assertEquals("&#39;", ImageMapUtilities.htmlEscape("\'"));
    assertEquals("&#092;abc", ImageMapUtilities.htmlEscape("\\abc"));
    assertEquals("abc\n", ImageMapUtilities.htmlEscape("abc\n"));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:15,代码来源:ImageMapUtilitiesTests.java

示例2: testJavascriptEscape

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Some checks for the javascriptEscape() method.
 */
public void testJavascriptEscape() {
    assertEquals("", ImageMapUtilities.javascriptEscape(""));
    assertEquals("abc", ImageMapUtilities.javascriptEscape("abc"));
    assertEquals("\\\'", ImageMapUtilities.javascriptEscape("\'"));
    assertEquals("\\\"", ImageMapUtilities.javascriptEscape("\""));
    assertEquals("\\\\", ImageMapUtilities.javascriptEscape("\\"));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:ImageMapUtilitiesTests.java

示例3: execute

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
public String execute()
{		
	ReportUser user = (ReportUser) ActionContext.getContext().getSession().get(
			ORStatics.REPORT_USER);

	report = (Report) ActionContext.getContext().getSession().get(ORStatics.REPORT);

	Map<String,Object> reportParameters = getReportParameterMap(user);

	ReportLog reportLog = new ReportLog(user, report, new Date());

	try
	{
		log.debug("Starting Chart Report: " + report.getName());			

		reportLogProvider.insertReportLog(reportLog);				
		
		ChartReportEngine chartReportEngine = new ChartReportEngine(
				dataSourceProvider, directoryProvider, propertiesProvider);

		ReportEngineInput input = new ReportEngineInput(report, reportParameters);

		ChartEngineOutput chartOutput = (ChartEngineOutput) chartReportEngine
				.generateReport(input);	
		
		chartValues = chartOutput.getChartValues();
		if (chartValues.length == 0)
		{
			addActionError(getText(LocalStrings.ERROR_REPORT_EMPTY));
		}
		
		imageMap = ImageMapUtilities.getImageMap("chart", chartOutput.getChartRenderingInfo());						
		
		HashMap<String,byte[]> imagesMap = new HashMap<String,byte[]>();
		imagesMap.put("ChartImage", chartOutput.getContent());			
		
		session.put(ORStatics.IMAGES_MAP, imagesMap);			
					
		reportLog.setEndTime(new Date());
		reportLog.setStatus(ReportLog.STATUS_SUCCESS);
		reportLogProvider.updateReportLog(reportLog);
           
           /* 
            * set chartRequestId to the current time so that it can be added to
            * the imageLoader URL to make a unique URL and prevent image caching
            */
           chartRequestId = reportLog.getEndTime().getTime();

		log.debug("Finished Chart Report: " + report.getName());
	}
	catch (Exception e)
	{			
		addActionError(getText(e.getMessage()));
		
		reportLog.setMessage(getText(e.getMessage()));
		reportLog.setStatus(ReportLog.STATUS_FAILURE);

		reportLog.setEndTime(new Date());

		try
		{
			reportLogProvider.updateReportLog(reportLog);
		}
		catch (Exception ex)
		{
			log.error("Unable to create ReportLog: " + ex.getMessage());
		}

		return ERROR;
	}		

	return SUCCESS;
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:74,代码来源:ChartReportAction.java

示例4: writeImageMap

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Writes an image map to the specified writer.
 *
 * @param writer  the writer (<code>null</code> not permitted).
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragment
 *     that will contain the tooltip text (<code>null</code> not permitted 
 *     if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment that
 *     will contain the URL reference (<code>null</code> not permitted if 
 *     <code>info</code> contains URLs).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeImageMap(PrintWriter writer, String name, 
        ChartRenderingInfo info, 
        ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
        URLTagFragmentGenerator urlTagFragmentGenerator) 
        throws IOException {

    writer.println(ImageMapUtilities.getImageMap(name, info, 
            toolTipTagFragmentGenerator, urlTagFragmentGenerator));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:ChartUtilities.java

示例5: getImageMap

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Creates an HTML image map.  This method maps directly to
 * {@link ImageMapUtilities#getImageMap(String, ChartRenderingInfo, 
 * ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}.
 *
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragment
 *     that will contain the tooltip text (<code>null</code> not permitted 
 *     if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment that
 *     will contain the URL reference (<code>null</code> not permitted if 
 *     <code>info</code> contains URLs).
 *
 * @return The map tag.
 */
public static String getImageMap(String name, ChartRenderingInfo info,
        ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
        URLTagFragmentGenerator urlTagFragmentGenerator) {

    return ImageMapUtilities.getImageMap(name, info, 
            toolTipTagFragmentGenerator, urlTagFragmentGenerator);
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:ChartUtilities.java

示例6: writeImageMap

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Writes an image map to the specified writer.
 *
 * @param writer  the writer (<code>null</code> not permitted).
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragment
 *     that will contain the tooltip text (<code>null</code> not permitted
 *     if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment that
 *     will contain the URL reference (<code>null</code> not permitted if
 *     <code>info</code> contains URLs).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeImageMap(PrintWriter writer, String name,
        ChartRenderingInfo info,
        ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
        URLTagFragmentGenerator urlTagFragmentGenerator)
        throws IOException {

    writer.println(ImageMapUtilities.getImageMap(name, info,
            toolTipTagFragmentGenerator, urlTagFragmentGenerator));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:ChartUtilities.java

示例7: getImageMap

import org.jfree.chart.imagemap.ImageMapUtilities; //导入依赖的package包/类
/**
 * Creates an HTML image map.  This method maps directly to
 * {@link ImageMapUtilities#getImageMap(String, ChartRenderingInfo,
 * ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}.
 *
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragment
 *     that will contain the tooltip text (<code>null</code> not permitted
 *     if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment that
 *     will contain the URL reference (<code>null</code> not permitted if
 *     <code>info</code> contains URLs).
 *
 * @return The map tag.
 */
public static String getImageMap(String name, ChartRenderingInfo info,
        ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
        URLTagFragmentGenerator urlTagFragmentGenerator) {

    return ImageMapUtilities.getImageMap(name, info,
            toolTipTagFragmentGenerator, urlTagFragmentGenerator);

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:ChartUtilities.java


注:本文中的org.jfree.chart.imagemap.ImageMapUtilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。