• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RenderingEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gov.nasa.worldwind.event.RenderingEvent的典型用法代码示例。如果您正苦于以下问题:Java RenderingEvent类的具体用法?Java RenderingEvent怎么用?Java RenderingEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RenderingEvent类属于gov.nasa.worldwind.event包,在下文中一共展示了RenderingEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: stageChanged

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public void stageChanged(RenderingEvent event)
{
    if (event.getStage().equals(RenderingEvent.AFTER_BUFFER_SWAP) && this.snapFile != null)
    {
        try
        {
            GLAutoDrawable glad = (GLAutoDrawable) event.getSource();
            AWTGLReadBufferUtil glReadBufferUtil = new AWTGLReadBufferUtil(glad.getGLProfile(), false);
            BufferedImage image = glReadBufferUtil.readPixelsToBufferedImage(glad.getGL(), true);
            String suffix = WWIO.getSuffix(this.snapFile.getPath());
            ImageIO.write(image, suffix, this.snapFile);
            System.out.printf("Image saved to file %s\n", this.snapFile.getPath());
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        finally
        {
            this.snapFile = null;
            this.wwd.removeRenderingListener(this);
        }
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:25,代码来源:MapSaveCurrentMapAsImagesAction.java


示例2: WWMapTools

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public WWMapTools(MapApp app, XMap map, WorldWindowGLCanvas wwCanvas) {
	super(app, map);
	this.wwCanvas = wwCanvas;

	wwCanvas.getInputHandler().addMouseMotionListener(
			new MouseInputAdapter() {
				@Override
				public void mouseMoved(MouseEvent e) {
					lastPoint = e.getPoint();
					
					SwingUtilities.invokeLater(new Runnable() {
						public void run() {
							updateInfo();
						}
					});
				}
			});

	wwCanvas.addRenderingListener(new RenderingListener() {
		public void stageChanged(RenderingEvent event) {
			if (event.getStage().equals(RenderingEvent.AFTER_BUFFER_SWAP)) {
				alt = WWMapTools.this.wwCanvas.getView().getEyePosition().getElevation()/1000;

				SwingUtilities.invokeLater(new Runnable() {
					public void run() {
						updateInfo();
					}
				});
			}
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:33,代码来源:WWMapTools.java


示例3: stageChanged

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public void stageChanged(final RenderingEvent event) {
	if (!event.getStage().equals(RenderingEvent.BEFORE_BUFFER_SWAP)) {
		return;
	}

	EventQueue.invokeLater(new Runnable() {
		public void run() {
			if (_ww.getView() != null && _ww.getView().getEyePosition() != null) {
				altDisplay = makeEyeAltitudeDescription(_ww.getView().getEyePosition().getElevation());
			} else {
				altDisplay = (Logging.getMessage("term.Altitude"));
			}
		}
	});
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:16,代码来源:StatusLayer.java


示例4: stageChanged

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public void stageChanged(RenderingEvent event) {
    if (!event.getStage().equals(RenderingEvent.AFTER_BUFFER_SWAP))
        return;

    // We notify of changes during this rendering stage because the sector is updated within the region shape's
    // render method.

    this.notifySectorChanged();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:10,代码来源:SectorSelector.java


示例5: stageChanged

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public void stageChanged( RenderingEvent event ) {
    if (!event.getStage().equals(RenderingEvent.BEFORE_BUFFER_SWAP))
        return;

    EventQueue.invokeLater(new Runnable(){
        public void run() {
            if (eventSource.getView() != null && eventSource.getView().getEyePosition() != null)
                altDisplay.setText(makeEyeAltitudeDescription(eventSource.getView().getEyePosition().getElevation()));
            else
                altDisplay.setText(Logging.getMessage("term.Altitude"));
        }
    });
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:14,代码来源:StatusBar.java


示例6: addRenderingListener

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
private void addRenderingListener() {

		_wwCanvas.setPerFrameStatisticsKeys(PerformanceStatistic.ALL_STATISTICS_SET);

		_renderingListener = new RenderingListener() {
			public void stageChanged(final RenderingEvent event) {

				if (_isUIUpdateScheduled) {

					// UI update is scheduled but not yet done

					return;
				}

				final String stage = event.getStage();
				final Object source = event.getSource();

//				System.out.println((UI.timeStampNano() + " [" + getClass().getSimpleName() + "] ")
//						+ ("\tstage: " + stage)
//						+ ("\tsource: " + source.getClass()));
//				// TODO remove SYSTEM.OUT.PRINTLN

				final long now = System.currentTimeMillis();

				if (now - _lastUIUpdateTime > UI_UPDATE_INTERVAL
						&& stage.equals(RenderingEvent.AFTER_BUFFER_SWAP)
						&& source instanceof WorldWindow) {

					// check if statistic data are available
					final Collection<PerformanceStatistic> perFrameStatistics = _wwCanvas
							.getSceneController()
							.getPerFrameStatistics();

					if (perFrameStatistics.size() < 1) {
						return;
					}

					// schedule a new UI update

					_perFrameStatistics.clear();
					_perFrameStatistics.addAll(perFrameStatistics);

					_isUIUpdateScheduled = true;

					EventQueue.invokeLater(new Runnable() {
						public void run() {

							// run in SWT thread

							Display.getDefault().asyncExec(new Runnable() {
								public void run() {

									updateUI_Container();

									_isUIUpdateScheduled = false;

									_lastUIUpdateTime = System.currentTimeMillis();
								}
							});
						}
					});

				}
			}
		};

		_wwCanvas.addRenderingListener(_renderingListener);
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:69,代码来源:Map3StatisticsView.java


示例7: LayerManagerPanel

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public LayerManagerPanel(final WorldWindow wwd)
{
    super(new BorderLayout(10, 10));

    this.layerNamesPanel = new JPanel(new GridLayout(0, 1, 0, 5));
    this.layerNamesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    // Must put the layer grid in a container to prevent the scroll pane from stretching vertical spacing.
    JPanel dummyPanel = new JPanel(new BorderLayout());
    dummyPanel.add(this.layerNamesPanel, BorderLayout.NORTH);

    // Put the layers panel in a scroll pane.
    JScrollPane scrollPane = new JScrollPane(dummyPanel);

    // Suppress the scroll pane's default border.
    scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    // Add the scroll pane to a titled panel that will resize with the main window.
    JPanel titlePanel = new JPanel(new GridLayout(0, 1, 0, 10));
    titlePanel.setBorder(
        new CompoundBorder(BorderFactory.createEmptyBorder(9, 9, 9, 9), new TitledBorder("Layers")));
    titlePanel.setToolTipText("Layers to Show");
    titlePanel.add(scrollPane);
    titlePanel.setPreferredSize(new Dimension(200, 500));
    this.add(titlePanel, BorderLayout.CENTER);

    this.fill(wwd);

    this.plainFont = this.getFont().deriveFont(Font.PLAIN);
    this.boldFont = this.getFont().deriveFont(Font.BOLD);

    // Register a rendering listener that updates the was-rendered state of each image layer.
    wwd.addRenderingListener(new RenderingListener()
    {
        @Override
        public void stageChanged(RenderingEvent event)
        {
            updateLayerActivity(wwd);
        }
    });

    // Add a property change listener that causes this layer panel to be updated whenever the layer list changes.
    wwd.getModel().getLayers().addPropertyChangeListener(new PropertyChangeListener()
    {
        @Override
        public void propertyChange(PropertyChangeEvent propertyChangeEvent)
        {
            if (propertyChangeEvent.getPropertyName().equals(AVKey.LAYERS))
                SwingUtilities.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        update(wwd);
                    }
                });
        }
    });
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:59,代码来源:LayerManagerPanel.java


示例8: stageChanged

import gov.nasa.worldwind.event.RenderingEvent; //导入依赖的package包/类
public void stageChanged(RenderingEvent re) {
    //System.out.println("Test Listeners 1");
}
 
开发者ID:danielbejaranogonzalez,项目名称:Mobile-Network-LTE,代码行数:4,代码来源:PanelDiagramas.java



注:本文中的gov.nasa.worldwind.event.RenderingEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NamespaceVersion类代码示例发布时间:2022-05-23
下一篇:
Java PortResolver类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap