@Override
    public void paint(final Graphics2D g) {
        final AffineTransform oldTransform = g.getTransform();

        g.translate(getComponent().getX(), getComponent().getY());

        g.setPaint(getComponent().getFgColor());
        g.setStroke(getComponent().getFgStroke());
        g.draw(getComponent().getShape());

        g.setPaint(getComponent().getBgColor());
        g.setStroke(getComponent().getBgStroke());
        g.fill(getComponent().getShape());

        g.setTransform(oldTransform);

        if (this.component instanceof BPImage) {
            final BPImage img = (BPImage) this.component;
            if (this.component instanceof TaskComponent) {
                if (img.getImage() != null) {
                    g.translate(
                            getComponent().getX() + getComponent().getWidth() - img.getImageWidth()
                            - img.getImageMargins(), getComponent().getY() + img.getImageMargins());

                    g.drawImage(img.getImage(), 0, 0, img.getImageWidth(), img.getImageHeight(), null);

                    g.setTransform(oldTransform);
                }
            } else if (this.component instanceof EventComponent || this.component instanceof ActivityEventComponent) {
                if (img.getImage() != null) {

                    g.translate(getComponent().getX() + getComponent().getWidth() / 2 - img.getImageWidth() / 2,
                            getComponent().getY() + getComponent().getHeight() / 2 - img.getImageHeight() / 2);

                    g.drawImage(img.getImage(), 0, 0, img.getImageWidth(), img.getImageHeight(), null);

                    g.setTransform(oldTransform);
                }
            }
        }
    }