當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressBar.setMinimum方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.ProgressBar.setMinimum方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressBar.setMinimum方法的具體用法?Java ProgressBar.setMinimum怎麽用?Java ProgressBar.setMinimum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.setMinimum方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fill

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
public void fill(Composite parent) {
	super.fill(parent);
	Composite container = new Composite(parent, SWT.NONE);
	GridLayout gl = new GridLayout(2, false);
	gl.marginWidth = 5;
	gl.marginHeight = 3;
	container.setLayout(gl);

	progressBar = new ProgressBar(container, SWT.SMOOTH);
	GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
	gdPprogressBar.heightHint = 16;
	gdPprogressBar.widthHint = 130;
	progressBar.setLayoutData(gdPprogressBar);
	progressBar.setMinimum(0); // 最小值
	progressBar.setMaximum(100);// 最大值
	progressBar.setSelection(progressValue);
	progressBar.setToolTipText(defaultMessage);

	label = new Label(container, SWT.None);
	label.setText(progressValue + "%");

	StatusLineLayoutData data = new StatusLineLayoutData();
	container.setLayoutData(data);
}
 
開發者ID:heartsome,項目名稱:tmxeditor8,代碼行數:25,代碼來源:XLIFFEditorStatusLineItemWithProgressBar.java

示例2: 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();
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:16,代碼來源:ProgressBarWindow.java

示例3: addProgressBar

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
private static void addProgressBar(int index, String key, int count) {
    Table table = tableViewerCase.getTable();
    TableItem ti = table.getItem(index);
    ProgressBar bar = new ProgressBar(table, SWT.HORIZONTAL | SWT.SMOOTH);
    bar.setSelection(0);
    bar.setMinimum(0);
    bar.setMaximum(count);
    TableEditor tabEditor = new TableEditor(table);
    tabEditor.grabHorizontal = editor.grabVertical = true;
    tabEditor.setEditor(bar, ti, 3);

    htProgress.put(key, bar);
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:14,代碼來源:AndroidRobot.java

示例4: 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();
}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:14,代碼來源:ExcelExportProgessBar.java

示例5: createProgressComposite

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
/*******************************************************
 * Creates the progress bar composite. This will help the user know that the
 * tool is working and making progress
 * 
 * @param parent
 *            The parent composite
 *******************************************************/
private void createProgressComposite(Composite parent)
{
	// The container of this group
	Composite progressComp = new Composite(parent, SWT.BORDER);
	progressComp.setLayout(new GridLayout(1, true));
	progressComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	// The label to tell the user about the current state
	Label label = new Label(progressComp, SWT.NONE);
	label.setText("Testing ...");
	label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

	// The progress bar
	ProgressBar progBar = new ProgressBar(progressComp, SWT.NONE);
	progBar.setMaximum(100);
	progBar.setMinimum(0);
	progBar.setSelection(0);
	progBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	// Initially hide them
	label.setVisible(false);
	progBar.setVisible(false);

	// Create the progress updater
	mProgressUpdater = new ProgressUpdater(progBar, label);
}
 
開發者ID:ArchieProject,項目名稱:Archie-Smart-IDE,代碼行數:34,代碼來源:GraphView.java

示例6: createProgressComposite

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
/*******************************************************
 * Creates the progress bar composite. This will help the user know that the
 * tool is working and making progress
 * 
 * @param parent
 *            The parent composite
 *******************************************************/
private void createProgressComposite(Composite parent)
{
	// The container of this group
	Composite progressComp = new Composite(parent, SWT.BORDER);
	progressComp.setLayout(new GridLayout(1, true));
	progressComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	// The label to tell the user about the current state
	Label label = new Label(progressComp, SWT.NONE);
	label.setText("Testing ...");
	label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	// The progress bar
	ProgressBar progBar = new ProgressBar(progressComp, SWT.NONE);
	progBar.setMaximum(100);
	progBar.setMinimum(0);
	progBar.setSelection(0);
	progBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	// Initially hide them
	label.setVisible(false);
	progBar.setVisible(false);

	// Create the progress updater
	mProgressUpdater = new ProgressUpdater(progBar, label);
}
 
開發者ID:ArchieProject,項目名稱:Archie-Smart-IDE,代碼行數:34,代碼來源:PanoramicTraceView.java

示例7: Splash

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
public Splash(Monitor monitor)
{
  FormData labelData = new FormData();
  labelData.left = new FormAttachment(0, 5);
  labelData.bottom = new FormAttachment(100, -80);

  FormData progressData = new FormData();
  progressData.left = new FormAttachment(0, 5);
  progressData.right = new FormAttachment(100, -5);
  progressData.bottom = new FormAttachment(100, -5);

  shell = new Shell(SWT.ON_TOP);
  shell.setSize(300, 100);
  shell.setLayout(new FormLayout());

  label = new Label(shell, SWT.CENTER);
  label.setText(Localizer.getMessage("INIT"));
  label.setLayoutData(labelData);

  progressBar = new ProgressBar(shell, SWT.HORIZONTAL);
  progressBar.setLayoutData(progressData);
  progressBar.setMinimum(0);
  progressBar.setMaximum(100);
  progressBar.setSelection(0);

  Rectangle splashRect = shell.getBounds();
  Rectangle displayRect = monitor.getBounds();

  int x = ( displayRect.width - splashRect.width ) / 2;
  int y = ( displayRect.height - splashRect.height ) / 2;

  shell.setLocation(x, y);
}
 
開發者ID:terraframe,項目名稱:Runway-SDK,代碼行數:34,代碼來源:Splash.java

示例8: GUIInformationChannel

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
public GUIInformationChannel(AbstractTarget target, Composite parent) {
	super(parent, SWT.BORDER);
	this.parent = parent;
	this.target = target;
	this.setLayout(new FillLayout());
	this.setToolTipText(target.getName());
	Composite grp = this;
	this.setBackground(Colors.C_WHITE);

	GridLayout layout = new GridLayout(4, false);
	layout.horizontalSpacing = 20;
	layout.verticalSpacing = 1;
	layout.marginHeight = 5;
	layout.marginWidth = 5;
	grp.setLayout(layout);

	Label lblIco = new Label(grp, SWT.NONE);
	lblIco.setImage(ArecaImages.ICO_CHANNEL);
	lblIco.setBackground(Colors.C_WHITE);
	
	lblMessage = new Label(grp, SWT.NONE);
	lblMessage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	lblMessage.setForeground(C_INFO);
	lblMessage.setBackground(Colors.C_WHITE);

	btnPause = new Button(grp, SWT.PUSH);
	btnPause.setText(RM.getLabel("mainpanel.pause.label"));
	btnPause.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, false, true, 1, 2));
	btnPause.addListener(SWT.Selection, this);   
	btnPause.setForeground(C_INFO);

	btnCancel = new Button(grp, SWT.PUSH);
	btnCancel.setText(RM.getLabel("common.cancel.label"));
	btnCancel.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, false, true, 1, 2));
	btnCancel.addListener(SWT.Selection, this);   
	btnCancel.setForeground(C_INFO);

	pgbProgress = new ProgressBar(grp, SWT.NONE);
	pgbProgress.setMinimum(0);
	pgbProgress.setMaximum(100);
	pgbProgress.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
	
	this.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	this.setSize(this.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	
	recomputeParentMinimumSize(true);
}
 
開發者ID:chfoo,項目名稱:areca-backup-release-mirror,代碼行數:48,代碼來源:GUIInformationChannel.java

示例9: createLoadingShell

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的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;
}
 
開發者ID:DaveVoorhis,項目名稱:Rel,代碼行數:51,代碼來源:Loading.java

示例10: createPartControl

import org.eclipse.swt.widgets.ProgressBar; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.makeColumnsEqualWidth = true;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    container.setLayout(layout);
    RowLayout rowLayout = new RowLayout();
    rowLayout.spacing = 1;

    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalAlignment = SWT.FILL;
    gridData.verticalAlignment = SWT.FILL;
    
    
    GridData progressLayout = new GridData();
    progressLayout.horizontalAlignment=SWT.FILL;
    
    progressBar=new ProgressBar(container, SWT.SMOOTH | SWT.HORIZONTAL);
    progressBar.setVisible(false);
    progressBar.setLayoutData(progressLayout);
    progressBar.setMinimum(0);
    
    try {
        swtBrowser = new Browser(container, SWT.NONE);
        swtBrowser.setLayoutData(gridData);
        if(targetURL!=null && targetURL.length()>0) {
            oldFocus=Display.getCurrent().getFocusControl();
            
            swtBrowser.setUrl(targetURL);
            
            if(oldFocus.isDisposed()==false) {
                oldFocus.setFocus();
            }
            
            oldFocus=null;
        }
        
        progressListener=new BuildProgressListener(swtBrowser, progressBar);
        swtBrowser.addProgressListener(progressListener);
    } catch (SWTError error) {
        if(progressListener!=null) {
            swtBrowser.removeProgressListener(progressListener);
        }
        
        swtBrowser = null;
        Label label = new Label(container, SWT.WRAP);
        label.setText("SWT Browser control is not available. Please refer to: http://www.eclipse.org/swt/faq.php#whatisbrowser for more information.");
        label.setLayoutData(gridData);
    }
}
 
開發者ID:UndefinedOffset,項目名稱:eclipse-silverstripedt,代碼行數:57,代碼來源:DevBuildViewer.java


注:本文中的org.eclipse.swt.widgets.ProgressBar.setMinimum方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。