Package fr.formiko.usuel.structures
Class ImageTree
- All Implemented Interfaces:
Serializable,Iterable<BufferedImage>
Custom Tree class using Generics.
- Author:
- Hydrolien
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class fr.formiko.usuel.structures.Tree
Tree.TreeIterator<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddScaledAnt(Liste<TreeNode<BufferedImage>> antListIn, Liste<TreeNode<BufferedImage>> antListOut, int dim)Return the scaled instance of the Ant part.private static voidaddScaledAntColorPart(TreeNode<BufferedImage> currentNodeIn, TreeNode<BufferedImage> currentNodeOut, int dim, int size)Return the scaled color of the Ant.private static voidaddScaledAntOtherPart(TreeNode<BufferedImage> currentNodeIn, TreeNode<BufferedImage> currentNodeOut, int dim, int size)Return the scaled part of the body of the Ant.private static voidaddScaledInsect(Liste<TreeNode<BufferedImage>> insectListIn, Liste<TreeNode<BufferedImage>> insectListOut, int dim)Return the scaled instance of the Insect part.Copy the structure of a given Tree.static BufferedImagecreateAntImageFromNode(Creature c, TreeNode<BufferedImage> node)Create an ant Image from the coresponding node, with the Creature color.static ImageTreefolderToTree(File file)Transform a folder tree into a Java ImageTree.static ImageTreefolderToTree(String fileName)Transform a folder tree into a Java ImageTree.Return the Image that fit to a Creature.static ImageTreegetScaledInstanceFromTree(ImageTree treeIn, int dim)Return the scaled instance of this tree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ImageTree
public ImageTree()
-
-
Method Details
-
copyStructure
Copy the structure of a given Tree. content of node will not be copy.- Overrides:
copyStructurein classTree<BufferedImage>
-
getCreatureImage
Return the Image that fit to a Creature.- Parameters:
c- the Creature to represent.
-
createAntImageFromNode
Create an ant Image from the coresponding node, with the Creature color.- Parameters:
c- Creature that will be used for colornode-
-
getScaledInstanceFromTree
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
Transform a folder tree into a Java ImageTree.- Parameters:
file- file to Transform
-
folderToTree
Transform a folder tree into a Java ImageTree.- Parameters:
fileName- name of the file to Transform
-