Examples of OMRaster


Examples of com.bbn.openmap.omGraphics.OMRaster

                // FileCacheImageInputStream fciis = new
                // FileCacheImageInputStream(in, null);
                // BufferedImage ii = ImageIO.read(fciis);

                OMRaster image = new OMRaster((int) 0, (int) 0, ii);
                list.add(image);
            } // end if image
        } catch (java.net.MalformedURLException murle) {
            Debug.error("WebImagePlugIn: URL \"" + urlString
                    + "\" is malformed.");
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

                    gtfFile.dumpTags(gtfFile.getGtfDirectory().getFields());
                    System.out.println("------------");

                    CADRG crg = new CADRG(new com.bbn.openmap.LatLonPoint(0f, 0f), 1500000, 600, 600);

                    final OMRaster omsr = new OMRaster(0, 0, bi);
                    omsr.generate(crg);

                    java.awt.Frame window = new java.awt.Frame(filePath) {
                        public void paint(java.awt.Graphics g) {
                            if (omsr != null) {
                                omsr.render(g);
                            }
                        }
                    };

                    window.addWindowListener(new java.awt.event.WindowAdapter() {
                        public void windowClosing(java.awt.event.WindowEvent e) {
                            // need a shutdown event to notify other gui beans
                            // and
                            // then exit.
                            System.exit(0);
                        }
                    });

                    window.setSize(omsr.getWidth(), omsr.getHeight());
                    window.setVisible(true);
                    window.repaint();

                }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

        }
        float lat = df.dsi.lat_origin + .5f;
        float lon = df.dsi.lon_origin + .5f;

        CADRG crg = new CADRG(new com.bbn.openmap.LatLonPoint(lat, lon), 1500000, 600, 600);
        final OMRaster ras = df.getOMRaster(crg);

        // Pushes the image to the left top of the frame.
        crg.setHeight(ras.getHeight());
        crg.setWidth(ras.getWidth());

        ras.generate(crg);

        java.awt.Frame window = new java.awt.Frame(args[0]) {
            public void paint(java.awt.Graphics g) {
                if (ras != null) {
                    ras.render(g);
                }
            }
        };

        window.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent e) {
                // need a shutdown event to notify other gui beans and
                // then exit.
                System.exit(0);
            }
        });

        window.setSize(ras.getWidth(), ras.getHeight());
        window.setVisible(true);
        window.repaint();
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

            // dGrid.getLeftLon(),
            //                                          dGrid.getLowerLat(), dGrid.getRightLon(),
            //                                          dGrid.width, dGrid.height,
            //                                          new int[dGrid.width*dGrid.height]);

            raster = new OMRaster(dGrid.getUpperLat(), dGrid.getLeftLon(), dGrid.width, dGrid.height, new int[dGrid.width
                    * dGrid.height]);
            return raster;
        } else {
            raster = null;
            return super.getRaster(grid);
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

                    BufferedImage bi = wfir.getBufferedImage();

                    CADRG crg = new CADRG(new com.bbn.openmap.LatLonPoint(0f, 0f), 1500000, 600, 600);

                    final OMRaster omsr = new OMRaster(0, 0, bi);
                    omsr.generate(crg);

                    java.awt.Frame window = new java.awt.Frame(filePath) {
                        public void paint(java.awt.Graphics g) {
                            if (omsr != null) {
                                omsr.render(g);
                            }
                        }
                    };

                    window.addWindowListener(new java.awt.event.WindowAdapter() {
                        public void windowClosing(java.awt.event.WindowEvent e) {
                            // need a shutdown event to notify other gui beans
                            // and
                            // then exit.
                            System.exit(0);
                        }
                    });

                    window.setSize(omsr.getWidth(), omsr.getHeight());
                    window.setVisible(true);
                    window.repaint();

                }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

        int width = projection.getWidth();
        int height = projection.getHeight();
        int[] pixels = new int[width * height];

        OMRaster ret = new OMRaster((int) 0, (int) 0, width, height, pixels);

        Debug.message("daynight", getName()
                + "|createImage: Center of bright spot lat= "
                + brightPoint.getLatitude() + ", lon= "
                + brightPoint.getLongitude());

        // Light is clear and/or white
        int light = daytimeColor.getRGB();

        // Allocate the memory here for the testPoint
        LatLonPoint testPoint = new LatLonPoint(0f, 0f);
        // great circle distance between the bright point and each
        // pixel.
        float distance;

        //  Set the darkeness value
        int dark = nighttimeColor.getRGB();// ARGB
        int darkness = dark >>> 24;// darkness alpha
        int value;

        // Calculate the fae limits around the terminator
        float upperFadeLimit = (float) (MoreMath.HALF_PI * (1.0 + termFade));
        float lowerFadeLimit = (float) (MoreMath.HALF_PI * (1.0 - termFade));
        int fadeColorValue = 0x00FFFFFF & (dark); // RGB

        for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {

                testPoint = projection.inverse(i, j, testPoint);
                distance = GreatCircle.spherical_distance(brightPoint.radlat_,
                        brightPoint.radlon_,
                        testPoint.radlat_,
                        testPoint.radlon_);

                if (distance > upperFadeLimit) {
                    pixels[j * width + i] = dark;
                } else if (distance > lowerFadeLimit) {
                    value = (int) (darkness * (1 - ((upperFadeLimit - distance) / (upperFadeLimit - lowerFadeLimit))));
                    value <<= 24;
                    pixels[j * width + i] = fadeColorValue | value;
                } else {
                    pixels[j * width + i] = light;
                }
            }
        }

        ret.generate(projection);
        return ret;
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(lat, lon, -offX, -offY, icon);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(x - offX, y - offY, icon);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(lat, lon, x - offX, y - offY, icon);
    }
View Full Code Here

Examples of com.bbn.openmap.omGraphics.OMRaster

     * Given a new latitude/longitude, reposition the graphic and
     * label.
     */
    public void setGraphicLocations(float latitude, float longitude) {
        if (location instanceof OMRaster) {
            OMRaster ras = (OMRaster) location;
            ras.setLat(latitude);
            ras.setLon(longitude);

            label.setLat(latitude);
            label.setLon(longitude);
            setHorizontalLabelBuffer((ras.getWidth() / 2) + SPACING);

        }
    }
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.