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


Java Display.readAndDispatch方法代碼示例

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


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

示例1: 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, 400);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    final ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    //frame.setDisplayToolTips(false);
    frame.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,代碼來源:SWTPieChartDemo1.java

示例2: 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

示例3: runEventLoop

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
private void runEventLoop(Shell loopShell) {
	Display display;
	if (getShell() == null) {
		display = Display.getCurrent();
	} else {
		display = loopShell.getDisplay();
	}

	while (loopShell != null && !loopShell.isDisposed()) {
		try {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		} catch (Throwable e) {
			EclipseUtil.logError("UI problems on dispatch",e);
		}
	}
	if (!display.isDisposed()) {
		display.update();
	}
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:22,代碼來源:AbstractQuickDialog.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 ) 
{
    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

示例5: 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

示例6: 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

示例7: 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

示例8: main

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
public static void main(String args[]) {
    OpenCVUtils.loadLibrary();

    try {
        Display display = Display.getDefault();
        Interface shell = new Interface(display);
        shell.open();
        shell.layout();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:nbfontana,項目名稱:pdi,代碼行數:18,代碼來源:Interface.java

示例9: launch

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
/**
 * Launch SwtAppleCommander with a given display.
 * Primary motivation is getting S-Leak to work!
 */
public void launch(Display display) {
	imageManager = new ImageManager(display);
	SwtAppleCommander application = new SwtAppleCommander();
	Shell shell = application.open(display);
	shell.forceActive();
	
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	
	UserPreferences.getInstance().save();
}
 
開發者ID:marvinmalkowskijr,項目名稱:applecommander,代碼行數:17,代碼來源:SwtAppleCommander.java

示例10: 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

示例11: open

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
public void open() {
	// Create the dialog window
	Shell shell = new Shell(getParent(), getStyle());
	shell.setText(getText());
	createContents(shell);
	shell.pack();
	shell.open();
	Display display = getParent().getDisplay();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
開發者ID:juanerasmoe,項目名稱:pmTrans,代碼行數:15,代碼來源:AboutDialog.java

示例12: 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

示例13: main

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
public static void main(String[] args) {
  // create a shell...
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.setLayout(new FillLayout());
  shell.setText("KTable examples");

  // put a tab folder in it...
  TabFolder tabFolder = new TabFolder(shell, SWT.NONE);

  // Item 1: a Text Table
  TabItem item1 = new TabItem(tabFolder, SWT.NONE);
  item1.setText("Text Table");
  Composite comp1 = new Composite(tabFolder, SWT.NONE);
  item1.setControl(comp1);
  comp1.setLayout(new FillLayout());

  // put a table in tabItem1...
  KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
  table.setRowSelectionMode(true);
  //table.setMultiSelectionMode(true);
  table.setModel(new KTableModelExample());

  // display the shell...
  shell.setSize(600, 600);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
      display.sleep();
  }
  display.dispose();
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,代碼來源:KTable.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: open

import org.eclipse.swt.widgets.Display; //導入方法依賴的package包/類
public Object open(String exlplain, String version) {
	createContents(exlplain, version);
	aboutToolsShell.open();
	aboutToolsShell.layout();
	Display display = getParent().getDisplay();

	while (!aboutToolsShell.isDisposed()) {
		if (!display.readAndDispatch()) {
			display.sleep();
		}
	}
	return result;
}
 
開發者ID:cnldw,項目名稱:APITools,代碼行數:14,代碼來源:AboutTools.java


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