Examples of OMGraphic


Examples of com.bbn.openmap.omGraphics.OMGraphic

        holder.add(btnPanel, BorderLayout.SOUTH);

        redrawSelected.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (!(graphicIndex < 0)) {
                    OMGraphic omg = getEsriGraphicList().getOMGraphicAt(graphicIndex);
                    repaintGraphics(omg);
                }
            }
        });
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

        EsriGraphicList list = getEsriGraphicList();
        boolean ret = false;
        graphicIndex = -1;

        if (list != null) {
            OMGraphic omg = list.selectClosest(e.getX(), e.getY(), 4);
            if (omg != null) {
                // graphicIndex has to be set before selectEntry
                // called.
                graphicIndex = list.indexOf(omg);
                selectEntry(omg);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     */
    public boolean mouseMoved(MouseEvent e) {
        EsriGraphicList list = getEsriGraphicList();
        boolean ret = false;
        if (list != null) {
            OMGraphic omg = list.findClosest(e.getX(), e.getY(), 4);
            if (omg != null) {
                int index;

                Integer I = ((Integer) omg.getAttribute(SHAPE_INDEX_ATTRIBUTE));
                if (I != null) {
                    index = I.intValue() - 1;
                } else {
                    index = list.indexOf(omg);
                }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

                if (Debug.debugging("mysql")) {
                    Debug.output("MysqlGeometryLayer result: " + result);
                }

                MysqlGeometry mg = MysqlWKTGeometryFactory.createGeometry(result);
                OMGraphic omg = createGraphic(mg);
                omg.generate(proj);
                graphics.add(omg);
            }

            rs.close();
            conn.close();
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     */
    protected OMGraphic createPolygon(MysqlPolygon myPoly) {
        Vector v = myPoly.getRings();
        int size = v.size();

        OMGraphic ret = null;
        OMPoly ompoly = null;
        OMGraphicList subList = null;

        if (size > 1) {
            subList = new OMGraphicList();
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     * Method chooses what type of geometry to render.
     *
     * @param mg Database object which will be rendered
     */
    protected OMGraphic createGraphic(MysqlGeometry mg) {
        OMGraphic ret = null;

        if (mg != null) {
            String type = mg.getType();

            if (type.equals(MysqlGeometry.POINTTYPE)) {
                ret = createPoint((MysqlPoint) mg);
            } else if (type.equals(MysqlGeometry.LINESTRINGTYPE)) {
                ret = createLine((MysqlLine) mg);
            } else if (type.equals(MysqlGeometry.POLYGONTTYPE)) {
                ret = createPolygon((MysqlPolygon) mg);
            } else if (type.equals(MysqlGeometry.MULTIPOINTTYPE)
                    || type.equals(MysqlGeometry.MULTILINESTRINGTYPE)
                    || type.equals(MysqlGeometry.MULTIPOLYGONTYPE)
                    || type.equals(MysqlGeometry.GEOMETRYCOLLECTIONTYPE)) {

                MysqlMulti multi = (MysqlMulti) mg;
                OMGraphicList subList = new OMGraphicList();
                for (int i = 0; i < multi.countElements(); i++) {
                    OMGraphic subRet = null;
                    if (type.equals(MysqlGeometry.MULTIPOINTTYPE)) {
                        subRet = createPoint((MysqlPoint) multi.getElementByIndex(i));
                    } else if (type.equals(MysqlGeometry.MULTILINESTRINGTYPE)) {
                        subRet = createLine((MysqlLine) multi.getElementByIndex(i));
                    } else if (type.equals(MysqlGeometry.MULTIPOLYGONTYPE)) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     * @param e MouseEvent
     * @return true if the listener was able to process the event.
     */
    public boolean mouseMoved(java.awt.event.MouseEvent e) {
        if (receiver instanceof PlugIn && omList != null) {
            OMGraphic graphic = omList.getOMGraphicThatContains(e.getX(),
                    e.getY());
            String label = null;
            if (graphic instanceof Node) {
                label = ((Node) graphic).getLabel();
                // } else if (graphic instanceof Line) {
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

        public void generate(Projection p, long time, boolean showScenario) {
            synchronized (graphics) {
                Iterator it = iterator();
                while (it.hasNext()) {
                    OMGraphic graphic = (OMGraphic) it.next();
                    if (graphic instanceof ScenarioGraphic) {
                        ((ScenarioGraphic) graphic).generate(p,
                                time,
                                showScenario);
                    } else {
                        graphic.generate(p);
                    }
                }
            }
        }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

     * @param grid
     * @param proj
     * @return OMRaster that reflects slope information.
     */
    public OMRaster generateRasterForProjection(OMGrid grid, Projection proj) {
        OMGraphic omg = generate(grid, proj);
        if (omg instanceof OMRaster) {
            return (OMRaster) omg;
        } else {
            return null;
        }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMGraphic

    }

    protected void updateDrawingParameters(OMGraphicList omgl) {
        if (omgl != null) {
            for (Iterator it = omgl.iterator(); it.hasNext();) {
                OMGraphic omg = (OMGraphic) it.next();
                Integer recNum = (Integer) omg.getAttribute(ShapeConstants.SHAPE_INDEX_ATTRIBUTE);
                if (recNum != null) {
                    getDrawParams(recNum.intValue()).setTo(omg);
                    omg.putAttribute(OMGraphic.INFOLINE, getName(recNum));
                }
            }
        }
    }
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.