Examples of CoordinateConverter


Examples of jsky.coords.CoordinateConverter

     * @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

Examples of jsky.coords.CoordinateConverter

     * @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

Examples of jsky.coords.CoordinateConverter

            // 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
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.