62,623
社区成员
发帖
与我相关
我的任务
分享class FinishedIcon
implements Icon
{
private int x_pos;
private int y_pos;
private int width;
private int height;
private Icon fileIcon;
private Image image;
private Rectangle rect;
public FinishedIcon(Icon fileIcon,Rectangle rect)
{
this.fileIcon = fileIcon;
image = BaseFlowIcons.IMAGE_FINISH;
width = fileIcon.getIconWidth();
height = fileIcon.getIconHeight();
rect=rect;
}
public void paintIcon(Component c, Graphics g, int x, int y)
{
this.x_pos = x;
this.y_pos = y;
int y_p = y + 2;
g.drawImage(image, width, height / 2, null);
if (fileIcon != null)
{
int w = (x - width) > 0 ? x - width : 0;
fileIcon.paintIcon(c, g, width + 10, y_p / 2);
}
}
public int getIconWidth()
{
return width + (fileIcon != null ? fileIcon.getIconWidth() : 0);
}
public int getIconHeight()
{
return height;
}
public Rectangle getBounds()
{
return new Rectangle(rect.x , rect.y , width, height);
}
}