当前位置: 首页>>代码示例>>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;未经允许,请勿转载。