Package jsky.coords

Examples of jsky.coords.CoordinateConverter


     */
    public CanvasFigure makeLabeledRectangle(Rectangle2D.Double rect, int coordType, Paint fill,
                                             Paint outline, float lineWidth,
                                             String label, int anchor, Paint labelColor, Font font,
                                             Interactor interactor) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(rect.x, rect.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(rect.width, rect.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);
        Rectangle2D.Double r = new Rectangle2D.Double(p.x, p.y, size.x, size.y);
        return makeLabeledFigure(r, fill, outline, lineWidth, label, anchor, labelColor, font, interactor);
    }
View Full Code Here


     * @param interactor the interactor for the figure (SelctionInteractor, DragInteractor, etc.)
     * @return the new figure
     */
    public CanvasFigure makeRectangle(Rectangle2D.Double rect, int coordType, Paint fill,
                                      Paint outline, float lineWidth, Interactor interactor) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(rect.x, rect.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(rect.width, rect.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);
        Rectangle2D.Double r = new Rectangle2D.Double(p.x, p.y, size.x, size.y);
        return makeFigure(r, fill, outline, lineWidth, interactor);
    }
View Full Code Here

     * @param lineWidth the line width
     * @return the new figure
     */
    public RotatableCanvasFigure makeRoiRectangle(Rectangle2D.Double rect, int coordType, Paint fill,
                                         Paint outline, float lineWidth) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(rect.x, rect.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(rect.width, rect.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);

        Rectangle2D.Double r = new Rectangle2D.Double(p.x, p.y, size.x, size.y);
        return new RoiRectangle(r, fill, outline, lineWidth, _roiSelectionInteractor);
    }
View Full Code Here

     * @param lineWidth the line width
     * @return the new figure
     */
    public RotatableCanvasFigure makeRoiEllipse(Ellipse2D.Double ellipse, int coordType, Paint fill,
                                       Paint outline, float lineWidth) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(ellipse.x, ellipse.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(ellipse.width, ellipse.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);

        Ellipse2D.Double e = new Ellipse2D.Double(p.x, p.y, size.x, size.y);
        return new RoiEllipse(e, fill, outline, lineWidth, _roiSelectionInteractor);
    }
View Full Code Here

     */
    public CanvasFigure makeLabeledEllipse(Ellipse2D.Double ellipse, int coordType, Paint fill,
                                           Paint outline, float lineWidth,
                                           String label, int anchor, Paint labelColor, Font font,
                                           Interactor interactor) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(ellipse.x, ellipse.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(ellipse.width, ellipse.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);
        Ellipse2D.Double r = new Ellipse2D.Double(p.x, p.y, size.x, size.y);
        return makeLabeledFigure(r, fill, outline, lineWidth, label, anchor, labelColor, font, interactor);
    }
View Full Code Here

     * @param interactor the interactor for the figure (SelctionInteractor, DragInteractor, etc.)
     * @return the new figure
     */
    public RotatableCanvasFigure makeEllipse(Ellipse2D.Double ellipse, int coordType, Paint fill,
                                    Paint outline, float lineWidth, Interactor interactor) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(ellipse.x, ellipse.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        Point2D.Double size = new Point2D.Double(ellipse.width, ellipse.height);
        coordinateConverter.convertCoords(size, coordType, CoordinateConverter.SCREEN, true);
        Ellipse2D.Double r = new Ellipse2D.Double(p.x, p.y, size.x, size.y);
        return makeFigure(r, fill, outline, lineWidth, interactor);
    }
View Full Code Here

     * @param interactor determines the behavior of the figure (may be null)
     * @return the new figure
     */
    public CanvasFigure makeLabel(Point2D.Double pos, int coordType, String text, Paint color,
                                  Font font, Interactor interactor) {
        CoordinateConverter coordinateConverter = _imageDisplay.getCoordinateConverter();
        Point2D.Double p = new Point2D.Double(pos.x, pos.y);
        coordinateConverter.convertCoords(p, coordType, CoordinateConverter.SCREEN, false);
        return new ImageLabel(text, p, color, font, interactor);
    }
View Full Code Here

            // of the image), we still want to return the X,Y values of the area clicked.
            center = new Point2D.Double(x + w / 2.0, y + h / 2.0);
        }

        // get the center position in image coordinates
        CoordinateConverter cc = _imageDisplay.getCoordinateConverter();
        cc.userToImageCoords(center, false);
        _imageX = center.x;
        _imageY = center.y;

        // get the center position in world coordinates
        cc.imageToWorldCoords(center, false);
        _centerPos = new WorldCoords(center, cc.getEquinox());
    }
View Full Code Here

TOP

Related Classes of jsky.coords.CoordinateConverter

Copyright © 2018 www.massapicom. 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.