@Override
public void paint(Graphics g0) {
super.paint(g0); //may be necessary for some look-and-feels?
Graphics2D g = (Graphics2D)g0;
Color c = getForeground();
int w2 = Math.min(getWidth(), w);
int h2 = Math.min(getHeight(), w);
Rectangle r = new Rectangle(getWidth()/2-w2/2,getHeight()/2-h2/2, w2, h2);
if(c.getAlpha()<255) {
TexturePaint checkers = getCheckerPaint();
g.setPaint(checkers);
g.fillRect(r.x, r.y, r.width, r.height);
}
g.setColor(c);
g.fillRect(r.x, r.y, r.width, r.height);
PlafPaintUtils.drawBevel(g, r);
}
ColorSwatch.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:pumpernickel
作者:
评论列表
文章目录