當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityCollection.getEntityCount方法代碼示例

本文整理匯總了Java中org.jfree.chart.entity.EntityCollection.getEntityCount方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityCollection.getEntityCount方法的具體用法?Java EntityCollection.getEntityCount怎麽用?Java EntityCollection.getEntityCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.entity.EntityCollection的用法示例。


在下文中一共展示了EntityCollection.getEntityCount方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getEntitiesForPoint

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Returns a list of the entities at the given x, y view location.
 *
 * @param viewX the x location
 * @param viewY the y location
 * @return a list of the entities
 */
public ArrayList<ChartEntity> getEntitiesForPoint(int viewX, int viewY) {

    ArrayList<ChartEntity> entitiesForPoint = new ArrayList<ChartEntity>();
    ChartRenderingInfo info = chartPanel.getChartRenderingInfo();

    if (info != null) {
        Insets insets = chartPanel.getInsets();
        double x = (viewX - insets.left) / chartPanel.getScaleX();
        double y = (viewY - insets.top) / chartPanel.getScaleY();
        EntityCollection allEntities = info.getEntityCollection();
        int numEntities = allEntities.getEntityCount();

        for (int i = 0; i < numEntities; i++) {
            ChartEntity entity = allEntities.getEntity(i);
            if (entity.getArea().contains(x, y)) {
                entitiesForPoint.add(entity);
            }
        }
    }

    return entitiesForPoint;
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:30,代碼來源:VennDiagramPanel.java

示例2: getImageMap

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Creates an image map element that complies with the XHTML 1.0
 * specification.
 *
 * @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) {

    StringBuffer sb = new StringBuffer();
    sb.append("<map id=\"" + name + "\" name=\"" + name + "\">");
    sb.append(StringUtils.getLineSeparator());
    EntityCollection entities = info.getEntityCollection();
    if (entities != null) {
        int count = entities.getEntityCount();
        for (int i = count - 1; i >= 0; i--) {
            ChartEntity entity = entities.getEntity(i);
            if (entity.getToolTipText() != null 
                    || entity.getURLText() != null) {
                String area = entity.getImageMapAreaTag(
                        toolTipTagFragmentGenerator, 
                        urlTagFragmentGenerator);
                if (area.length() > 0) {
                    sb.append(area);
                    sb.append(StringUtils.getLineSeparator());
                }
            }
        }
    }
    sb.append("</map>");
    return sb.toString();
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:44,代碼來源:ImageMapUtilities.java

示例3: getImageMap

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Creates an image map element that complies with the XHTML 1.0
 * specification.
 *
 * @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) {

    StringBuilder sb = new StringBuilder();
    sb.append("<map id=\"").append(htmlEscape(name));
    sb.append("\" name=\"").append(htmlEscape(name)).append("\">");
    sb.append(StringUtils.getLineSeparator());
    EntityCollection entities = info.getEntityCollection();
    if (entities != null) {
        int count = entities.getEntityCount();
        for (int i = count - 1; i >= 0; i--) {
            ChartEntity entity = entities.getEntity(i);
            if (entity.getToolTipText() != null
                    || entity.getURLText() != null) {
                String area = entity.getImageMapAreaTag(
                        toolTipTagFragmentGenerator,
                        urlTagFragmentGenerator);
                if (area.length() > 0) {
                    sb.append(area);
                    sb.append(StringUtils.getLineSeparator());
                }
            }
        }
    }
    sb.append("</map>");
    return sb.toString();

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:45,代碼來源:ImageMapUtilities.java

示例4: getImageMap

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Creates an image map element that complies with the XHTML 1.0
 * specification.
 *
 * @param name  the map name ({@code null} not permitted).
 * @param info  the chart rendering info ({@code null} not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragment
 *     that will contain the tooltip text ({@code null} not permitted
 *     if {@code info} contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment that
 *     will contain the URL reference ({@code null} not permitted if
 *     {@code info} contains URLs).
 *
 * @return The map tag.
 */
public static String getImageMap(String name, ChartRenderingInfo info,
        ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
        URLTagFragmentGenerator urlTagFragmentGenerator) {

    StringBuilder sb = new StringBuilder();
    sb.append("<map id=\"").append(htmlEscape(name));
    sb.append("\" name=\"").append(htmlEscape(name)).append("\">");
    sb.append(StringUtils.getLineSeparator());
    EntityCollection entities = info.getEntityCollection();
    if (entities != null) {
        int count = entities.getEntityCount();
        for (int i = count - 1; i >= 0; i--) {
            ChartEntity entity = entities.getEntity(i);
            if (entity.getToolTipText() != null
                    || entity.getURLText() != null) {
                String area = entity.getImageMapAreaTag(
                        toolTipTagFragmentGenerator,
                        urlTagFragmentGenerator);
                if (area.length() > 0) {
                    sb.append(area);
                    sb.append(StringUtils.getLineSeparator());
                }
            }
        }
    }
    sb.append("</map>");
    return sb.toString();

}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:45,代碼來源:ImageMapUtils.java

示例5: getImageMap

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Creates an image map element that complies with the XHTML 1.0
 * specification.
 *
 * @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) {

    StringBuffer sb = new StringBuffer();
    sb.append("<map id=\"" + htmlEscape(name) + "\" name=\""
            + htmlEscape(name) + "\">");
    sb.append(StringUtils.getLineSeparator());
    EntityCollection entities = info.getEntityCollection();
    if (entities != null) {
        int count = entities.getEntityCount();
        for (int i = count - 1; i >= 0; i--) {
            ChartEntity entity = entities.getEntity(i);
            if (entity.getToolTipText() != null
                    || entity.getURLText() != null) {
                String area = entity.getImageMapAreaTag(
                        toolTipTagFragmentGenerator,
                        urlTagFragmentGenerator);
                if (area.length() > 0) {
                    sb.append(area);
                    sb.append(StringUtils.getLineSeparator());
                }
            }
        }
    }
    sb.append("</map>");
    return sb.toString();

}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:45,代碼來源:ImageMapUtilities.java

示例6: getImageMap

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * Creates an image map element that complies with the XHTML 1.0
 * specification.
 *
 * @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) {

    StringBuffer sb = new StringBuffer();
    sb.append("<map id=\"" + htmlEscape(name) + "\" name=\""
            + htmlEscape(name) + "\">");
    sb.append(StringUtilities.getLineSeparator());
    EntityCollection entities = info.getEntityCollection();
    if (entities != null) {
        int count = entities.getEntityCount();
        for (int i = count - 1; i >= 0; i--) {
            ChartEntity entity = entities.getEntity(i);
            if (entity.getToolTipText() != null
                    || entity.getURLText() != null) {
                String area = entity.getImageMapAreaTag(
                        toolTipTagFragmentGenerator,
                        urlTagFragmentGenerator);
                if (area.length() > 0) {
                    sb.append(area);
                    sb.append(StringUtilities.getLineSeparator());
                }
            }
        }
    }
    sb.append("</map>");
    return sb.toString();

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:45,代碼來源:ImageMapUtilities.java

示例7: getImageAreaHyperlinks

import org.jfree.chart.entity.EntityCollection; //導入方法依賴的package包/類
/**
 * 
 */
public static List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(
	JFreeChart chart,
	ChartHyperlinkProvider chartHyperlinkProvider,
	Graphics2D grx,
	Rectangle2D renderingArea
	)// throws JRException
{
	List<JRPrintImageAreaHyperlink> areaHyperlinks = null;
	
	if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks())
	{
		ChartRenderingInfo renderingInfo = new ChartRenderingInfo();

		if (grx == null)
		{
			chart.createBufferedImage((int) renderingArea.getWidth(), (int)  renderingArea.getHeight(), renderingInfo);
		}
		else
		{
			chart.draw(grx, renderingArea, renderingInfo);
		}
		
		EntityCollection entityCollection = renderingInfo.getEntityCollection();
		if (entityCollection != null && entityCollection.getEntityCount() > 0)
		{
			areaHyperlinks = new ArrayList<JRPrintImageAreaHyperlink>(entityCollection.getEntityCount());
			
			for (@SuppressWarnings("unchecked")
			Iterator<ChartEntity> it = entityCollection.iterator(); it.hasNext();)
			{
				ChartEntity entity = it.next();
				JRPrintHyperlink printHyperlink = chartHyperlinkProvider.getEntityHyperlink(entity);
				if (printHyperlink != null)
				{
					JRPrintImageArea area = getImageArea(entity);

					JRPrintImageAreaHyperlink areaHyperlink = new JRPrintImageAreaHyperlink();
					areaHyperlink.setArea(area);
					areaHyperlink.setHyperlink(printHyperlink);
					areaHyperlinks.add(areaHyperlink);
				}
			}
		}
	}
	
	return areaHyperlinks;
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:51,代碼來源:ChartUtil.java


注:本文中的org.jfree.chart.entity.EntityCollection.getEntityCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。