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


Java MattePainter.setPaintStretched方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.painter.MattePainter.setPaintStretched方法的典型用法代码示例。如果您正苦于以下问题:Java MattePainter.setPaintStretched方法的具体用法?Java MattePainter.setPaintStretched怎么用?Java MattePainter.setPaintStretched使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.painter.MattePainter的用法示例。


在下文中一共展示了MattePainter.setPaintStretched方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRelativeGradientHighlighter

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
/**
 * @param right
 * @return
 */
private RelativePainterHighlighter createRelativeGradientHighlighter(
        HorizontalAlignment right, int column) {
    Color startColor = PaintUtils.setAlpha(Color.RED, 130);
    Color endColor = PaintUtils.setAlpha(Color.RED.brighter(), 0);
    boolean isRightAligned = HorizontalAlignment.RIGHT == right;
    GradientPaint paint = new GradientPaint(new Point2D.Double(0, 0),
            isRightAligned ? endColor : startColor, 
            new Point2D.Double(100, 0), 
            isRightAligned ? startColor : endColor);
    MattePainter painter = new MattePainter(paint);
    painter.setPaintStretched(true);
    RelativePainterHighlighter p = new RelativePainterHighlighter(painter);
    p.setHorizontalAlignment(right);
    p.setRelativizer(new NumberRelativizer(column, 100, 100));
    return p;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:HighlighterClientVisualCheck.java

示例2: createGradientPainter

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
/**
 * Creates and returns a Painter with a gradient paint starting with
 * startColor to WHITE.
 * 
 * @param startColor
 * @param percentage
 * @param transparent
 * @return
 */
protected Painter<?> createGradientPainter(Color startColor, float end,
        boolean transparent) {
    startColor = getTransparentColor(startColor, transparent ? 125 : 254);
    Color endColor = getTransparentColor(Color.WHITE, 0);
    GradientPaint paint = new GradientPaint(
                new Point2D.Double(0, 0),
                startColor,
               new Point2D.Double(1000, 0),
               endColor);

    MattePainter painter = new MattePainter(paint);
    painter.setPaintStretched(true);
    // not entirely successful - the relative stretching is on
    // top of a .5 stretched gradient in matte
    RelativePainter<?> wrapper = new RelativePainter<Object>(painter);
    wrapper.setXFactor(end);
    return wrapper;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:PainterVisualCheck.java

示例3: createRelativeGradientHighlighter

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
/**
 * @param right
 * @return
 */
private RelativePainterHighlighter createRelativeGradientHighlighter(
        HorizontalAlignment right, Number max) {
    Color startColor = PaintUtils.setAlpha(Color.RED, 130);
    Color endColor = PaintUtils.setAlpha(Color.RED.brighter(), 0);
    boolean isRightAligned = HorizontalAlignment.RIGHT == right;
    GradientPaint paint = new GradientPaint(new Point2D.Double(0, 0),
            isRightAligned ? endColor : startColor, 
            new Point2D.Double(100, 0), 
            isRightAligned ? startColor : endColor);
    MattePainter painter = new MattePainter(paint);
    painter.setPaintStretched(true);
    RelativePainterHighlighter p = new RelativePainterHighlighter(painter);
    p.setHorizontalAlignment(right);
    p.setRelativizer(new NumberRelativizer(max));
    return p;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:PainterVisualCheck.java

示例4: createBackgroundPainter

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
protected Painter createBackgroundPainter() {
    MattePainter p = new MattePainter(new GradientPaint(0, 0, gradientLightColor, 1, 0, gradientDarkColor));
    p.setPaintStretched(true);
    return new PainterUIResource(p);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:6,代码来源:BasicHeaderUI.java


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