本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer.getGradientPaintTransformer方法的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer.getGradientPaintTransformer方法的具体用法?Java BarRenderer.getGradientPaintTransformer怎么用?Java BarRenderer.getGradientPaintTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BarRenderer
的用法示例。
在下文中一共展示了BarRenderer.getGradientPaintTransformer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintBar
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Paints a single bar instance.
*
* @param g2 the graphics target.
* @param renderer the renderer.
* @param row the row index.
* @param column the column index.
* @param bar the bar
* @param base indicates which side of the rectangle is the base of the bar.
*/
@Override
public void paintBar(Graphics2D g2, BarRenderer renderer, int row, int column, RectangularShape bar, RectangleEdge base) {
ShapeDummy dummy = new ShapeDummy();
Shape letter = null;
//set letter according to row
letter = dummy.convert(letter_matrix[row][column], bar);
Paint itemPaint = plot_colors.get(letter_matrix[row][column]);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, letter);
}
g2.setPaint(itemPaint);
g2.fill(letter);
// draw the outline...
if (renderer.isDrawBarOutline())
{
Stroke stroke = renderer.getItemOutlineStroke(row, column);
Paint paint = renderer.getItemOutlinePaint(row, column);
if (stroke != null && paint != null) {
g2.setStroke(stroke);
g2.setPaint(paint);
//g2.draw(bar);
g2.draw(letter);
}
}
}