本文整理汇总了Java中org.jfree.chart.urls.XYURLGenerator.generateURL方法的典型用法代码示例。如果您正苦于以下问题:Java XYURLGenerator.generateURL方法的具体用法?Java XYURLGenerator.generateURL怎么用?Java XYURLGenerator.generateURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.urls.XYURLGenerator
的用法示例。
在下文中一共展示了XYURLGenerator.generateURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEntity
import org.jfree.chart.urls.XYURLGenerator; //导入方法依赖的package包/类
/**
* Adds an entity to the collection.
*
* @param entities the entity collection being populated.
* @param area the entity area (if <code>null</code> a default will be
* used).
* @param dataset the dataset.
* @param series the series.
* @param item the item.
* @param selected is the item selected?
* @param entityX the entity's center x-coordinate in user space (only
* used if <code>area</code> is <code>null</code>).
* @param entityY the entity's center y-coordinate in user space (only
* used if <code>area</code> is <code>null</code>).
*
* @since 1.2.0
*/
protected void addEntity(EntityCollection entities, Shape area,
XYDataset dataset, int series, int item, boolean selected,
double entityX, double entityY) {
if (!getItemCreateEntity(series, item, selected)) {
return;
}
Shape hotspot = area;
if (hotspot == null) {
double r = getDefaultEntityRadius();
double w = r * 2;
if (getPlot().getOrientation() == PlotOrientation.VERTICAL) {
hotspot = new Ellipse2D.Double(entityX - r, entityY - r, w, w);
}
else {
hotspot = new Ellipse2D.Double(entityY - r, entityX - r, w, w);
}
}
String tip = null;
XYToolTipGenerator generator = getToolTipGenerator(series, item,
selected);
if (generator != null) {
tip = generator.generateToolTip(dataset, series, item);
}
String url = null;
XYURLGenerator urlster = getURLGenerator(series, item, selected);
if (urlster != null) {
url = urlster.generateURL(dataset, series, item);
}
XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item,
tip, url);
entities.add(entity);
}