for(int i = 0; i < tools.length; i++) {
AbstractTool[] column = tools[i];
int x = ICON_SEP + i * (ICON_SEP + ICON_WIDTH);
int y = ICON_SEP;
for(int j = 0; j < column.length; j++) {
AbstractTool tool = column[j];
if (tool == listener.toolPressed && listener.inTool) {
g.setColor(Color.darkGray);
g.fillRect(x, y, ICON_WIDTH, ICON_HEIGHT);
}
Icon icon = tool.getIcon();
if (icon != null) {
icon.paintIcon(this, g, x, y);
}
if (tool.equals(current)) {
GraphicsUtil.switchToWidth(g, 2);
g.setColor(Color.black);
g.drawRect(x - 1, y - 1, ICON_WIDTH + 2, ICON_HEIGHT + 2);
}
y += ICON_HEIGHT + ICON_SEP;