public AppFrame() {
      super(
          true, false,
          false); // Don't include the layer panel; we're using the on-screen layer tree.

      this.layerTree = new LayerTree();

      // Set up a layer to display the on-screen layer tree in the WorldWindow.
      this.hiddenLayer = new RenderableLayer();
      this.hiddenLayer.addRenderable(this.layerTree);
      this.getWwd().getModel().getLayers().add(this.hiddenLayer);

      // Mark the layer as hidden to prevent it being included in the layer tree's model. Including
      // the layer in
      // the tree would enable the user to hide the layer tree display with no way of bringing it
      // back.
      this.hiddenLayer.setValue(AVKey.HIDDEN, true);

      // Refresh the tree model with the WorldWindow's current layer list.
      this.layerTree.getModel().refresh(this.getWwd().getModel().getLayers());

      // Add a controller to handle input events on the layer tree.
      this.controller = new HotSpotController(this.getWwd());

      // Size the World Window to take up the space typically used by the layer panel. This
      // illustrates the
      // screen space gained by using the on-screen layer tree.
      Dimension size = new Dimension(1000, 600);
      this.setPreferredSize(size);
      this.pack();
      WWUtil.alignComponent(null, this, AVKey.CENTER);
    }
예제 #2
0
  /** Starts the MapPanel by creating the WWJ Map and showing it. */
  public void start() {
    setupWWD();
    setupStatusBar();
    setupViewControllers();
    setupSky();
    // setupAnnotationToggling();

    // Center the application on the screen.
    WWUtil.alignComponent(null, this, AVKey.CENTER);
  }
예제 #3
0
 private void openVPFCoveragePanel(VPFDatabase db, VPFLayer layer) {
   VPFCoveragePanel panel = new VPFCoveragePanel(getWwd(), db);
   panel.setLayer(layer);
   JFrame frame = new JFrame(db.getName());
   frame.setResizable(true);
   frame.setAlwaysOnTop(true);
   frame.add(panel);
   frame.pack();
   WWUtil.alignComponent(this, frame, AVKey.CENTER);
   frame.setVisible(true);
 }
  public ViewViewVolume() {
    this.getContentPane().setLayout(new BorderLayout(5, 5));

    this.wwp = new WWPanel(new Dimension(650, 500));
    this.getContentPane().add(wwp);

    this.pack();
    this.setResizable(true);

    WWUtil.alignComponent(null, this, AVKey.CENTER);

    this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
  }