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


Java DeviceData类代码示例

本文整理汇总了Java中org.eclipse.swt.graphics.DeviceData的典型用法代码示例。如果您正苦于以下问题:Java DeviceData类的具体用法?Java DeviceData怎么用?Java DeviceData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的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

示例2: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的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();
    Example1.main(display, new String[0]);
    Example1.dispose();
    Example1.main(display, new String[0]);
    Example1.dispose();
    Example1.main(display, new String[0]);
    Example1.dispose();
    Example1.main(display, new String[0]);

    sleak.loop();
}
 
开发者ID:prasser,项目名称:swtknob,代码行数:17,代码来源:Sleak.java

示例3: refreshDifference

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
void refreshDifference () {
	DeviceData info = display.getDeviceData ();
	if (!info.tracking) {
		MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK);
		dialog.setText (shell.getText ());
		dialog.setMessage ("Warning: Device is not tracking resource allocation"); //$NON-NLS-1$
		dialog.open ();
	}
	Object [] newObjects = info.objects;
	Error [] newErrors = info.errors;
	Object [] diffObjects = new Object [newObjects.length];
	Error [] diffErrors = new Error [newErrors.length];
	int count = 0;
	for (int i=0; i<newObjects.length; i++) {
		int index = 0;
		while (index < oldObjects.length) {
			if (newObjects [i] == oldObjects [index]) break;
			index++;
		}
		if (index == oldObjects.length) {
			diffObjects [count] = newObjects [i];
			diffErrors [count] = newErrors [i];
			count++;
		}
	}
	objects = new Object [count];
	errors = new Error [count];
	System.arraycopy (diffObjects, 0, objects, 0, count);
	System.arraycopy (diffErrors, 0, errors, 0, count);
	list.removeAll ();
	text.setText (""); //$NON-NLS-1$
	canvas.redraw ();
	for (int i=0; i<objects.length; i++) {
		list.add (objectName (objects [i]));
	}
	refreshLabel ();
	layout ();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:39,代码来源:Sleak.java

示例4: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	DeviceData data = new DeviceData();
	data.tracking = true;
	Display display = new Display(data);
	Sleak sleak = new Sleak();
	Shell shell = new Shell(display);
	shell.setText("S-Leak");
	Point size = shell.getSize();
	shell.setSize(size.x / 2, size.y / 2);
	sleak.create(shell);
	shell.open();

	// Launch your application here
	// e.g.
	// DocPageViewer.main(null);
	TrpMainWidget.show(display);

	// Shell shell = new Shell(display);
	// Button button1 = new Button(shell, SWT.PUSH);
	// button1.setBounds(10, 10, 100, 50);
	// button1.setText("Hello World");
	// Image image = new Image(display, 20, 20);
	// Button button2 = new Button(shell, SWT.PUSH);
	// button2.setBounds(10, 70, 100, 50);
	// button2.setImage(image);
	// shell.open();

	// while (!shell.isDisposed ()) {
	// if (!display.readAndDispatch ()) display.sleep ();
	// }
	// display.dispose ();
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:33,代码来源:Sleak.java

示例5: show

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void show() {
	ProgramInfo info = new ProgramInfo();
	Display.setAppName(info.getName());
	Display.setAppVersion(info.getVersion());
	
	DeviceData data = new DeviceData();

	data.tracking = shouldITrack();
	logger.info("resource tracking = "+data.tracking);
	
	Display display = new Display(data);

	show(display);
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:15,代码来源:TrpMainWidget.java

示例6: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void main(String[] args) {
		DeviceData data = new DeviceData();
		data.tracking = true;

		Display display = new Display(data);
		Shell shell = new Shell(display);
		shell.open();
		
//		String fn = Display.getCurrent().getSystemFont().getFontData()[0].getName();
//		System.out.println(fn);
//		if (true)
//			return;

		// run the event loop as long as the window is open
		while (!shell.isDisposed()) {
		    // read the next OS event queue and transfer it to a SWT event
		        if (!display.readAndDispatch())
		         {
		        	
		        	try {
						SWTUtil.testHandleLimit((int)1e6);
					} catch (Exception e) {
						e.printStackTrace();
					}
		        	
		        	if (true)
		        		break;

		        // if there are currently no other OS event to process
		        // sleep until the next OS event is available
		                display.sleep();
		         }
		}

		// disposes all associated windows and their components
		display.dispose();		

		System.out.println("--- DONE ---");
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:40,代码来源:TestHandles.java

示例7: refreshDifference

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
void refreshDifference() {
	DeviceData info = display.getDeviceData();
	if (!info.tracking) {
		MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
		dialog.setText(shell.getText());
		dialog
		.setMessage("Warning: Device is not tracking resource allocation");
		dialog.open();
	}
	Object[] newObjects = info.objects;
	Error[] newErrors = info.errors;
	Object[] diffObjects = new Object[newObjects.length];
	Error[] diffErrors = new Error[newErrors.length];
	int count = 0;
	for (int i = 0; i < newObjects.length; i++) {
		int index = 0;
		while (index < oldObjects.length) {
			if (newObjects[i] == oldObjects[index])
				break;
			index++;
		}
		if (index == oldObjects.length) {
			diffObjects[count] = newObjects[i];
			diffErrors[count] = newErrors[i];
			count++;
		}
	}
	objects = new Object[count];
	errors = new Error[count];
	System.arraycopy(diffObjects, 0, objects, 0, count);
	System.arraycopy(diffErrors, 0, errors, 0, count);
	list.removeAll();
	text.setText("");
	canvas.redraw();
	for (int i = 0; i < objects.length; i++) {
		list.add(objectName(objects[i]));
	}
	refreshLabel();
	layout();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:41,代码来源:Sleak.java

示例8: refreshDifference

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
void refreshDifference() {
    DeviceData info = display.getDeviceData();
    if (!info.tracking) {
        MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
        dialog.setText(shell.getText());
        dialog.setMessage("Warning: Device is not tracking resource allocation");
        dialog.open();
    }
    Object[] newObjects = info.objects;
    Error[] newErrors = info.errors;
    Object[] diffObjects = new Object[newObjects.length];
    Error[] diffErrors = new Error[newErrors.length];
    int count = 0;
    for (int i = 0; i < newObjects.length; i++) {
        int index = 0;
        while (index < oldObjects.length) {
            if (newObjects[i] == oldObjects[index]) break;
            index++;
        }
        if (index == oldObjects.length) {
            diffObjects[count] = newObjects[i];
            diffErrors[count] = newErrors[i];
            count++;
        }
    }
    objects = new Object[count];
    errors = new Error[count];
    System.arraycopy(diffObjects, 0, objects, 0, count);
    System.arraycopy(diffErrors, 0, errors, 0, count);
    list.removeAll();
    text.setText("");
    canvas.redraw();
    for (int i = 0; i < objects.length; i++) {
        list.add(objectName(objects[i]));
    }
    refreshLabel();
    layout();
}
 
开发者ID:prasser,项目名称:swtknob,代码行数:39,代码来源:Sleak.java

示例9: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void main (String [] args) {
	DeviceData data = new DeviceData();
	data.tracking = true;
	Display display = new Display (data);
	Sleak sleak = new Sleak ();
	Shell shell = new Shell(display);
	shell.setText ("S-Leak");
	Point size = shell.getSize ();
	shell.setSize (size.x / 2, size.y / 2);
	sleak.create (shell);
	shell.open();
	
	// Launch your application here
	// e.g.		
//	Shell shell = new Shell(display);
//	Button button1 = new Button(shell, SWT.PUSH);
//	button1.setBounds(10, 10, 100, 50);
//	button1.setText("Hello World");
//	Image image = new Image(display, 20, 20);
//	Button button2 = new Button(shell, SWT.PUSH);
//	button2.setBounds(10, 70, 100, 50);
//	button2.setImage(image);
//	shell.open();
	
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:30,代码来源:Sleak.java

示例10: refreshDifference

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
void refreshDifference () {
	Display display = canvas.getDisplay();
	DeviceData info = display.getDeviceData ();
	if (!info.tracking) {
		Shell shell = canvas.getShell();
		MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK);
		dialog.setText (shell.getText ());
		dialog.setMessage ("Warning: Device is not tracking resource allocation");
		dialog.open ();
	}
	Object [] newObjects = info.objects;
	Error [] newErrors = info.errors;
	Object [] diffObjects = new Object [newObjects.length];
	Error [] diffErrors = new Error [newErrors.length];
	int count = 0;
	for (int i=0; i<newObjects.length; i++) {
		int index = 0;
		while (index < oldObjects.length) {
			if (newObjects [i] == oldObjects [index]) break;
			index++;
		}
		if (index == oldObjects.length) {
			diffObjects [count] = newObjects [i];
			diffErrors [count] = newErrors [i];
			count++;
		}
	}
	objects = new Object [count];
	errors = new Error [count];
	System.arraycopy (diffObjects, 0, objects, 0, count);
	System.arraycopy (diffErrors, 0, errors, 0, count);
	list.removeAll ();
	text.setText ("");
	canvas.redraw ();
	for (int i=0; i<objects.length; i++) {
		list.add (objects [i].toString());
	}
	refreshLabel ();
	layout ();
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:41,代码来源:Sleak.java

示例11: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void main(String[] args)
{
	boolean showLeaks = false;
	if (args.length >= 1 && args[0].equalsIgnoreCase("--show-leaks"))
		showLeaks = true;

	DeviceData data = new DeviceData();
	data.tracking = showLeaks;
	Display display = new Display(data);

	Dance dance = new Dance();
	Shell shell = dance.open(display);
	
	Pattern pattern = new Pattern();
	dance.setPattern(pattern);

	while (!shell.isDisposed())
	{
		if (!display.readAndDispatch())
			display.sleep();
	}

	if (showLeaks)
	{
		Sleak sleak = new Sleak();
		sleak.open();
		while (!sleak.shell.isDisposed())
		{
			if (!display.readAndDispatch())
				display.sleep();
		}
	}

	display.dispose();
}
 
开发者ID:sba1,项目名称:simpledance,代码行数:36,代码来源:SimpleDance.java

示例12: main

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
public static void main( String[] args ) {
  DeviceData data = new DeviceData();
  data.tracking = true;
  Display display = new Display( data );
  Sleak sleak = new Sleak();
  Shell shell = new Shell( display );
  shell.setText( "S-Leak" );
  Point size = shell.getSize();
  shell.setSize( size.x / 2, size.y / 2 );
  sleak.create( shell );
  shell.open();

  // Launch your application here
  // e.g.
  // Shell shell = new Shell(display);
  // Button button1 = new Button(shell, SWT.PUSH);
  // button1.setBounds(10, 10, 100, 50);
  // button1.setText("Hello World");
  // Image image = new Image(display, 20, 20);
  // Button button2 = new Button(shell, SWT.PUSH);
  // button2.setBounds(10, 70, 100, 50);
  // button2.setImage(image);
  // shell.open();

  while ( !shell.isDisposed() ) {
    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  display.dispose();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:32,代码来源:Sleak.java

示例13: setup

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
@Before
public void setup() throws Exception {
  if (Display.getCurrent() != null) Display.getCurrent().dispose();
  DeviceData data = new DeviceData();
  data.tracking = true;
  display = new Display(data);
  shell = new Shell(display);
}
 
开发者ID:ReadyTalk,项目名称:swt-bling,代码行数:9,代码来源:FontFactoryTest.java

示例14: refreshDifference

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
void refreshDifference () {
  DeviceData info = display.getDeviceData ();
  if (!info.tracking) {
    MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK);
    dialog.setText (shell.getText ());
    dialog.setMessage ("Warning: Device is not tracking resource allocation");
    dialog.open ();
  }
  Object [] newObjects = info.objects;
  Error [] newErrors = info.errors;
  Object [] diffObjects = new Object [newObjects.length];
  Error [] diffErrors = new Error [newErrors.length];
  int count = 0;
  for (int i=0; i<newObjects.length; i++) {
    int index = 0;
    while (index < oldObjects.length) {
      if (newObjects [i] == oldObjects [index]) break;
      index++;
    }
    if (index == oldObjects.length) {
      diffObjects [count] = newObjects [i];
      diffErrors [count] = newErrors [i];
      count++;
    }
  }
  objects = new Object [count];
  errors = new Error [count];
  System.arraycopy (diffObjects, 0, objects, 0, count);
  System.arraycopy (diffErrors, 0, errors, 0, count);
  list.removeAll ();
  text.setText ("");
  canvas.redraw ();
  for (int i=0; i<objects.length; i++) {
    list.add (objectName (objects [i]));
  }
  refreshLabel ();
  layout ();
}
 
开发者ID:ReadyTalk,项目名称:swt-bling,代码行数:39,代码来源:Sleak.java

示例15: createDisplay

import org.eclipse.swt.graphics.DeviceData; //导入依赖的package包/类
private static Display createDisplay(boolean debug) {
  Display display;
  if (debug) {
    DeviceData data = new DeviceData();
    data.tracking = true;
    display = new Display(data);
  } else {
    display = new Display();
  }

  return display;
}
 
开发者ID:ReadyTalk,项目名称:swt-bling,代码行数:13,代码来源:Examples.java


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