Sleak.java 文件源码

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

项目:pentaho-kettle 作者:
void refreshLabel() {
  int colors = 0, cursors = 0, fonts = 0, gcs = 0, images = 0;
  int paths = 0, patterns = 0, regions = 0, textLayouts = 0, transforms = 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 Path ) {
      paths++;
    }
    if ( object instanceof Pattern ) {
      patterns++;
    }
    if ( object instanceof Region ) {
      regions++;
    }
    if ( object instanceof TextLayout ) {
      textLayouts++;
    }
    if ( object instanceof Transform ) {
      transforms++;
    }
  }
  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";
  }
  if ( paths != 0 ) {
    string += paths + " Paths(s)\n";
  }
  if ( patterns != 0 ) {
    string += patterns + " Pattern(s)\n";
  }
  if ( regions != 0 ) {
    string += regions + " Region(s)\n";
  }
  if ( textLayouts != 0 ) {
    string += textLayouts + " TextLayout(s)\n";
  }
  if ( transforms != 0 ) {
    string += transforms + " Transform(s)\n";
  }
  if ( string.length() != 0 ) {
    string = string.substring( 0, string.length() - 1 );
  }
  label.setText( string );
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号