本文整理汇总了Java中org.eclipse.swt.widgets.ProgressBar.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setBounds方法的具体用法?Java ProgressBar.setBounds怎么用?Java ProgressBar.setBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setBounds方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
shell.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
shell.setSize(450, 146);
windowLocation.dialogLocation(getParent(), shell);
progressBar = new ProgressBar(shell, SWT.NONE);
progressBar.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
progressBar.setBounds(10, 10, 424, 17);
progressBar.setMaximum(100);
label = new Label(shell, SWT.NONE);
label.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
label.setAlignment(SWT.CENTER);
label.setBounds(10, 33, 424, 43);
Button btnNewButton = new Button(shell, SWT.NONE);
btnNewButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
actionWhenOKButtonSelected();
b.ba.progressMessage = "";
b.ba.progressValue = 0;
if(b.ba.progressBugStop){
b.ba.progressBugStop = false;
}
doing.stop();
dispose();
}
});
btnNewButton.setBounds(359, 82, 75, 25);
btnNewButton.setText("\u786E\u5B9A");
}
示例2: Splash
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public Splash(Display display, Rectangle displayRect, boolean showProgress) {
image = new Image(display, getClass().getResourceAsStream("/splash.png"));
shell = new Shell(SWT.ON_TOP);
progressUI = new ProgressBar(shell, SWT.NONE);
progressUI.setMaximum(100);
Label label = new Label(shell, SWT.NONE);
label.setImage(image);
FormLayout layout = new FormLayout();
shell.setLayout(layout);
FormData labelData = new FormData();
labelData.right = new FormAttachment(100, 0);
labelData.bottom = new FormAttachment(100, 0);
label.setLayoutData(labelData);
FormData progressData = new FormData();
progressData.left = new FormAttachment(0, -5);
progressData.right = new FormAttachment(100, 0);
progressData.bottom = new FormAttachment(100, 0);
progressUI.setLayoutData(progressData);
progressUI.setVisible(showProgress);
shell.pack();
Rectangle splashRect = shell.getBounds();
progressUI.setBounds(2, splashRect.height-14, splashRect.width-6, 10);
int x = displayRect.x + (displayRect.width - splashRect.width) / 2;
int y = displayRect.y + (displayRect.height - splashRect.height) / 2;
shell.setLocation(x, y);
shell.open();
setProgress(0);
}
示例3: createContents
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
shell = new Shell(getParent(), getStyle());
shell.setSize(445, 135);
shell.setText("\u8BF7\u7B49\u5F85");
progressBar = new ProgressBar(shell, SWT.HORIZONTAL|SWT.SMOOTH|SWT.INDETERMINATE);
progressBar.setBounds(40, 29, 364, 32);
}
示例4: ProgressBarWindow
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public ProgressBarWindow(Shell shell, String title){
m_shell = new Shell(shell, SWT.TITLE);
m_shell.setText(title);
m_shell.setLayout(new FillLayout());
int [] pos = UIUtil.getScreenSize();
m_shell.setBounds((pos[0]/2)-75, (pos[1]/2)-15, 150, 40);
m_progressBar = new ProgressBar(m_shell, SWT.HORIZONTAL);
m_progressBar.setMinimum(0);
m_progressBar.setMaximum(100);
m_progressBar.setBounds(0, 0, 140, 20);
m_progressBar.setState(SWT.ERROR);
m_shell.open();
}
示例5: open
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public void open(int minValue, int maxValue) {
childShell = new Shell(shell.getDisplay(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
childShell.setText("Exporting to Excel.. please wait");
progressBar = new ProgressBar(childShell, SWT.SMOOTH);
progressBar.setMinimum(minValue);
progressBar.setMaximum(maxValue);
progressBar.setBounds(0, 0, 400, 25);
progressBar.setFocus();
childShell.pack();
childShell.open();
}
示例6: buildAndDisplay
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/**
* Build and display the progress bar
*/
public void buildAndDisplay()
{
addAboveBar();
bar = new ProgressBar(shell, barStyle);
bar.setBounds(20, 10, MULTIPLIER, 15);
addBelowBar();
shell.open();
bar.setMaximum(MULTIPLIER);
}
示例7: createControls
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@PostConstruct
public void createControls(Composite parent) {
progressBar = new ProgressBar(parent, SWT.SMOOTH);
progressBar.setBounds(100, 10, 200, 20);
}