java gtk_Java Util.isGtk方法代码示例

import org.eclipse.jface.util.Util; //导入方法依赖的package包/类

private Shell createLoadingShell() {

final Shell shell = new Shell(SWT.NO_TRIM);

shell.setLayout(new FormLayout());

shell.setMinimumSize(backgroundWidth, backgroundHeight);

shell.setSize(backgroundWidth, backgroundHeight);

Image background = IconLoader.loadIconNormal("loading");

Label lblTitle = new Label(shell, SWT.TRANSPARENT);

lblTitle.setFont(FontSize.getThisFontInNewSize(lblTitle.getFont(), 24, SWT.BOLD));

FormData fd_lblTitle = new FormData();

fd_lblTitle.top = new FormAttachment(0, 0);

fd_lblTitle.left = new FormAttachment(0, 10);

fd_lblTitle.right = new FormAttachment(100, -10);

lblTitle.setLayoutData(fd_lblTitle);

lblTitle.setText("Loading");

progressBar = new ProgressBar(shell, SWT.NONE);

progressBar.setMaximum(expectedMessageCount);

progressBar.setMinimum(0);

progressBar.setSelection(0);

FormData fd_progressBar = new FormData();

fd_progressBar.bottom = new FormAttachment(100, -10);

fd_progressBar.left = new FormAttachment(0, 10);

fd_progressBar.right = new FormAttachment(100, -10);

progressBar.setLayoutData(fd_progressBar);

lblAction = new Text(shell, SWT.WRAP | SWT.TRANSPARENT);

lblAction.setEditable(false);

FormData fd_lblAction = new FormData();

fd_lblAction.top = new FormAttachment(progressBar, -60);

fd_lblAction.bottom = new FormAttachment(progressBar, -10);

fd_lblAction.left = new FormAttachment(0, 10);

fd_lblAction.right = new FormAttachment(100, -200);

lblAction.setLayoutData(fd_lblAction);

lblAction.setText("Starting...");

if (!Util.isGtk()) {

shell.setBackgroundImage(background);

shell.setBackgroundMode(SWT.INHERIT_FORCE);

lblTitle.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));

lblAction.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));

}

shell.setSize(background.getBounds().x, background.getBounds().y);

shell.setLocation(getMonitorCenter(shell));

return shell;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值