当前位置: 首页>>代码示例>>Java>>正文


Java GLCanvas.setBounds方法代码示例

本文整理汇总了Java中com.jogamp.opengl.awt.GLCanvas.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java GLCanvas.setBounds方法的具体用法?Java GLCanvas.setBounds怎么用?Java GLCanvas.setBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.awt.GLCanvas的用法示例。


在下文中一共展示了GLCanvas.setBounds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JavaSimpleLite_ImageSource

import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public JavaSimpleLite_ImageSource(NyARParam i_param, NyARCode i_ar_code,BufferedImage i_image) throws NyARRuntimeException,IOException
{
	this._ar_param = i_param;

	Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
	// NyARToolkitの準備
	this._nya = NyARSingleDetectMarker.createInstance(this._ar_param, i_ar_code, 80.0,NyARSingleDetectMarker.PF_NYARTOOLKIT);
	this._nya.setContinueMode(false);// ここをtrueにすると、transMatContinueモード(History計算)になります。
	//load bitmap image
	this._src_image =new NyARBufferedImageRaster(i_image);
	
	// 3Dを描画するコンポーネント
	GLCanvas canvas = new GLCanvas();
	frame.add(canvas);
	canvas.addGLEventListener(this);
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e)
		{
			System.exit(0);
		}
	});

	frame.setVisible(true);
	Insets ins = frame.getInsets();
	frame.setSize(i_image.getWidth() + ins.left + ins.right, i_image.getHeight() + ins.top + ins.bottom);
	canvas.setBounds(ins.left, ins.top, i_image.getWidth(), i_image.getHeight());
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:28,代码来源:JavaSimpleLite_ImageSource.java

示例2: JavaSimpleLite

import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public JavaSimpleLite(NyARParam i_param, NyARCode i_ar_code) throws NyARRuntimeException
{
	this._ar_param = i_param;

	Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");

	
	// キャプチャの準備
	JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();
	this._capture = devlist.getDevice(0);
	if (!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y, 30.0f)) {
		throw new NyARRuntimeException();
	}
	this._capture.setOnCapture(this);
	//JMFラスタオブジェクト
	this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());
	
	// NyARToolkitの準備
	this._nya = NyARSingleDetectMarker.createInstance(this._ar_param, i_ar_code, 80.0);
	this._nya.setContinueMode(true);// ここをtrueにすると、transMatContinueモード(History計算)になります。
	
	// 3Dを描画するコンポーネント
	GLCanvas canvas = new GLCanvas();
	frame.add(canvas);
	canvas.addGLEventListener(this);
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e)
		{
			_capture.stop();
			System.exit(0);
		}
	});

	frame.setVisible(true);
	Insets ins = frame.getInsets();
	frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
	canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:39,代码来源:JavaSimpleLite.java

示例3: SingleARMarker

import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SingleARMarker(NyARParam i_cparam) throws Exception
{
	JmfCaptureDeviceList devlist=new JmfCaptureDeviceList();
	this._ar_param=i_cparam;

	//キャプチャリソースの準備
	this._capture=devlist.getDevice(0);
	if(!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y,30.0f)){
		throw new NyARRuntimeException();
	}
	this._capture.setOnCapture(this);
	this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());	

	this._code_table[0]=NyARCode.loadFromARPattFile(new FileInputStream(CARCODE_FILE1),16,16);
	this._code_table[1]=NyARCode.loadFromARPattFile(new FileInputStream(CARCODE_FILE2),16,16);
	
	//OpenGLフレームの準備(OpenGLリソースの初期化、カメラの撮影開始は、initコールバック関数内で実行)
	Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
	GLCanvas canvas = new GLCanvas();
	frame.add(canvas);
	canvas.addGLEventListener(this);
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e)
		{
			System.exit(0);
		}
	});
	
	//ウインドウサイズの調整
	frame.setVisible(true);
	Insets ins = frame.getInsets();
	frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
	canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
	return;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:36,代码来源:SingleARMarker.java

示例4: SingleNyIdMarker

import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SingleNyIdMarker(NyARParam i_cparam) throws NyARRuntimeException
{
	JmfCaptureDeviceList devlist=new JmfCaptureDeviceList();
	this._ar_param=i_cparam;

	//キャプチャリソースの準備
	this._capture=devlist.getDevice(0);
	if(!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y,30.0f)){
		throw new NyARRuntimeException();
	}
	this._capture.setOnCapture(this);
	this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());	
	
	//OpenGLフレームの準備(OpenGLリソースの初期化、カメラの撮影開始は、initコールバック関数内で実行)
	Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
	GLCanvas canvas = new GLCanvas();
	frame.add(canvas);
	canvas.addGLEventListener(this);
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e)
		{
			System.exit(0);
		}
	});
	
	//ウインドウサイズの調整
	frame.setVisible(true);
	Insets ins = frame.getInsets();
	frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
	canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
	return;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:33,代码来源:SingleNyIdMarker.java

示例5: SimpleLiteMStandard

import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SimpleLiteMStandard(INyARMarkerSystemConfig i_config) throws NyARRuntimeException
{		
	JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();
	JmfCaptureDevice d = devlist.getDevice(0);
	d.setCaptureFormat(i_config.getScreenSize(),30.0f);
	this._camera=new NyARJmfCamera(d);//create sensor system
	this._nyar=new NyARGlMarkerSystem(i_config);   //create MarkerSystem
	this.ids[0]=this._nyar.addARMarker(ARCODE_FILE2,16,25,80);
	this.ids[1]=this._nyar.addARMarker(ARCODE_FILE,16,25,80);
	
	Frame frame= new Frame("NyARTK program");
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e)
		{
			System.exit(0);
		}
	});
	GLCanvas canvas = new GLCanvas();
	frame.add(canvas);
	canvas.addGLEventListener(this);
	NyARIntSize s=i_config.getNyARSingleCameraView().getARParam().getScreenSize();

	frame.setVisible(true);
	Insets ins = frame.getInsets();
	frame.setSize(s.w + ins.left + ins.right,s.h + ins.top + ins.bottom);		
	canvas.setBounds(ins.left, ins.top, s.w,s.h);


	this._camera.start();
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:31,代码来源:SimpleLiteMStandard.java


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