Package java.awt

Examples of java.awt.Point


        case RENDERTYPE_OFFSET:
            if (!proj.isPlotable(latlons[0], latlons[1])) {
                setNeedToRegenerate(true);// HMMM not the best flag
                return false;
            }
            Point p1 = proj.forward(latlons[0], latlons[1]);
            if (arc != null) {
                xpoints = new int[1][];
                ypoints = new int[1][];
                arc.generate(p1.x + pts[0], p1.y + pts[1], p1.x + pts[2], p1.y
                        + pts[3]);

                xpoints[0] = arc.getXPoints();
                ypoints[0] = arc.getYPoints();
            } else {
                xpoints = new int[1][2];
                ypoints = new int[1][2];

                xpoints[0][0] = p1.x + pts[0];
                ypoints[0][0] = p1.y + pts[1];
                xpoints[0][1] = p1.x + pts[2];
                ypoints[0][1] = p1.y + pts[3];
            }
            shape = createShape(xpoints[0], ypoints[0], false);
            break;
        case RENDERTYPE_LATLON:
            if (arc != null) {
                p1 = proj.forward(latlons[0], latlons[1]);
                Point p2 = proj.forward(latlons[2], latlons[3]);
                xpoints = new int[1][];
                ypoints = new int[1][];
                arc.generate(p1.x, p1.y, p2.x, p2.y);

                xpoints[0] = arc.getXPoints();
View Full Code Here


     * @return LatLonPoint ret_val
     * 
     */
    public LatLonPoint inverse(Point pt, LatLonPoint ret_val) {
        //Debug.output("CADRG.inverse");
        Point pixpoint = new Point(0, 0);

        /* offset back into pixel space from Drawable space */
        pixpoint.x = pt.x + ul.x/* - ox */;
        pixpoint.y = -pt.y + ul.y + oy;

View Full Code Here

     * @see Proj#inverse(Point)
    
     */
    public LatLonPoint inverse(int x, int y, LatLonPoint ret_val) {
        //Debug.output("CADRG.inverse");
        Point pixpoint = new Point(0, 0);

        /* offset back into pixel space from Drawable space */
        pixpoint.x = x + ul.x/* - ox */;
        pixpoint.y = -y + ul.y + oy;

View Full Code Here

     */
    protected void computeParameters() {
        int w, h;

        if (ul == null)
            ul = new Point(0, 0); //HACK

        // quick calculate the maxscale
        maxscale = CADRG_calc_maxscale();
        if (scale > maxscale)
            scale = maxscale;

        // Compute the "ADRG" scale, which gets used below.
        double adrgscale = 1000000.0 / scale; // 1 million (from ADRG
                                              // spec)
        if (adrgscale > CADRG_SCALE_LIMIT) {
            Debug.message("proj", "CADRG: adrgscale > CADRG_SCALE_LIMIT");
            adrgscale = CADRG_SCALE_LIMIT;
        }

        // Compute the y pixel constant based on scale.
        y_pix_constant = CADRG_y_pix_constant(adrgscale);
        if (Debug.debugging("proj")) {
            Debug.output("Y pix constant = " + y_pix_constant);
        }
        // What zone are we in?
        zone = getZone(ProjMath.radToDeg(ctrLat), y_pix_constant);
        if (Debug.debugging("proj")) {
            Debug.output("Zone = " + zone);
        }

        // Compute the x pixel constant, based on scale and zone.
        x_pix_constant = CADRG_x_pix_constant(adrgscale, zone);
        if (Debug.debugging("proj")) {
            Debug.output("x_pix_constant = " + x_pix_constant);
        }
        // Now I can compute the world coordinate.
        if (world == null)
            world = new Point(0, 0);
        world.x = (int) ProjMath.roundAdjust(x_pix_constant);
        world.y = (int) ProjMath.roundAdjust(y_pix_constant * 4.0 / 2.0);
        Debug.message("proj", "world = " + world.x + "," + world.y);

        // Compute scaled pixels per RADIAN, not SCOORD
        spps_x = (double) x_pix_constant / MoreMath.TWO_PI/* MoreMath.DEG_TO_SC(360) */;
        spps_y = (double) y_pix_constant / MoreMath.HALF_PI/* MoreMath.DEG_TO_SC(90) */;
        Debug.message("proj", "spps = " + spps_x + "," + spps_y);

        // Fix the "small world" situation, computing ox, oy.
        if (width > world.x) {
            Debug.message("proj", "CADRG: fixing small world");
            w = world.x;
            //          ox = (int) ProjMath.roundAdjust((width - w) / 2.0);
        } else {
            w = width;
            //          ox = 0;
        }
        if (height > world.y) {
            h = (int) world.y;
            oy = (int) ProjMath.roundAdjust((height - h) / 2.0);
        } else {
            h = height;
            oy = 0;
        }

        // compute the "upper left" adjustment.
        long temp = (long) ProjMath.roundAdjust(spps_y * ctrLat);
        if (Debug.debugging("proj")) {
            Debug.output("CADRG.temp = " + temp);
        }
        if (ul == null)
            ul = new Point(0, 0);
        ul.x = (int) ProjMath.roundAdjust(-w / 2.0);
        if ((temp != 0) && (oy != 0)) {
            ul.y = (int) ProjMath.roundAdjust(h / 2.0);
        } else {
            ul.y = (int) temp + (int) ProjMath.roundAdjust(h / 2.0);
View Full Code Here

                //                           lrhorIndex + ", " + lrverIndex);
                ///////////////////////////////////

                int clear = 0x00000000;

                Point ctp = new Point();
                LatLonPoint llp = new LatLonPoint();
                LatLonPoint center = p.getCenter();

                for (int i = 0; i < projWidth; i++) {
                    for (int j = 0; j < projHeight; j++) {
View Full Code Here

        gpo.clear();

        OMPoly poly = (OMPoly) graphic;
        boolean ntr = poly.getNeedToRegenerate();
        int renderType = poly.getRenderType();
        Point p = new Point();
        GrabPoint gb;
        int i;
        int npts;

        if (ntr == false) {
            if (renderType == OMGraphic.RENDERTYPE_LATLON) {
                Debug.message("eomg", "EditableOMPoly: modifying lat/lon line");

                if (projection != null) {

                    float[] ll = poly.getLatLonArray();

                    gb = null; // reset for this loop

                    for (i = 0; i < ll.length; i += 2) {
                        projection.forward(ll[i], ll[i + 1], p, true);
                        // Need to add a grab point for this
                        // coordinate
                        gb = new OffsetGrabPoint((int) p.getX(), (int) p.getY());
                        polyGrabPoints.add(gb);
                    }
                }

            } else if (renderType == OMGraphic.RENDERTYPE_OFFSET) {
                // Grab the projected endpoints
                Debug.message("eomg", "EditableOMPoly: modifying offset poly");

                int x;
                int y;
                npts = poly.xs.length;

                // Check to see if the poly is a offset poly, and set
                // the
                // offset grab point accordingly.
                if (projection != null) {
                    projection.forward(poly.lat, poly.lon, p, true);
                    gpo.set((int) p.getX(), (int) p.getY());

                    if (poly.coordMode == OMPoly.COORDMODE_ORIGIN) {
                        for (i = 0; i < npts; i++) {
                            x = poly.xs[i] + p.x;
                            y = poly.ys[i] + p.y;
View Full Code Here

        synchronized (helper) {
            super.computeParameters();

            // Screen stuff
            Point temp = new Point();

            helper.setAllParams(pixelsPerMeter,
                    planetRadius,
                    planetPixelRadius,
                    planetPixelCircumference,
View Full Code Here

        }

        // width of the world in pixels at current scale
        // TODO: copied from Cylindrical. may need to change
        if (world == null) {
            world = new Point();
        }
        world.x = (int) (planetPixelCircumference / scale);
        half_world = world.x / 2;

        ppu = (((float) pixelsPerMeter) / getScale());
View Full Code Here

        if (isComplicatedLineType(ltype)) {
            return doPolyDispatch(rawllpts, ltype, nsegs, isFilled);
        }

        // determine when to stop
        Point temp = new Point(0, 0);
        int[] xs = new int[len];
        int[] ys = new int[len];
       
        // more temp objects to limit number of new objects that needs to be created
        UTMPoint tempUtm = new UTMPoint();
View Full Code Here

    }

    public boolean forwardRaw(float[] rawllpts, int rawoff, int[] xcoords, int[] ycoords,
            boolean[] visible, int copyoff, int copylen) {
        // TODO: copied from Cylindrical. may need a change
        Point temp = new Point();
        UTMPoint tempUtm = new UTMPoint();
        LatLonPoint tempLL = new LatLonPoint();
        int end = copylen + copyoff;
        for (int i = copyoff, j = rawoff; i < end; i++, j += 2) {
            tempLL.setLatLon(rawllpts[j], rawllpts[j + 1], true);
View Full Code Here

TOP

Related Classes of java.awt.Point

Copyright © 2015 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.