Class ImageTree

java.lang.Object
fr.formiko.usuel.structures.Tree<BufferedImage>
fr.formiko.usuel.structures.ImageTree
All Implemented Interfaces:
Serializable, Iterable<BufferedImage>

public class ImageTree extends Tree<BufferedImage>
Custom Tree class using Generics.
Author:
Hydrolien
See Also:
Serialized Form
  • Constructor Details

    • ImageTree

      public ImageTree()
  • Method Details

    • copyStructure

      public ImageTree copyStructure()
      Copy the structure of a given Tree. content of node will not be copy.
      Overrides:
      copyStructure in class Tree<BufferedImage>
    • getCreatureImage

      public BufferedImage getCreatureImage(Creature c)
      Return the Image that fit to a Creature.
      Parameters:
      c - the Creature to represent.
    • createAntImageFromNode

      public static BufferedImage createAntImageFromNode(Creature c, TreeNode<BufferedImage> node)
      Create an ant Image from the coresponding node, with the Creature color.
      Parameters:
      c - Creature that will be used for color
      node -
    • getScaledInstanceFromTree

      public static ImageTree getScaledInstanceFromTree(ImageTree treeIn, int dim)
      Return the scaled instance of this tree. content of node that correspond to Creature image will be copy.
    • addScaledInsect

      private static void addScaledInsect(Liste<TreeNode<BufferedImage>> insectListIn, Liste<TreeNode<BufferedImage>> insectListOut, int dim)
      Return the scaled instance of the Insect part. content of node that correspond to Creature image will be copy.
    • addScaledAnt

      private static void addScaledAnt(Liste<TreeNode<BufferedImage>> antListIn, Liste<TreeNode<BufferedImage>> antListOut, int dim)
      Return the scaled instance of the Ant part. content of node that correspond to Creature image will be copy.
    • addScaledAntColorPart

      private static void addScaledAntColorPart(TreeNode<BufferedImage> currentNodeIn, TreeNode<BufferedImage> currentNodeOut, int dim, int size)
      Return the scaled color of the Ant.
      It can return null if color is disable in Options. Color image will be edit to whithout transparency image if Ant color level is 1 in Options.
    • addScaledAntOtherPart

      private static void addScaledAntOtherPart(TreeNode<BufferedImage> currentNodeIn, TreeNode<BufferedImage> currentNodeOut, int dim, int size)
      Return the scaled part of the body of the Ant.
    • folderToTree

      public static ImageTree folderToTree(File file)
      Transform a folder tree into a Java ImageTree.
      Parameters:
      file - file to Transform
    • folderToTree

      public static ImageTree folderToTree(String fileName)
      Transform a folder tree into a Java ImageTree.
      Parameters:
      fileName - name of the file to Transform