Package com.bbn.openmap.proj

Examples of com.bbn.openmap.proj.Projection


     * starting point of a box (pt1), look at pt2 to see if it
     * represents the ratio of the projection map size. If it doesn't,
     * provide a point that does.
     */
    protected Point getRatioPoint(MapBean map, Point pt1, Point pt2) {
        Projection proj = overviewMapHandler.getSourceMap().getProjection();
        float mapRatio = (float) proj.getHeight() / (float) proj.getWidth();

        float boxHeight = (float) (pt1.y - pt2.y);
        float boxWidth = (float) (pt1.x - pt2.x);
        float boxRatio = Math.abs(boxHeight / boxWidth);
        int isNegative = -1;
View Full Code Here


        // Now we're going to shut off event processing. The only
        // thing that turns them on again is finishing successfully.
        setAcceptingEvents(false);

        Projection projection = getProjection();

        // get the graphics from the specialist
        UGraphic[] specGraphics = getSpecGraphics(projection);
        if (isCancelled()) {
            dirtybits |= PREMATURE_FINISH;
View Full Code Here

     */
    protected void updateGraphics(
                                  com.bbn.openmap.CSpecialist.UpdateRecord[] updateRec) {

        JGraphicList jGraphics = (JGraphicList) getList();
        Projection projection = getProjection();

        com.bbn.openmap.CSpecialist.UpdateGraphic upgraphic = null;
        // parse updateRec (an array of UpdateRecord)
        for (int i = 0; i < updateRec.length; i++) {
            String gID = updateRec[i].gID; // get the graphic ID
View Full Code Here

        // Setting the OMGraphicsList for this layer. Remember, the
        // OMGraphicList is made up of OMGraphics, which are generated
        // (projected) when the graphics are added to the list. So,
        // after this call, the list is ready for painting.

        Projection projection = getProjection();
        // call getRectangle();
        if (Debug.debugging("dtedcov")) {
            Debug.output(getName() + "|DTEDCoverageLayer.prepare(): "
                    + "calling prepare with projection: " + projection
                    + " ul = " + projection.getUpperLeft() + " lr = "
                    + projection.getLowerRight());
        }

        // IF the coverage manager has not been set up yet, do it!
        if (coverageManager == null) {
            coverageManager = new DTEDCoverageManager(paths, paths2, coverageURL, coverageFile);
View Full Code Here

     * ProjectionListener interface method. Should not be called directly.
     *
     * @param e ProjectionEvent
     */
    public void projectionChanged(ProjectionEvent e) {
        Projection newProj = e.getProjection();
        if (!projection.equals(newProj)) {
            setProjection(newProj);
        }
    }
View Full Code Here

     * location from a MouseEvent. Returns null if the event is null, or if the
     * projection is not set in the MapBean. Save on memory allocation by
     * sending in the LatLonPoint to fill.
     */
    public LatLonPoint getCoordinates(MouseEvent event, LatLonPoint llp) {
        Projection proj = getProjection();
        if (proj == null || event == null) {
            return null;
        }

        if (llp == null) {
            return proj.inverse(event.getX(), event.getY());
        } else {
            return proj.inverse(event.getX(), event.getY(), llp);
        }
    }
View Full Code Here

            Debug.message("dted",
                    getName()
                            + "|DTEDFrameCacheLayer can't add anything to map because the DTEDFrameCache has not been set.");
        }

        Projection projection = getProjection();

        if (projection == null) {
            Debug.output("DTED Layer needs to be added to the MapBean before it can draw images!");
            return new OMGraphicList();
        }

        // Check to make sure the projection is EqualArc
        if (!(projection instanceof EqualArc)) {
            if (!firstProjectionWarningSent) {
                fireRequestInfoLine("  DTED requires an Equal Arc projection (CADRG/LLXY) to view images.");
                Debug.output("DTEDFrameCacheLayer: DTED requires an Equal Arc projection (CADRG/LLXY) to view images.");
                firstProjectionWarningSent = true;
            }
            return new OMGraphicList();
        }

        Debug.message("basic", getName()
                + "|DTEDFrameCacheLayer.prepare(): doing it");

        // Setting the OMGraphicsList for this layer. Remember, the
        // OMGraphicList is made up of OMGraphics, which are generated
        // (projected) when the graphics are added to the list. So,
        // after this call, the list is ready for painting.

        // call getRectangle();
        if (Debug.debugging("dted")) {
            Debug.output(getName() + "|DTEDFrameCacheLayer.prepare(): "
                    + "calling getRectangle " + " with projection: "
                    + projection + " ul = " + projection.getUpperLeft()
                    + " lr = " + projection.getLowerRight());
        }

        OMGraphicList omGraphicList;

        if (projection.getScale() < maxScale) {
            omGraphicList = cache.getRectangle((EqualArc) projection);
        } else {
            fireRequestInfoLine("  The scale is too small for DTED viewing.");
            Debug.error("DTEDFrameCacheLayer: scale (1:" + projection.getScale()
                    + ") is smaller than minimum (1:" + maxScale + ") allowed.");
            omGraphicList = new OMGraphicList();
        }
        /////////////////////
        // safe quit
View Full Code Here

    public void projectionChanged(ProjectionEvent pEvent) {
        // Sourge projection not yet set
        if (sourceMapProjection == null)
            return;

        Projection proj = pEvent.getProjection();

        // Save the scale for use in the
        overviewScale = proj.getScale();

        boolean cylindrical = sourceMapProjection instanceof Cylindrical;

        if (poly == null) {
            poly = new OMPoly();
View Full Code Here

        MapBean map = (MapBean) mh.get("com.bbn.openmap.MapBean");
        if (map != null) {
            Debug.message("3d", "LayerMapContent: putting down sea.");
            Color seaColor = map.getBackground();

            Projection proj = map.getProjection();

            // Make the background strech a screen around the current
            // map, all directions.
            int width = proj.getWidth();
            int height = proj.getHeight();

            java.awt.geom.GeneralPath background =
            // OMGraphic.createBoxShape(0, 0, width, height);
            OMGraphic.createBoxShape(-width, -height, width * 3, height * 3);

 
View Full Code Here

     * while in the middle of this method. For a different projection, that
     * would be bad.
     */
    public synchronized OMGraphicList prepare() {
        OMGraphicList currentList = getList();
        Projection proj = getProjection();

        // if the layer hasn't been added to the MapBean
        // the projection could be null.
        if (currentList != null && proj != null) {
            currentList.generate(proj);
View Full Code Here

TOP

Related Classes of com.bbn.openmap.proj.Projection

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.