本文整理汇总了Java中org.jfree.ui.GradientPaintTransformer类的典型用法代码示例。如果您正苦于以下问题:Java GradientPaintTransformer类的具体用法?Java GradientPaintTransformer怎么用?Java GradientPaintTransformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GradientPaintTransformer类属于org.jfree.ui包,在下文中一共展示了GradientPaintTransformer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clone
import org.jfree.ui.GradientPaintTransformer; //导入依赖的package包/类
/**
* Returns a clone of the renderer.
*
* @return A clone.
*
* @throws CloneNotSupportedException if the renderer cannot be cloned.
*/
public Object clone() throws CloneNotSupportedException {
XYBarRenderer result = (XYBarRenderer) super.clone();
if (this.gradientPaintTransformer != null) {
if (this.gradientPaintTransformer instanceof PublicCloneable) {
PublicCloneable pc = (PublicCloneable) this.gradientPaintTransformer;
result.gradientPaintTransformer = (GradientPaintTransformer) pc.clone();
}
else {
throw new CloneNotSupportedException(
"GradientPaintTransformer doesn't implement PublicCloneable"
);
}
}
return result;
}
示例2: paintBar
import org.jfree.ui.GradientPaintTransformer; //导入依赖的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, XYBarRenderer renderer, int row,
int column, RectangularShape bar, RectangleEdge base) {
Paint itemPaint = renderer.getItemPaint(row, column);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, bar);
}
g2.setPaint(itemPaint);
g2.fill(bar);
// draw the outline...
if (renderer.isDrawBarOutline()) {
// && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
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);
}
}
}
示例3: paintBar
import org.jfree.ui.GradientPaintTransformer; //导入依赖的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) {
Paint itemPaint = renderer.getItemPaint(row, column);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, bar);
}
g2.setPaint(itemPaint);
g2.fill(bar);
// draw the outline...
if (renderer.isDrawBarOutline()) {
// && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
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);
}
}
}
示例4: paintBar
import org.jfree.ui.GradientPaintTransformer; //导入依赖的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.
*/
public void paintBar(Graphics2D g2, XYBarRenderer renderer, int row,
int column, RectangularShape bar, RectangleEdge base) {
Paint itemPaint = renderer.getItemPaint(row, column);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, bar);
}
g2.setPaint(itemPaint);
g2.fill(bar);
// draw the outline...
if (renderer.isDrawBarOutline()) {
// && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
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);
}
}
}
示例5: paintBar
import org.jfree.ui.GradientPaintTransformer; //导入依赖的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.
*/
public void paintBar(Graphics2D g2, BarRenderer renderer, int row,
int column, RectangularShape bar, RectangleEdge base) {
Paint itemPaint = renderer.getItemPaint(row, column);
GradientPaintTransformer t = renderer.getGradientPaintTransformer();
if (t != null && itemPaint instanceof GradientPaint) {
itemPaint = t.transform((GradientPaint) itemPaint, bar);
}
g2.setPaint(itemPaint);
g2.fill(bar);
// draw the outline...
if (renderer.isDrawBarOutline()) {
// && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
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);
}
}
}
示例6: clone
import org.jfree.ui.GradientPaintTransformer; //导入依赖的package包/类
/**
* Returns a clone of the renderer.
*
* @return A clone.
*
* @throws CloneNotSupportedException if the renderer cannot be cloned.
*/
public Object clone() throws CloneNotSupportedException {
XYBarRenderer result = (XYBarRenderer) super.clone();
if (this.gradientPaintTransformer != null) {
result.gradientPaintTransformer = (GradientPaintTransformer)
ObjectUtilities.clone(this.gradientPaintTransformer);
}
result.legendBar = ShapeUtilities.clone(this.legendBar);
return result;
}
示例7: testEquals
import org.jfree.ui.GradientPaintTransformer; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
@Test
public void testEquals() {
IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
assertTrue(m1.equals(m2));
assertTrue(m2.equals(m1));
m1 = new IntervalMarker(44.0, 50.0);
assertFalse(m1.equals(m2));
m2 = new IntervalMarker(44.0, 50.0);
assertTrue(m1.equals(m2));
m1 = new IntervalMarker(44.0, 55.0);
assertFalse(m1.equals(m2));
m2 = new IntervalMarker(44.0, 55.0);
assertTrue(m1.equals(m2));
GradientPaintTransformer t = new StandardGradientPaintTransformer(
GradientPaintTransformType.HORIZONTAL);
m1.setGradientPaintTransformer(t);
assertFalse(m1.equals(m2));
m2.setGradientPaintTransformer(t);
assertTrue(m1.equals(m2));
}
示例8: clone
import org.jfree.ui.GradientPaintTransformer; //导入依赖的package包/类
/**
* Returns a clone of the renderer.
*
* @return A clone.
*
* @throws CloneNotSupportedException if the renderer cannot be cloned.
*/
@Override
public Object clone() throws CloneNotSupportedException {
XYBarRenderer result = (XYBarRenderer) super.clone();
if (this.gradientPaintTransformer != null) {
result.gradientPaintTransformer = (GradientPaintTransformer)
ObjectUtilities.clone(this.gradientPaintTransformer);
}
result.legendBar = ShapeUtilities.clone(this.legendBar);
return result;
}
示例9: paintBar
import org.jfree.ui.GradientPaintTransformer; //导入依赖的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);
}
}
}