void refreshLabel() {
@SuppressWarnings("unused")
int colors = 0, cursors = 0, fonts = 0, gcs = 0, images = 0, regions = 0;
for (int i = 0; i < objects.length; i++) {
Object object = objects[i];
if (object instanceof Color) colors++;
if (object instanceof Cursor) cursors++;
if (object instanceof Font) fonts++;
if (object instanceof GC) gcs++;
if (object instanceof Image) images++;
if (object instanceof Region) regions++;
}
String string = "";
if (colors != 0) string += colors + " Color(s)\n";
if (cursors != 0) string += cursors + " Cursor(s)\n";
if (fonts != 0) string += fonts + " Font(s)\n";
if (gcs != 0) string += gcs + " GC(s)\n";
if (images != 0) string += images + " Image(s)\n";
/* Currently regions are not counted. */
// if (regions != 0) string += regions + " Region(s)\n";
if (string.length() != 0) {
string = string.substring(0, string.length() - 1);
}
label.setText(string);
}
Sleak.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:swtknob
作者:
评论列表
文章目录