Sunday, 26 April 2009

Product Code

The code in the project has some sections which i have made for a specific process on this project. All the code has been written by me but there are some sections which i am happy with, These are the drawing of the nodes, correcting there position and the drawing a line from center to each node.

The drawing node section is split into three parts, identifying the main node, displaying all the nodes and making shore they are not touching.

This bit of code identifies the main file by looping through them all until it finds one which has the property main set to true withing its class

The bit of code that moves the files to the circle line is done with a function within the class which identify whether the node is above the middle or not and then to the left or right. it then calculates what the difference between up/down and left/right to decide what percent it should move the file and at what angle to ensure it keeps on the same line.

The final bit of code moves the node away from another node untill it is at a set distance, it does it in a similar way to the code above but only moves out if it is less than the distance, this means that if a file is larger in size the distance could be set greater than if it is a small file.

No comments:

Post a Comment