當前位置: 首頁>>代碼示例>>Java>>正文


Java Display.getBounds方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Display.getBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.getBounds方法的具體用法?Java Display.getBounds怎麽用?Java Display.getBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Display的用法示例。


在下文中一共展示了Display.getBounds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: StartupSplashShell

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
 * create the startup splash shell and display it
 * @param display
 */
public StartupSplashShell(Display display){
	shell = new Shell(display, SWT.NO_TRIM);
	
	setupShell(); 				// place components in the main avoCADo shell
	
	shell.setText("avoCADo");
	shell.setBackgroundImage(ImageUtils.getIcon("./avoCADo-Splash.jpg", 360, 298));
	shell.setSize(360, 298);	//TODO: set intial size to last known size
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-360)/2);
	int yPos = Math.max(0, (b.height-298)/2);
	shell.setLocation(xPos, yPos);
	shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
	shell.open();
	
	// handle events while the shell is not disposed
	//while (!shell.isDisposed()) {
	//	if (!display.readAndDispatch())
	//		display.sleep();
	//}
}
 
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:26,代碼來源:StartupSplashShell.java

示例2: AboutAvoCADoGPLShell

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
 * create the startup splash shell and display it
 * @param display
 */
public AboutAvoCADoGPLShell(Display display){
	shell = new Shell(display, SWT.PRIMARY_MODAL);
	
	setupShell(); 				// place components in the avoCADo license shell
	
	shell.setText("avoCADo GPLv2");
	shell.setSize(583, 350);	//TODO: set initial size to last known size
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-583)/2);
	int yPos = Math.max(0, (b.height-350)/2);
	shell.setLocation(xPos, yPos);
	shell.open();
	
	// handle events while the shell is not disposed
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
}
 
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:24,代碼來源:AboutAvoCADoGPLShell.java

示例3: MainAvoCADoShell

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
 * create the main avoCADo shell and display it
 * @param display
 */
public MainAvoCADoShell(Display display){
	shell = new Shell(display);
	
	setupShell(); 				// place components in the main avoCADo shell
	
	shell.setText("avoCADo");
	shell.setSize(800, 600);	//TODO: set intial size to last known size
	shell.setMinimumSize(640, 480);
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-800)/2);
	int yPos = Math.max(0, (b.height-600)/2);
	shell.setLocation(xPos, yPos);
	shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
	shell.open();
	
	AvoGlobal.intializeNewAvoCADoProject(); // initialize app to starting model/view.
	
	StartupSplashShell.closeSplash();
			
	// handle events while the shell is not disposed
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
}
 
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:30,代碼來源:MainAvoCADoShell.java


注:本文中的org.eclipse.swt.widgets.Display.getBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。