本文整理匯總了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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}