Example #1
0
  /**
   * Returns rotated by 180 degrees NinePatchIcon. This method also modifies patches information
   * properly.
   *
   * @param icon NinePatchIcon to rotate
   * @return rotated by 180 degrees NinePatchIcon
   */
  public static NinePatchIcon rotateIcon180(final NinePatchIcon icon) {
    final BufferedImage rawImage = ImageUtils.rotateImage180(icon.getRawImage());
    final NinePatchIcon rotated = NinePatchIcon.create(rawImage);

    // Rotating stretch information
    rotated.setHorizontalStretch(CollectionUtils.copy(icon.getHorizontalStretch()));
    rotated.setVerticalStretch(CollectionUtils.copy(icon.getVerticalStretch()));

    // Rotating margin
    final Insets om = icon.getMargin();
    rotated.setMargin(om.bottom, om.right, om.top, om.left);

    return rotated;
  }
 /**
  * Constructs file tree data provider with the specified files as root.
  *
  * @param filter tree nodes filter
  * @param rootFiles tree root files
  */
 public FileTreeDataProvider(final Filter<FileTreeNode> filter, final File... rootFiles) {
   super();
   this.rootFiles = CollectionUtils.copy(rootFiles);
   this.comparator = new FileTreeNodeComparator();
   this.filter = filter;
 }