本文整理汇总了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 ();
}
示例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();
}
示例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 ();
}
示例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 ();
}
示例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);
}
示例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 ---");
}
示例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();
}
示例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();
}
示例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 ();
}
示例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 ();
}
示例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();
}
示例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();
}
示例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);
}
示例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 ();
}
示例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;
}