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

Java RenderingListener类代码示例

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

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



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

示例1: WWMapTools

import gov.nasa.worldwind.event.RenderingListener; //导入依赖的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


示例2: addRenderingListener

import gov.nasa.worldwind.event.RenderingListener; //导入依赖的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


示例3: LayerManagerPanel

import gov.nasa.worldwind.event.RenderingListener; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Entity类代码示例发布时间:2022-05-23
下一篇:
Java ItemStreamReader类代码示例发布时间: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