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