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

Java NewtCanvasAWT类代码示例

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

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



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

示例1: VisualizationPanel

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
/**
 * Constructs a new visualization-panel using the specified configuration.
 *
 * @param visualization the visualization to be displayed.
 * @param config        the configuration for the visualization-panel to be created.
 */
public VisualizationPanel(Visualization visualization, VisualizerConfig config) {
    this.visualization = visualization;

    window = GLWindow.create(config.glcapabilities);
    window.addGLEventListener(visualization.getRenderContext());
    window.addMouseListener(visualization.getMouseListener());
    window.addKeyListener(visualization.getKeyController());

    animator = new FPSAnimator(window, config.fps, true);
    visualization.getRenderContext().setAnimator(animator);

    canvas = new NewtCanvasAWT(window);

    this.setLayout(new BorderLayout());
    this.add(canvas, BorderLayout.CENTER);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:23,代码来源:VisualizationPanel.java


示例2: RenderWindow

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
RenderWindow(int x, int y, int width, int height, String title, String name,
             GLContext sharedContext,
             GLCapabilitiesImmutable caps,
             GLEventListener glListener, Image icon, int windowID, int viewID,
             WindowInteractionListener appListener) {

	_window = GLWindow.create(caps);

	_window.addGLEventListener(glListener);
	_window.setSharedContext(sharedContext);

	_awtFrame = new Frame(title);
	NewtCanvasAWT canvas = new NewtCanvasAWT(_window);
	_awtFrame.add(canvas);
	_awtFrame.setBounds(x, y, width, height);

	if (icon != null) {
		_awtFrame.setIconImage(icon);
	}

	_appListener = appListener;

	_windowID = windowID;
	_viewID = viewID;

	_name = name;

}
 
开发者ID:jaamsim,项目名称:jaamsim,代码行数:29,代码来源:RenderWindow.java


示例3: prepareGui

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
public static JFrame prepareGui() {
    mainFrame = createMainFrame();
    menuBar = new MenuBar();
    mainFrame.setJMenuBar(menuBar);

    Camera camera = Displayer.getCamera();
    panInteraction = new InteractionPan(camera);
    rotationInteraction = new InteractionRotate(camera);
    axisInteraction = new InteractionAxis(camera);
    annotateInteraction = new InteractionAnnotate(camera);
    currentInteraction = rotationInteraction;

    leftPane = new SideContentPane();
    leftPane.add("Movie Controls", MoviePanel.getInstance(), true);
    MoviePanel.setAdvanced(false);

    // Layer control
    layers = new Layers();
    layersPanel = new LayersPanel(layers);

    leftPane.add("Image Layers", layersPanel, true);
    leftScrollPane = new JScrollPane(leftPane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    leftScrollPane.setFocusable(false);
    leftScrollPane.setBorder(null);
    leftScrollPane.getVerticalScrollBar().setUnitIncrement(layersPanel.getGridRowHeight());

    glWindow = GLHelper.createGLWindow();
    glWindow.setTitle(mainFrame.getTitle());
    glListener = new GLListener(glWindow);
    glWindow.addGLEventListener(glListener);

    inputController = new InputController();
    glWindow.addMouseListener(new NEWTMouseAdapter(inputController));
    glWindow.addKeyListener(new NEWTKeyAdapter(inputController));

    glComponent = new NewtCanvasAWT(glWindow);
    mainContentPanel = new MainContentPanel(glComponent);

    JSplitPane midSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
    midSplitPane.setDividerSize(2);
    midSplitPane.setBorder(null);

    midSplitPane.setLeftComponent(leftScrollPane);
    midSplitPane.setRightComponent(mainContentPanel);

    // STATUS PANEL
    zoomStatus = new ZoomStatusPanel();
    carringtonStatus = new CarringtonStatusPanel();
    framerateStatus = new FramerateStatusPanel();
    PositionStatusPanel positionStatus = new PositionStatusPanel();
    inputController.addPlugin(positionStatus);

    StatusPanel statusPanel = new StatusPanel(leftScrollPane.getPreferredSize().width, 5);
    statusPanel.addPlugin(zoomStatus, StatusPanel.Alignment.LEFT);
    statusPanel.addPlugin(carringtonStatus, StatusPanel.Alignment.LEFT);
    statusPanel.addPlugin(framerateStatus, StatusPanel.Alignment.LEFT);
    statusPanel.addPlugin(positionStatus, StatusPanel.Alignment.RIGHT);

    toolBar = new TopToolBar();
    mainFrame.add(toolBar, BorderLayout.PAGE_START);
    mainFrame.add(midSplitPane, BorderLayout.CENTER);
    mainFrame.add(statusPanel, BorderLayout.PAGE_END);

    return mainFrame;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:66,代码来源:ImageViewerGui.java


示例4: getGLComponent

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
public static NewtCanvasAWT getGLComponent() {
    return glComponent;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:4,代码来源:ImageViewerGui.java


示例5: demoRendererInJFrame

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
@Test
public void demoRendererInJFrame()	throws InterruptedException,
																		IOException
{

	final ClearVolumeRendererInterface lClearVolumeRenderer =
																													ClearVolumeRendererFactory.newBestRenderer(	"ClearVolumeTest",
																																																			512,
																																																			512,
																																																			NativeTypeEnum.UnsignedByte,
																																																			512,
																																																			512,
																																																			1,
																																																			true);
	final NewtCanvasAWT lNewtCanvasAWT = lClearVolumeRenderer.getNewtCanvasAWT();

	final JFrame lJFrame = new JFrame("ClearVolume");
	lJFrame.setLayout(new BorderLayout());
	final Container lContainer = new Container();
	lContainer.setLayout(new BorderLayout());
	lContainer.add(lNewtCanvasAWT, BorderLayout.CENTER);
	lJFrame.setSize(new Dimension(1024, 1024));
	lJFrame.add(lContainer);
	SwingUtilities.invokeLater(new Runnable()
	{
		@Override
		public void run()
		{
			lJFrame.setVisible(true);
		}
	});

	lClearVolumeRenderer.setTransferFunction(TransferFunctions.getDefault());
	lClearVolumeRenderer.setVisible(true);

	final int lResolutionX = 512;
	final int lResolutionY = lResolutionX;
	final int lResolutionZ = lResolutionX;

	final byte[] lVolumeDataArray =
																new byte[lResolutionX	* lResolutionY
																					* lResolutionZ];

	for (int z = 0; z < lResolutionZ; z++)
		for (int y = 0; y < lResolutionY; y++)
			for (int x = 0; x < lResolutionX; x++)
			{
				final int lIndex = x	+ lResolutionX * y
														+ lResolutionX * lResolutionY * z;
				int lCharValue = (((byte) x ^ (byte) y ^ (byte) z));
				if (lCharValue < 12)
					lCharValue = 0;
				lVolumeDataArray[lIndex] = (byte) lCharValue;
			}

	lClearVolumeRenderer.setVolumeDataBuffer(	0,
																						ByteBuffer.wrap(lVolumeDataArray),
																						lResolutionX,
																						lResolutionY,
																						lResolutionZ);
	lClearVolumeRenderer.requestDisplay();

	while (lClearVolumeRenderer.isShowing() && lJFrame.isVisible())
	{
		Thread.sleep(100);
		lJFrame.setTitle("BRAVO! THIS IS A JFRAME! It WORKS!");
	}

	lClearVolumeRenderer.close();
	lJFrame.dispose();

}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:73,代码来源:ClearVolumeOtherDemos.java


示例6: getNewtCanvasAWT

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
/**
 * @return the mNewtCanvasAWT
 */
@Override
public NewtCanvasAWT getNewtCanvasAWT()
{
  return mNewtCanvasAWT;
}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:9,代码来源:ClearGLVolumeRenderer.java


示例7: initGL

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
private void initGL() {
    GLProfile gLProfile = GLProfile.getDefault();

    GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

    glWindow = GLWindow.create(gLCapabilities);

    newtCanvasAWT = new NewtCanvasAWT(glWindow);

    glWindow.setSize(imageWidth, imageHeight);

    glWindow.addGLEventListener(this);

    Animator animator = new Animator(glWindow);
    animator.setRunAsFastAsPossible(true);
    animator.start();
}
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:18,代码来源:Tutorial11.java


示例8: getNewtCanvasAWT

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
public NewtCanvasAWT getNewtCanvasAWT() {
    return newtCanvasAWT;
}
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:4,代码来源:Tutorial11.java


示例9: initGL

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);

        animator = new Animator(glWindow);
        animator.setRunAsFastAsPossible(true);
        animator.start();

        Vec3 cameraPos = new Vec3(0f, 0f, -3f);
        Quat quat = new Quat(0f, 0f, 0f, 1f);

        viewPole = new ViewPole(new ViewData(cameraPos, quat, 10f), new ViewScale(90f/250f, 0.2f));
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:24,代码来源:Tutorial15.java


示例10: initGL

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);
        glWindow.addMouseListener(viewPole);
        glWindow.addKeyListener(new KeyListener());

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:20,代码来源:Viewer.java


示例11: initGL

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);

        animator = new Animator(glWindow);
        animator.setRunAsFastAsPossible(true);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:19,代码来源:Tutorial16.java


示例12: getNewtCanvasAWT

import com.jogamp.newt.awt.NewtCanvasAWT; //导入依赖的package包/类
/**
 * Returns a Canvas that can be used to embed this renderer.
 *
 * @return A NewtCanvasAWT object or null if the renderer cannot be embedded.
 */
public NewtCanvasAWT getNewtCanvasAWT();
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:7,代码来源:ClearVolumeRendererInterface.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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