public void paint(Graphics g) {
        if (srcImage == null) return;

        Graphics2D g2 = (Graphics2D) g.create();
        ScalingInfo info = getScalingInfo();

        switch (scalingType) {
            case nearestNeighbor:
                scaleWithDrawImage(g2, info, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
                break;
            case bilinear:
                scaleWithDrawImage(g2, info, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                break;
            case bicubic:
                scaleWithDrawImage(g2, info, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                break;
            case areaAveraging:
                scaleWithGetScaledInstance(g2, info, Image.SCALE_AREA_AVERAGING);
                break;
            case replicate:
                scaleWithGetScaledInstance(g2, info, Image.SCALE_REPLICATE);
                break;
        }
    }