当前位置: 首页>>代码示例>>Java>>正文


Java GradientPaintTransformer类代码示例

本文整理汇总了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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:XYBarRenderer.java

示例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);
        }
    }

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:37,代码来源:StandardXYBarPainter.java

示例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);
        }
    }

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:37,代码来源:StandardBarPainter.java

示例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);
        }
    }

}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:36,代码来源:StandardXYBarPainter.java

示例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);
        }
    }

}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:36,代码来源:StandardBarPainter.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:XYBarRenderer.java

示例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));

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:30,代码来源:IntervalMarkerTest.java

示例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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:18,代码来源:XYBarRenderer.java

示例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);
           }
       }
       
   }
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:42,代码来源:LogoBarPainter.java


注:本文中的org.jfree.ui.GradientPaintTransformer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。