Package com.bbn.openmap.CSpecialist

Examples of com.bbn.openmap.CSpecialist.Server


    protected UGraphic[] getSpecGraphics(Projection p) {
        CProjection cproj;
        LLPoint ll1, ll2;
        StringHolder dynamicArgsHolder;
        UGraphic[] graphics = null;
        Server spec = getSpecialist();
        if (Debug.debugging("cspec"))
            Debug.output(getName() + "|CSpecLayer.getSpecGraphics()");

        cproj = new CProjection((short) (p.getProjectionType()), new LLPoint(p.getCenter()
                .getLatitude(), p.getCenter().getLongitude()), (short) p.getHeight(), (short) p.getWidth(), (int) p.getScale());

        // lat-lon "box", (depends on the projection)
        LatLonPoint ul = p.getUpperLeft();
        LatLonPoint lr = p.getLowerRight();

        ll1 = new LLPoint(ul.getLatitude(), ul.getLongitude());
        ll2 = new LLPoint(lr.getLatitude(), lr.getLongitude());

        // check for cancellation
        if (isCancelled()) {
            dirtybits |= PREMATURE_FINISH;
            if (Debug.debugging("cspec"))
                Debug.output(getName()
                        + "|CSpecLayer.getSpecGraphics(): aborted.");
            return null;
        }
        // check for null specialist
        if (spec == null) {
            if (Debug.debugging("cspec")) {
                System.err.println(getName()
                        + "|CSpecLayer.getSpecGraphics(): null specialist!");
            }
            return null;
        }

        try {
            // Keep the gestures up-to-date
            mapGesture.setProjection(p);

            // Static Args can't go out null....
            String staticArguments = getStaticArgs();
            if (staticArguments == null) {
                staticArguments = "";
                setStaticArgs(staticArguments);
            }

            // neither can dynamic args
            // Layer.getArgs() was deprecated and removed
            dynamicArgsHolder = new StringHolder(getArgs());
            if (dynamicArgsHolder.value == null) {
                dynamicArgsHolder.value = "";
            }

            // call getRectangle();
            if (Debug.debugging("cspec")) {
                Debug.output(getName() + "|CSpecLayer.getSpecGraphics():"
                        + " calling getRectangle with projection: " + p
                        + " ul=" + ul + " lr=" + lr + " staticArgs=\""
                        + staticArguments + "\"" + " dynamicArgs=\""
                        + dynamicArgsHolder.value + "\"" + " notifyOnChange=\""
                        + notifyOnChange + "\"" + " clientID=" + clientID);
            }
            long start = System.currentTimeMillis();

            if (Debug.debugging("cspecdetail")) {
                Debug.output("*** Specialist Server: is a "
                        + spec.getClass().getName() + "\n" + spec);
            }

            graphics = spec.getRectangle(cproj,
                    ll1,
                    ll2,
                    staticArguments,
                    dynamicArgsHolder,
                    selectDist,
View Full Code Here


     */
    protected UGraphic[] getSpecGraphics(Projection p) {
        CProjection cproj;
        LLPoint ll1, ll2;
        StringHolder dynamicArgsHolder;
        Server spec = getSpecialist();
        if (Debug.debugging("cspec")) {
            System.out.println(getName()
                    + "|BufferedCSpecLayer.getSpecGraphics()");
        }

        // If we have graphics, return them
        if (graphics != null) {
            System.out.println("Returning cached graphics");
            return graphics;
        }

        cproj = new CProjection((short) (p.getProjectionType()), new LLPoint(p.getCenter()
                .getLatitude(), p.getCenter().getLongitude()), (short) p.getHeight(), (short) p.getWidth(), (int) p.getScale());

        // lat-lon "box", (depends on the projection)
        LatLonPoint ul = p.getUpperLeft();
        LatLonPoint lr = p.getLowerRight();

        //      ll1 = new LLPoint(ul.getLatitude(), ul.getLongitude());
        //      ll2 = new LLPoint(lr.getLatitude(), lr.getLongitude());
        // Adjust lat/lon for total global area
        ll1 = new LLPoint(90.0f, -180.0f);
        ll2 = new LLPoint(-90.0f, 180.0f);
        // check for cancellation
        if (isCancelled()) {
            dirtybits |= PREMATURE_FINISH;
            if (Debug.debugging("cspec"))
                System.out.println(getName()
                        + "|BufferedCSpecLayer.getSpecGraphics(): aborted.");
            return null;
        }
        // check for null specialist
        if (spec == null) {
            System.err.println(getName()
                    + "|BufferedCSpecLayer.getSpecGraphics(): null specialist!");
            return null;
        }
        try {
            // Keep the gestures up-to-date
            mapGesture.setProjection(p);

            // Static Args can't go out null....
            String staticArguments = getStaticArgs();
            if (staticArguments == null) {
                staticArguments = "";
                setStaticArgs(staticArguments);
            }

            // neither can dynamic args
            dynamicArgsHolder = new StringHolder(getArgs());
            if (dynamicArgsHolder.value == null) {
                dynamicArgsHolder.value = "";
            }

            // call getRectangle();
            if (Debug.debugging("cspec")) {
                System.out.println(getName()
                        + "|BufferedCSpecLayer.getSpecGraphics():"
                        + " calling getRectangle with projection: " + p
                        + " ul=" + ul + " lr=" + lr + " staticArgs=\""
                        + staticArguments + "\"" + " dynamicArgs=\""
                        + dynamicArgsHolder.value + "\"" + " clientID="
                        + clientID);
            }
            long start = System.currentTimeMillis();
            graphics = spec.getRectangle(cproj,
                    ll1,
                    ll2,
                    staticArguments,
                    dynamicArgsHolder,
                    selectDist,
View Full Code Here

TOP

Related Classes of com.bbn.openmap.CSpecialist.Server

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.