本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}