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();
}
Sleak.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:pentaho-kettle
作者:
评论列表
文章目录