本文整理汇总了Java中org.jfree.chart.labels.CategoryToolTipGenerator类的典型用法代码示例。如果您正苦于以下问题:Java CategoryToolTipGenerator类的具体用法?Java CategoryToolTipGenerator怎么用?Java CategoryToolTipGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CategoryToolTipGenerator类属于org.jfree.chart.labels包,在下文中一共展示了CategoryToolTipGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addItemEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity with the specified hotspot.
*
* @param entities the entity collection.
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
* @param hotspot the hotspot.
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column,
Shape hotspot) {
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, row, dataset.getColumnKey(column), column);
entities.add(entity);
}
示例2: getToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Returns the tool tip generator that should be used for the specified
* item. This method looks up the generator using the "three-layer"
* approach outlined in the general description of this interface. You
* can override this method if you want to return a different generator per
* item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The generator (possibly <code>null</code>).
*/
@Override
public CategoryToolTipGenerator getToolTipGenerator(int row, int column) {
CategoryToolTipGenerator result;
if (this.toolTipGenerator != null) {
result = this.toolTipGenerator;
}
else {
result = getSeriesToolTipGenerator(row);
if (result == null) {
result = this.baseToolTipGenerator;
}
}
return result;
}
示例3: addItemEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity with the specified hotspot.
*
* @param entities the entity collection.
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
* @param hotspot the hotspot (<code>null</code> not permitted).
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column, Shape hotspot) {
ParamChecks.nullNotPermitted(hotspot, "hotspot");
if (!getItemCreateEntity(row, column)) {
return;
}
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}
示例4: addItemEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity with the specified hotspot.
*
* @param entities the entity collection.
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
* @param hotspot the hotspot ({@code null} not permitted).
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column, Shape hotspot) {
Args.nullNotPermitted(hotspot, "hotspot");
if (!getItemCreateEntity(row, column)) {
return;
}
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}
示例5: addItemEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity with the specified hotspot.
*
* @param entities the entity collection.
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
* @param hotspot the hotspot.
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column,
Shape hotspot) {
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}
示例6: addItemEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity with the specified hotspot.
*
* @param entities the entity collection.
* @param dataset the dataset.
* @param row the row index.
* @param column the column index.
* @param hotspot the hotspot (<code>null</code> not permitted).
*/
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset, int row, int column,
Shape hotspot) {
if (hotspot == null) {
throw new IllegalArgumentException("Null 'hotspot' argument.");
}
if (!getItemCreateEntity(row, column)) {
return;
}
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}
示例7: getToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Returns the tool tip generator that should be used for the specified item. This
* method looks up the generator using the "three-layer" approach outlined in the
* general description of this interface. You can override this method if you want
* to return a different generator per item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The generator (possibly <code>null</code>).
*/
public CategoryToolTipGenerator getToolTipGenerator(int row, int column) {
CategoryToolTipGenerator result = null;
if (this.toolTipGenerator != null) {
result = this.toolTipGenerator;
}
else {
result = getSeriesToolTipGenerator(row);
if (result == null) {
result = this.baseToolTipGenerator;
}
}
return result;
}
示例8: testSetSeriesToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that setting a tool tip generator for a series does override the
* default generator.
*/
public void testSetSeriesToolTipGenerator() {
CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
StandardCategoryToolTipGenerator tt
= new StandardCategoryToolTipGenerator();
renderer.setSeriesToolTipGenerator(0, tt);
CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
assertTrue(tt2 == tt);
}
示例9: testSetSeriesToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that setting a tool tip generator for a series does override the
* default generator.
*/
public void testSetSeriesToolTipGenerator() {
CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
StandardCategoryToolTipGenerator tt
= new StandardCategoryToolTipGenerator();
renderer.setSeriesToolTipGenerator(0, tt);
CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
assertTrue(tt2 == tt);
}
示例10: getToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Returns the tool tip generator that should be used for the specified
* item. This method looks up the generator using the "three-layer"
* approach outlined in the general description of this interface. You
* can override this method if you want to return a different generator per
* item.
*
* @param row the row index (zero-based).
* @param column the column index (zero-based).
*
* @return The generator (possibly <code>null</code>).
*/
public CategoryToolTipGenerator getToolTipGenerator(int row, int column) {
CategoryToolTipGenerator result = null;
if (this.toolTipGenerator != null) {
result = this.toolTipGenerator;
}
else {
result = getSeriesToolTipGenerator(row);
if (result == null) {
result = this.baseToolTipGenerator;
}
}
return result;
}
示例11: testSetSeriesToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that setting a tool tip generator for a series does override the
* default generator.
*/
@Test
public void testSetSeriesToolTipGenerator() {
CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
StandardCategoryToolTipGenerator tt
= new StandardCategoryToolTipGenerator();
renderer.setSeriesToolTipGenerator(0, tt);
CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
assertSame(tt2, tt);
}
示例12: testSetSeriesToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that setting a tool tip generator for a series does override the
* default generator.
*/
@Test
public void testSetSeriesToolTipGenerator() {
CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
StandardCategoryToolTipGenerator tt
= new StandardCategoryToolTipGenerator();
renderer.setSeriesToolTipGenerator(0, tt);
CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
assertTrue(tt2 == tt);
}
示例13: testSetSeriesToolTipGenerator
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that setting a tool tip generator for a series does override the
* default generator.
*/
@Test
public void testSetSeriesToolTipGenerator() {
CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
StandardCategoryToolTipGenerator tt
= new StandardCategoryToolTipGenerator();
renderer.setSeriesToolTipGenerator(0, tt);
CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
assertTrue(tt2 == tt);
}
示例14: AbstractCategoryItemRenderer
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Creates a new renderer with no tool tip generator and no URL generator.
* The defaults (no tool tip or URL generators) have been chosen to
* minimise the processing required to generate a default chart. If you
* require tool tips or URLs, then you can easily add the required
* generators.
*/
protected AbstractCategoryItemRenderer() {
this.itemLabelGenerator = null;
this.itemLabelGeneratorMap
= new HashMap<Integer, CategoryItemLabelGenerator>();
this.toolTipGenerator = null;
this.toolTipGeneratorMap
= new HashMap<Integer, CategoryToolTipGenerator>();
this.itemURLGenerator = null;
this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
this.legendItemLabelGenerator
= new StandardCategorySeriesLabelGenerator();
}
示例15: addEntity
import org.jfree.chart.labels.CategoryToolTipGenerator; //导入依赖的package包/类
/**
* Adds an entity to the collection.
*
* @param entities the entity collection being populated.
* @param hotspot the entity area (if <code>null</code> a default will be
* used).
* @param dataset the dataset.
* @param row the series.
* @param column the item.
* @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.0.13
*/
protected void addEntity(EntityCollection entities, Shape hotspot,
CategoryDataset dataset, int row, int column,
double entityX, double entityY) {
if (!getItemCreateEntity(row, column)) {
return;
}
Shape s = hotspot;
if (hotspot == null) {
double r = getDefaultEntityRadius();
double w = r * 2;
if (getPlot().getOrientation() == PlotOrientation.VERTICAL) {
s = new Ellipse2D.Double(entityX - r, entityY - r, w, w);
}
else {
s = new Ellipse2D.Double(entityY - r, entityX - r, w, w);
}
}
String tip = null;
CategoryToolTipGenerator generator = getToolTipGenerator(row, column);
if (generator != null) {
tip = generator.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(s, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}