class G2DTargetImpl extends AbstractRenderTarget implements G2DTarget {

        private final PreviewModel previewModel;
        private G2DGraphics graphics;

        public G2DTargetImpl(PreviewModel model, int width, int height) {
            graphics = new G2DGraphics(width, height);
            previewModel = model;
        }

        @Override
        public void resize(int width, int height) {<FILL_FUNCTION_BODY>}

        @Override
        public Graphics2D getGraphics() {
            return graphics.getGraphics();
        }

        @Override
        public Image getImage() {
            return graphics.getImage();
        }

        @Override
        public int getWidth() {
            return graphics.getWidth();
        }

        @Override
        public int getHeight() {
            return graphics.getHeight();
        }

        @Override
        public Vector getTranslate() {
            return graphics.getTranslate();
        }

        @Override
        public float getScaling() {
            return graphics.getScaling();
        }

        @Override
        public void setScaling(float scaling) {
            graphics.setScaling(scaling);
        }

        @Override
        public void setMoving(boolean moving) {
            previewModel.getProperties().putValue(PreviewProperty.MOVING, moving);
        }

        @Override
        public void reset() {
            graphics.reset();
        }

        @Override
        public synchronized void refresh() {
            if (graphics != null) {
                graphics.refresh(previewModel, this);
            }
        }
    }

            width = Math.max(1, width);
            height = Math.max(1, height);
            graphics.getGraphics().dispose();
            graphics = new G2DGraphics(width, height);
        
<no_super_class>