public void paint(Component component,
                    Graphics g,
                    int x,
                    int y,
                    int width,
                    int height,
                    Direction direction,
                    boolean horizontalFlip,
                    boolean verticalFlip) {
    Color xc = null;
    g.setColor(color.getColor(component));

    if (xorColor != null) {
      xc = xorColor.getColor(component);

      if (xc != null)
        g.setXORMode(xc);
    }

    Insets i = InsetsUtil.rotate(direction, new Insets(verticalFlip ? insets.bottom : insets.top,
                                                                    horizontalFlip ? insets.right : insets.left,
                                                                                   verticalFlip ? insets.top : insets.bottom,
                                                                                                horizontalFlip ? insets.left : insets.right));

    g.fillRect(x + i.left, y, width - i.left - i.right, i.top);
    g.fillRect(x + i.left, y + height - i.bottom, width - i.left - i.right, i.bottom);
    g.fillRect(x, y, i.left, height);
    g.fillRect(x + width - i.right, y, i.right, height);

    if (xc != null)
      g.setPaintMode();
  }