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


Java Shell.setImage方法代码示例

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


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

示例1: StartupSplashShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的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: MainAvoCADoShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的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

示例3: open

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
/**
 * Setup the Disk window and display (open) it.
 */
public void open() {
	shell = new Shell(parentShell, SWT.SHELL_TRIM);
	shell.setLayout(new FillLayout());
	shell.setImage(imageManager.get(ImageManager.ICON_DISK));
	setStandardWindowTitle();
	shell.addDisposeListener(new DisposeListener() {
			public void widgetDisposed(DisposeEvent event) {
				dispose(event);
			}
		});
		
	CTabFolder tabFolder = new CTabFolder(shell, SWT.BOTTOM);
	new DiskExplorerTab(tabFolder, disks, imageManager, this);
	diskMapTabs = new DiskMapTab[disks.length];
	for (int i=0; i<disks.length; i++) {
		if (disks[i].supportsDiskMap()) {
			diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
		}
	}
	diskInfoTab = new DiskInfoTab(tabFolder, disks);
	tabFolder.setSelection(tabFolder.getItems()[0]);
	
	
	shell.open();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:29,代码来源:DiskWindow.java

示例4: createContents

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
private void createContents(String str) {
	aboutToolsShell = new Shell(getParent(), getStyle());
	aboutToolsShell.setImage(SWTResourceManager.getImage(ShortcutKeyExplain.class, Resource.IMAGE_ICON));
	aboutToolsShell.setSize(400, 391);
	aboutToolsShell.setText(getText());
	PubUtils.setCenterinParent(getParent(), aboutToolsShell);

	Link link = new Link(aboutToolsShell, SWT.NONE);
	link.setBounds(143, 336, 108, 17);
	link.setText("<a>www.itlaborer.com</a>");
	link.addSelectionListener(new LinkSelection());

	StyledText readMeTextLabel = new StyledText(aboutToolsShell,
			SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
	readMeTextLabel.setBounds(3, 33, 389, 297);
	readMeTextLabel.setText(str);

	Label label_2 = new Label(aboutToolsShell, SWT.NONE);
	label_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微软雅黑", 9, SWT.BOLD));
	label_2.setText("快捷键说明:");
	label_2.setBounds(3, 12, 136, 17);
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:23,代码来源:ShortcutKeyExplain.java

示例5: configureShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);		
	String imagePath = null;
	//TODO Please uncomment below code before build.
	try{
		newShell.setImage(ImagePathConstant.APP_ICON.getImageFromRegistry());
		if(OSValidator.isMac()){
			newShell.setMinimumSize(new Point(500, 500));
		}else{
			newShell.setMinimumSize(new Point(500, 525));
		}

	}catch(SWTError e){
		logger.debug("Unable to access image" , e);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:PropertyDialog.java

示例6: createDialogArea

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
/**
 * Create contents of the dialog.
 * @param parent
 */

@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	
	Shell shell=container.getShell();
	shell.setText("View Transform");
	shell.setImage(ImagePathConstant.APP_ICON.getImageFromRegistry());
	
	CoolBar coolBar = new CoolBar(container, SWT.FLAT);
	coolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	 CoolItem buttonItem = new CoolItem(coolBar, SWT.NONE | SWT.DROP_DOWN);
	  Composite buttonComposite = new Composite(coolBar, SWT.NONE);
	  buttonComposite.setLayout(new GridLayout(3, false));
	 
	  	createWrapButton(buttonComposite);

	    createCopyButton(buttonComposite);
	    
	    buttonComposite.pack();

	    Point size = buttonComposite.getSize();
	    buttonItem.setControl(buttonComposite);
	    buttonItem.setSize(buttonItem.computeSize(size.x, size.y));

	    createStyleTextEditor(container);
	
		getShell().setMinimumSize(290,290);
		return container;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:TransformViewDataDialog.java

示例7: configureShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText("Link Analysis and Target Project");
	InputStream in = getClass().getResourceAsStream("/icons/Link.png");
	newShell.setImage(new org.eclipse.swt.graphics.Image(newShell.getDisplay(), in));
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:8,代码来源:TargetHandlerDialog.java

示例8: configureShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText("Set custom attributes");
	InputStream in = getClass().getClassLoader().getResourceAsStream("/icons/sample.gif");
	newShell.setImage(new Image(newShell.getDisplay(), in));

}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:9,代码来源:Attribute.java

示例9: configureShell

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
@Override
protected void configureShell(Shell shell) {
	shell.setText("Schema Viewer Preferences");
	shell.setImage(AvroSchemaEditorActivator.getImage(AvroSchemaEditorImages.CONFIGURE));		
	shell.setBounds(bounds);
	super.configureShell(shell);
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:8,代码来源:SchemaViewerPreferencesDialog.java

示例10: createContents

import org.eclipse.swt.widgets.Shell; //导入方法依赖的package包/类
private void createContents(String exlplain, String version) {
	aboutToolsShell = new Shell(getParent(), getStyle());
	aboutToolsShell.setImage(SWTResourceManager.getImage(AboutTools.class, Resource.IMAGE_ICON));
	aboutToolsShell.setSize(400, 391);
	aboutToolsShell.setText(getText());
	PubUtils.setCenterinParent(getParent(), aboutToolsShell);

	Label copyRightlabel = new Label(aboutToolsShell, SWT.CENTER);
	copyRightlabel.setBounds(10, 311, 375, 17);
	copyRightlabel.setText(Resource.AUTHOR);

	Link link = new Link(aboutToolsShell, SWT.NONE);
	link.setBounds(143, 336, 108, 17);
	link.setText("<a>www.itlaborer.com</a>");
	link.addSelectionListener(new LinkSelection());

	Label versionLabel = new Label(aboutToolsShell, SWT.NONE);
	versionLabel.setAlignment(SWT.CENTER);
	versionLabel.setBounds(156, 288, 82, 17);
	versionLabel.setText(version);

	StyledText readMeTextLabel = new StyledText(aboutToolsShell,
			SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
	readMeTextLabel.setBounds(3, 33, 389, 114);
	readMeTextLabel.setText(exlplain);

	StyledText lblgplV = new StyledText(aboutToolsShell, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
	lblgplV.setText(
			"Copyright itlaborer.com\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.");
	lblgplV.setBounds(3, 176, 389, 106);

	Label label_1 = new Label(aboutToolsShell, SWT.NONE);
	label_1.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微软雅黑", 9, SWT.BOLD));
	label_1.setText("Apache License:");
	label_1.setBounds(3, 155, 136, 17);

	Label label_2 = new Label(aboutToolsShell, SWT.NONE);
	label_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微软雅黑", 9, SWT.BOLD));
	label_2.setText("软件说明:");
	label_2.setBounds(3, 12, 136, 17);
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:42,代码来源:AboutTools.java


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