当前位置: 首页>>代码示例>>Java>>正文


Java Display.sleep方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Display.sleep方法的典型用法代码示例。如果您正苦于以下问题:Java Display.sleep方法的具体用法?Java Display.sleep怎么用?Java Display.sleep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Display的用法示例。


在下文中一共展示了Display.sleep方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AboutAvoCADoGPLShell

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * create the startup splash shell and display it
 * @param display
 */
public AboutAvoCADoGPLShell(Display display){
	shell = new Shell(display, SWT.PRIMARY_MODAL);
	
	setupShell(); 				// place components in the avoCADo license shell
	
	shell.setText("avoCADo GPLv2");
	shell.setSize(583, 350);	//TODO: set initial size to last known size
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-583)/2);
	int yPos = Math.max(0, (b.height-350)/2);
	shell.setLocation(xPos, yPos);
	shell.open();
	
	// handle events while the shell is not disposed
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:24,代码来源:AboutAvoCADoGPLShell.java

示例2: MainAvoCADoShell

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * create the main avoCADo shell and display it
 * @param display
 */
public MainAvoCADoShell(Display display){
	shell = new Shell(display);
	
	setupShell(); 				// place components in the main avoCADo shell
	
	shell.setText("avoCADo");
	shell.setSize(800, 600);	//TODO: set intial size to last known size
	shell.setMinimumSize(640, 480);
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-800)/2);
	int yPos = Math.max(0, (b.height-600)/2);
	shell.setLocation(xPos, yPos);
	shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
	shell.open();
	
	AvoGlobal.intializeNewAvoCADoProject(); // initialize app to starting model/view.
	
	StartupSplashShell.closeSplash();
			
	// handle events while the shell is not disposed
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:30,代码来源:MainAvoCADoShell.java

示例3: openShell

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void openShell(String format, int weight, int height, Function<Shell, Control> function) {

    Display display = new Display();

    Shell shell = new Shell(display);

    shell.setSize(weight, height);
    shell.setLayout(new FillLayout());

    function.apply(shell);

    shell.open();

    while(!shell.isDisposed()) {
      if(!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:21,代码来源:SWTTestUtil.java

示例4: main

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main( String[] args ) 
{
    JFreeChart chart = createChart(createDataset());
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 300);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    final ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart,
            true);
    frame.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:SWTBarChartDemo1.java

示例5: main

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main (String [] args) {
	DeviceData data = new DeviceData();
	data.tracking = true;
	Display display = new Display (data);
	Sleak sleak = new Sleak ();
	sleak.open ();

	// Launch your application here
	SwtAppleCommander ac = new SwtAppleCommander();
	ac.launch(display);
	// End of AC code...	
	
	while (!sleak.shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:18,代码来源:Sleak.java

示例6: main

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main( String[] args ) 
{
    final JFreeChart chart = createChart();
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 300);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    frame.setDisplayToolTips(false);
    frame.setHorizontalAxisTrace(true);
    frame.setVerticalAxisTrace(true);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:SWTMultipleAxisDemo1.java

示例7: open

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public Object open() {
	createContents();
	md5ToolsShell.open();
	md5ToolsShell.layout();
	Display display = getParent().getDisplay();
	while (!md5ToolsShell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return result;
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:13,代码来源:MD5Tools.java

示例8: open

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Open the dialog.
 * 
 * @return the result
 */
public Object open() {
	createContents();
	shell.open();
	shell.layout();
	Display display = getParent().getDisplay();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return result;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:CommentBoxEditor.java

示例9: main

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);

	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);

	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);

	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));

	createDiagram(root);

	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);

	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:33,代码来源:TestFigure.java

示例10: waitUntilClosed

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void waitUntilClosed() {
	Display display = shell.getDisplay();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:9,代码来源:SimpleBrowserWindow.java

示例11: PmTrans

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private PmTrans(GlobalKeyListener gkl) {
	// Initialize the interface
	d = new Display();
	shell = new Shell(d);
	menuManager = new MenuManager(shell, this);
	barManager = new BarManager(shell, this);

	// Global keys
	this.gKL = gkl;

	initState();
	initGui();
	startAutoSave();

	shell.open();

	while (!shell.isDisposed())
		if (!d.readAndDispatch())
			d.sleep();

	if (player != null) {
		player.close();
		player = null;
	}
	GlobalScreen.unregisterNativeHook();
	saveState();
	try {
		Config.getInstance().save();
	} catch (IOException e) {
		// ignore
	}
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:33,代码来源:PmTrans.java

示例12: open

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Open the dialog.
 * 
 * @return the result
 */
public Object[] open(String serverAddress) {
	this.serverAddress = serverAddress;
	createContents();
	shell.open();
	shell.layout();
	Display display = getParent().getDisplay();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return (new Object[] { saveFlag, name, description, path });
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:19,代码来源:CreateCollectionDialog.java

示例13: open

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public Object open() {
	createContents();
	unicodeToolsShell.open();
	unicodeToolsShell.layout();
	Display display = getParent().getDisplay();
	while (!unicodeToolsShell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return result;
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:13,代码来源:UnicodeTools.java

示例14: open

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Open the dialog.
 * 
 * @return the result
 */
public Object[] open(String requestCharset, String responseCharSet) {
	this.requestCharSet = requestCharset;
	this.responseCharSet = responseCharSet;
	createContents();
	shell.open();
	shell.layout();
	Display display = getParent().getDisplay();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return (new Object[] { saveFlag, this.requestCharSet, this.responseCharSet });
}
 
开发者ID:cnldw,项目名称:APITools,代码行数:20,代码来源:CharSetDialog.java

示例15: main

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);
	
	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);
	
	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);
	
	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	MatrixWidget widget = new MatrixWidget();
	MockArray array = new MockArray("int[]", new int[]{1,2,3}, new int[]{4,5,6}, new int[]{7,8,9}, new int[]{10,11,12});
	root.add(widget.createFigure(array));
	
	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);
	
	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:35,代码来源:TestMatrixWidget.java


注:本文中的org.eclipse.swt.widgets.Display.sleep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。