public static void main(String[] args) { Configuration.setValue(AVKey.INITIAL_LATITUDE, 49.05); Configuration.setValue(AVKey.INITIAL_LONGITUDE, -122.78); Configuration.setValue(AVKey.INITIAL_ALTITUDE, 8000); ApplicationTemplate.start("World Wind Multi Path", AppFrame.class); }
public static void main(String[] args) { // Adjust configuration values before instantiation Configuration.setValue(AVKey.GLOBE_CLASS_NAME, EarthFlat.class.getName()); Configuration.setValue(AVKey.INITIAL_ALTITUDE, 27e6); Configuration.setValue(AVKey.INITIAL_LATITUDE, 0); Configuration.setValue(AVKey.INITIAL_LONGITUDE, 88); ApplicationTemplate.start("World Wind Icon Picking", AppFrame.class); }
public static void main(String[] args) { // zoom to San Francisco downtown Configuration.setValue(AVKey.INITIAL_ALTITUDE, 34e3); Configuration.setValue(AVKey.INITIAL_LATITUDE, 37.9521d); Configuration.setValue(AVKey.INITIAL_LONGITUDE, -119.7761d); // Adjust configuration values before instantiation ApplicationTemplate.start("World Wind Terrain Intersections", AppFrame.class); }
public AppFrame() { // Create the WorldWindow. this.wwjPanel = new ApplicationTemplate.AppPanel(this.canvasSize, true); this.wwjPanel.setPreferredSize(canvasSize); ApplicationTemplate.insertBeforePlacenames(this.wwjPanel.getWwd(), layer); JPanel shapesPanel = makeShapeSelectionPanel(); shapesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel attrsPanel = makeAttributesPanel(); attrsPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); // Put the pieces together. JPanel controlPanel = new JPanel(new BorderLayout()); controlPanel.add(shapesPanel, BorderLayout.CENTER); JPanel p = new JPanel(new BorderLayout(6, 6)); p.add(attrsPanel, BorderLayout.CENTER); controlPanel.add(p, BorderLayout.SOUTH); this.getContentPane().add(wwjPanel, BorderLayout.CENTER); this.getContentPane().add(controlPanel, BorderLayout.WEST); this.pack(); // Center the application on the screen. Dimension prefSize = this.getPreferredSize(); Dimension parentSize; java.awt.Point parentLocation = new java.awt.Point(0, 0); parentSize = Toolkit.getDefaultToolkit().getScreenSize(); int x = parentLocation.x + (parentSize.width - prefSize.width) / 2; int y = parentLocation.y + (parentSize.height - prefSize.height) / 2; this.setLocation(x, y); this.setResizable(true); wwjPanel .getWwd() .addRenderingListener( new RenderingListener() { public void stageChanged(RenderingEvent event) { if (!event.getStage().equals(RenderingEvent.BEFORE_BUFFER_SWAP)) return; if (currentShape instanceof Polyline) { Polyline p = (Polyline) currentShape; String length = Double.toString(p.getLength()); textRenderer.beginRendering(wwjPanel.getWidth(), wwjPanel.getHeight()); textRenderer.draw(length, 100, 100); textRenderer.endRendering(); } } }); // Enable dragging and other selection responses this.setupSelection(); }
public AppFrame() { super(true, true, false); IconLayer layer = new IconLayer(); layer.setPickEnabled(true); layer.setAllowBatchPicking(false); layer.setRegionCulling(true); UserFacingIcon icon = new UserFacingIcon( "src/images/32x32-icon-nasa.png", new Position(Angle.fromRadians(0), Angle.fromRadians(0), 0)); icon.setSize(new Dimension(24, 24)); layer.addIcon(icon); icon = new UserFacingIcon( "src/images/32x32-icon-nasa.png", new Position(Angle.fromRadians(0.1), Angle.fromRadians(0.0), 0)); icon.setSize(new Dimension(24, 24)); layer.addIcon(icon); icon = new UserFacingIcon( "src/images/32x32-icon-nasa.png", new Position(Angle.fromRadians(0.0), Angle.fromRadians(0.1), 0)); icon.setSize(new Dimension(24, 24)); layer.addIcon(icon); icon = new UserFacingIcon( "src/images/32x32-icon-nasa.png", new Position(Angle.fromRadians(0.1), Angle.fromRadians(0.1), 0)); icon.setSize(new Dimension(24, 24)); layer.addIcon(icon); icon = new UserFacingIcon( "src/images/32x32-icon-nasa.png", new Position(Angle.fromRadians(0), Angle.fromDegrees(180), 0)); icon.setSize(new Dimension(24, 24)); layer.addIcon(icon); ApplicationTemplate.insertAfterPlacenames(this.getWwd(), layer); this.getWwd() .addSelectListener( new SelectListener() { @Override public void selected(SelectEvent event) { if (event.getEventAction().equals(SelectEvent.ROLLOVER)) { PickedObjectList pol = event.getObjects(); System.out.println(" Picked Objects Size " + pol.size()); for (PickedObject po : pol) { System.out.println( " Class " + po.getObject().getClass().getName() + " isTerrian=" + po.isTerrain()); } } } }); this.getWwd().getSceneController().setDeepPickEnabled(true); }
public static void main(String[] args) { Configuration.setValue(AVKey.INITIAL_LATITUDE, 37.8432); Configuration.setValue(AVKey.INITIAL_LONGITUDE, -105.0527); Configuration.setValue(AVKey.INITIAL_ALTITUDE, 7000); ApplicationTemplate.start("World Wind Video on Terrain", AppFrame.class); }
public static void main(String[] args) { ApplicationTemplate.start("World Wind Airspace Builder", AppFrame.class); }
public static void main(String[] args) { ApplicationTemplate.start("World Wind Layer Tree", AppFrame.class); }
public static void main(String[] args) { ApplicationTemplate.start("World Wind Place Names", AppFrame.class); }
/** * Marked as deprecated to keep it out of the javadoc. * * @param args the arguments passed to the program. * @deprecated */ public static void main(String[] args) { //noinspection deprecation ApplicationTemplate.start("World Wind Line Builder", LineBuilder.AppFrame.class); }