本文整理匯總了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();
//}
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
}
示例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;
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}