@Override
    public void setup() {
        Graphics2D graphics = null;

        if (imageRef != null) {
            BufferedImage bi = (BufferedImage) imageRef.get();
            if (bi != null) {
                graphics = bi.createGraphics();
            }
        } else {
            graphics = g;
        }


        if (graphics != null) {
            setupRendering(graphics);
        }
    }