Examples of OMRect


Examples of com.bbn.openmap.omGraphics.OMRect

                + (frame_height_ / 2), plot_color_, OMText.JUSTIFY_RIGHT);
        OMText year_axis_label = createLabel("Year", frame_x
                + (frame_width_ / 2), bottom + 15);

        // The background that the plot is drawn on.
        OMRect background = new OMRect(frame_x, frame_y, frame_x + frame_width_, frame_y
                + frame_height_);

        background.setFillPaint(graph_bg_color);
        background.setLinePaint(graph_bg_color);

        year_axis.setAppObject(this);
        temp_axis.setAppObject(this);

        plot_background_.addOMGraphic(background);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

                    + dist1
                    + "\n                    Distance to point 2 from arc focus = "
                    + dist2);

            // Let's hightlight the end points.
            OMRect point1 = new OMRect(x1 - 1, y1 - 1, x1 + 1, y1 + 1);
            OMRect point2 = new OMRect(x2 - 1, y2 - 1, x2 + 1, y2 + 1);
            OMRect arcPoint = new OMRect(arcCenter.x - 1, arcCenter.y - 1, arcCenter.x + 1, arcCenter.y + 1);

            point1.setLinePaint(OMColor.red);
            point2.setLinePaint(OMColor.red);
            arcPoint.setLinePaint(OMColor.blue);
            arcGraphics.add(point1);
            arcGraphics.add(point2);
            arcGraphics.add(arcPoint);

            OMLine line1 = new OMLine(x1, y1, x2, y2);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

            image = new OMScalingRaster(0f, 0f, 0f, 0f, PIXEL_EDGE_SIZE, PIXEL_EDGE_SIZE, (byte[]) null, (Color[]) null, opaqueness);
        }
        information = new OMText(0f, 0f, 10, 20, "***", new java.awt.Font("Helvetica", java.awt.Font.PLAIN, 10), OMText.JUSTIFY_LEFT);
        information.setLinePaint(Color.yellow);
        information.setFillPaint(new Color(100, 100, 100, 200));
        rectangle = new OMRect(0f, 0f, 0f, 0f, OMGraphic.LINETYPE_STRAIGHT);
        rectangle.setLinePaint(Color.yellow);
        rectangle.setLineType(OMGraphic.LINETYPE_STRAIGHT);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

     * @see com.bbn.openmap.omGraphics.OMRect
     */
    public static OMRect read(DataInputStream dis,
                              LinkProperties propertiesBuffer)
            throws IOException {
        OMRect rect = null;
        int x1, y1, x2, y2;
        float lt1, ln1, lt2, ln2;

        int renderType = dis.readByte();

        switch (renderType) {
        case RENDERTYPE_LATLON:
            int lineType = dis.readByte();
            lt1 = dis.readFloat();
            ln1 = dis.readFloat();
            lt2 = dis.readFloat();
            ln2 = dis.readFloat();
            int nsegs = dis.readInt();

            rect = new OMRect(lt1, ln1, lt2, ln2, lineType, nsegs);
            break;
        case RENDERTYPE_XY:
            x1 = dis.readInt();
            y1 = dis.readInt();
            x2 = dis.readInt();
            y2 = dis.readInt();

            rect = new OMRect(x1, y1, x2, y2);
            break;
        case RENDERTYPE_OFFSET:
            lt1 = dis.readFloat();
            ln1 = dis.readFloat();

            x1 = dis.readInt();
            y1 = dis.readInt();
            x2 = dis.readInt();
            y2 = dis.readInt();

            rect = new OMRect(lt1, ln1, x1, y1, x2, y2);
            break;
        default:
        }

        if (rect != null) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

        OMRect dot;

        public DTEDLocation(int x, int y) {
            text = new OMText(x + 10, y, (String) null, (java.awt.Font) null, OMText.JUSTIFY_LEFT);

            dot = new OMRect(x - 1, y - 1, x + 1, y + 1);
            text.setLinePaint(java.awt.Color.red);
            dot.setLinePaint(java.awt.Color.red);
        }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();

                    OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect",
                            fga,
                            layer,
                            false);
                    if (rect != null) {
                        rect.setAppObject(internalKey);
                    } else {
                        Debug.error("DemoLayer: Drawing tool can't create OMRect");
                    }
                } else {
                    Debug.output("DemoLayer can't find a drawing tool");
                }
            }
        });
        box.add(button);

        button = new JButton("Create Containing Polygon Filter");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();
                    fga.setFillPaint(OMColor.clear);

                    EditableOMPoly eomp = new EditableOMPoly(fga);
                    eomp.setEnclosed(true);
                    eomp.setShowGUI(false);

                    dt.setBehaviorMask(OMDrawingTool.QUICK_CHANGE_BEHAVIOR_MASK);
                    OMPoly poly = (OMPoly) getDrawingTool().edit(eomp, layer);

                    if (poly != null) {
                        poly.setIsPolygon(true);
                        poly.setAppObject(internalKey);
                    } else {
                        Debug.error("DemoLayer: Drawing tool can't create OMPoly");
                    }
                } else {
                    Debug.output("DemoLayer can't find a drawing tool");
                }
            }
        });
        box.add(button);

        button = new JButton("Create Excluding Rectangle Filter");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DrawingTool dt = getDrawingTool();
                if (dt != null) {
                    GraphicAttributes fga = getFilterGA();
                    fga.setFillPaint(OMColor.clear);

                    OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect",
                            fga,
                            layer,
                            false);
                    if (rect != null) {
                        rect.setAppObject(externalKey);
                    } else {
                        Debug.error("DemoLayer: Drawing tool can't create OMRect");
                    }
                } else {
                    Debug.output("DemoLayer can't find a drawing tool");
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

        omGraphics.addElement(tpcs);
        omGraphics.addElement(oncs);
        omGraphics.addElement(jncs);
        omGraphics.addElement(gncs);

        OMRect rect;

        for (int j = 0; j < hemisphereData.length; j++) {
            if (hemisphereData[j] == null) {
                Debug.message("rpfcov", "RpfCoverageManager. vector " + j
                        + " is null");
                continue;
            }

            int size = hemisphereData[j].size();
            for (int i = 0; i < size; i++) {
                RpfCoverageBox box = (RpfCoverageBox) hemisphereData[j].elementAt(i);

                rect = new OMRect((float) box.nw_lat, (float) box.nw_lon, (float) box.se_lat, (float) box.se_lon, currentLineType);

                float scale = RpfProductInfo.get(box.chartCode).scale;

                if (scale < 15000f) {
                    if (colors != null && colors.length >= 1) {
                        rect.setLinePaint(colors[0]);
                        if (fillRects)
                            rect.setFillPaint(colors[0]);
                    }
                    cgs.add(rect);
                } else if (scale == 50000f) {
                    if (colors != null && colors.length >= 2) {
                        rect.setLinePaint(colors[1]);
                        if (fillRects)
                            rect.setFillPaint(colors[1]);
                    }
                    tlms.add(rect);
                } else if (scale == 250000f) {
                    if (colors != null && colors.length >= 3) {
                        rect.setLinePaint(colors[2]);
                        if (fillRects)
                            rect.setFillPaint(colors[2]);
                    }
                    jogs.add(rect);
                } else if (scale == 500000f) {
                    if (colors != null && colors.length >= 4) {
                        rect.setLinePaint(colors[3]);
                        if (fillRects)
                            rect.setFillPaint(colors[3]);
                    }
                    tpcs.add(rect);
                } else if (scale == 1000000f) {
                    if (colors != null && colors.length >= 5) {
                        rect.setLinePaint(colors[4]);
                        if (fillRects)
                            rect.setFillPaint(colors[4]);
                    }
                    oncs.add(rect);
                } else if (scale == 2000000f) {
                    if (colors != null && colors.length >= 6) {
                        rect.setLinePaint(colors[5]);
                        if (fillRects)
                            rect.setFillPaint(colors[5]);
                    }
                    jncs.add(rect);
                } else if (scale == 5000000f) {
                    if (colors != null && colors.length >= 7) {
                        rect.setLinePaint(colors[6]);
                        if (fillRects)
                            rect.setFillPaint(colors[6]);
                    }
                    gncs.add(rect);
                } else if (scale == 66666f) {
                    if (colors != null && colors.length >= 8) {
                        rect.setLinePaint(colors[7]);
                        if (fillRects)
                            rect.setFillPaint(colors[7]);
                    }
                    cib10s.add(rect);
                } else if (scale == 33333f) {
                    if (colors != null && colors.length >= 9) {
                        rect.setLinePaint(colors[8]);
                        if (fillRects)
                            rect.setFillPaint(colors[8]);
                    }
                    cib5s.add(rect);
                } else if (scale == RpfConstants.Various) {
                    // Don't show it, because we don't know how to
                    // display it anyway. Don't bother projecting it.
                    continue;
                } else {
                    if (colors != null && colors.length >= 10) {
                        rect.setLinePaint(colors[9]);
                        if (fillRects)
                            rect.setFillPaint(colors[9]);
                    }
                    miscs.add(rect);
                }
                rect.generate(proj);
            }
        }
        return omGraphics;
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

                    + " not instance of SimpleBeanContainer");
        }

        SimpleBeanContainer bc = (SimpleBeanContainer) object;

        return new OMRect(bc.getTopLatitude(), bc.getLeftLongitude(), bc.getBottomLatitude(), bc.getRightLongitude(), OMGraphicConstants.LINETYPE_RHUMB);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

        OMGraphic graphic = super.getOMGraphicAt(0);

        if (graphic instanceof OMRect) {

            OMRect rect = (OMRect) graphic;

            rect.setLocation(bc.getTopLatitude(),
                    bc.getLeftLongitude(),
                    bc.getBottomLatitude(),
                    bc.getRightLongitude(),
                    OMGraphicConstants.LINETYPE_RHUMB);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRect

    /**
     * Get the OMRect used for calculating coverage area.
     */
    public OMRect getBounds() {
        if (bounds == null) {
            bounds = new OMRect(pso, lso, pso - degPerVerBlock * numVerBlocks_M, lso
                    + degPerHorBlock * numHorBlocks_N, OMGraphic.LINETYPE_GREATCIRCLE);
        }

        return bounds;
    }
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.