Examples of CropBounds


Examples of com.lightcrafts.model.CropBounds

        double angle = bad.getAngle();
        double dx = - Math.cos(angle) * (goodW - badW) / 2;
        double dy = - Math.sin(angle) * (goodW - badW) / 2;
        Point2D center = bad.getCenter();
        center.setLocation(center.getX() + dx, center.getY() + dy);
        CropBounds good = new CropBounds(
            center, goodW, bad.getHeight(), angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        double angle = bad.getAngle();
        double dx = Math.sin(angle) * (goodH - badH) / 2;
        double dy = - Math.cos(angle) * (goodH - badH) / 2;
        Point2D center = bad.getCenter();
        center.setLocation(center.getX() + dx, center.getY() + dy);
        CropBounds good = new CropBounds(
            center, bad.getWidth(), goodH, angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        double angle = bad.getAngle();
        double dx = Math.cos(angle) * (goodW - badW) / 2;
        double dy = Math.sin(angle) * (goodW - badW) / 2;
        Point2D center = bad.getCenter();
        center.setLocation(center.getX() + dx, center.getY() + dy);
        CropBounds good = new CropBounds(
            center, goodW, bad.getHeight(), angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        double angle = bad.getAngle();
        double dx = - Math.sin(angle) * (goodH - badH) / 2;
        double dy = Math.cos(angle) * (goodH - badH) / 2;
        Point2D center = bad.getCenter();
        center.setLocation(center.getX() + dx, center.getY() + dy);
        CropBounds good = new CropBounds(
            center, bad.getWidth(), goodH, angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        double ratio = getAspectRatio();
        Point2D center = bad.getCenter();
        double height = bad.getHeight();
        double width = height / ratio;
        double angle = bad.getAngle();
        CropBounds good = new CropBounds(
            center, width, height, angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        double ratio = getAspectRatio();
        Point2D center = bad.getCenter();
        double width = bad.getWidth();
        double height = width * ratio;
        double angle = bad.getAngle();
        CropBounds good = new CropBounds(
            center, width, height, angle
        );
        return good;
    }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

            JComponent.WHEN_IN_FOCUSED_WINDOW
        );
        overlay.registerKeyboardAction(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    CropBounds resetBounds = getResetCropBounds();
                    setCropWithConstraints(resetBounds);
                    doCrop();
                }
            },
            KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        }
        control.setResetValue(crop);
    }

    public CropBounds getResetCropBounds() {
        CropBounds crop = control.getResetValue();
        if (crop != null) {
            try {
                final AffineTransform inverse = xform.createInverse();
                crop = CropBounds.transform(inverse, crop);
            }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

    /**
     * Get the current crop, in image coordinates.
     */
    public CropBounds getCrop() {
        final CropBounds rect = overlay.getCrop();
        if (rect != null) {
            try {
                final AffineTransform inverse = xform.createInverse();
                return CropBounds.transform(inverse, rect);
            }
View Full Code Here

Examples of com.lightcrafts.model.CropBounds

        }
    }

    public void doCrop() {
        if (isIn()) {
            final CropBounds crop = getCrop();
            for (CropListener listener : listeners) {
                listener.cropCommitted(crop);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.