Sleak.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:AppleCommander 作者:
void refreshLabel () {
    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 = ""; //$NON-NLS-1$
    if (colors != 0) string += colors + " Color(s)\n"; //$NON-NLS-1$
    if (cursors != 0) string += cursors + " Cursor(s)\n"; //$NON-NLS-1$
    if (fonts != 0) string += fonts + " Font(s)\n"; //$NON-NLS-1$
    if (gcs != 0) string += gcs + " GC(s)\n"; //$NON-NLS-1$
    if (images != 0) string += images + " Image(s)\n"; //$NON-NLS-1$
    if (regions != 0) string += regions + " Region(s)\n"; //$NON-NLS-1$
    if (string.length () != 0) {
        string = string.substring (0, string.length () - 1);
    }
    label.setText (string);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号