|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Algorithm | +--NJ
This class implements the Neighbor Joining algorithm described in the package.
Field Summary |
Fields inherited from class Algorithm |
ansField, ansFrame, ansLabel, answer, count, display, infoArea, inputTable, interNode, interTable, maxLength, maxName, mini, minj, minLength, names, nodes, numOfNodes, numOfNodesLeft, okAnsButton, okQuesButton, phyTreesControls, popUpQues, quesFrame, quesLabel, question, random_i, random_j, roots, runType, treeDisplay |
Constructor Summary | |
NJ(PTCControls inPhyTreesControls)
Initializes specific GUI components used in the NJ algorithm. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Defines how to handle the actions of the OK buttons for the question and the answer windows in the NJ algorithm. |
java.lang.String |
buildAnswer1()
Generates the answers for the type 1 questions in the NJ algorithm. |
java.lang.String |
buildAnswer2()
Generates the answers for the type 2 questions in the NJ algorithm. |
void |
calculateNewDistance()
Implements the method in the Algorithm calss and defines how to calculate new distance matrix in the NJ algorithm. |
void |
calculateSumAndR()
Defines how to calculate sum and r values in the NJ algorithm. |
void |
calculateTransformDistance()
Defines how to calculate transform distance table in the NJ algorithm. |
void |
constructTransFrame()
Constructs the tranform distance table window. |
void |
displayTransformDistance()
Defines how to display transform distance table in the NJ algorithm. |
void |
findAndCalculate()
Defines how to find the nodes to join and calculate branch lengths in the NJ algorithm. |
boolean |
findOne()
Implements the method in the Algorithm class and indicates if one tree is found. |
void |
generateRandom_ij()
Generates random numbers for pop up questions involved the new distance table in the NJ algorithm. |
void |
generateRandom_mn()
Generates random numbers for pop up questions involved the transform distance table in the NJ algorithm. |
double[][] |
getDistance()
Gets the distance matrix used in the NJ algorithm. |
TransDistanceModel |
getPTransDistanceModel()
Gets the transform distance model used in the transform distance table in the NJ algorithm. |
double[][] |
getTransDistance()
Gets the transform distance matrix used in the NJ algorithm. |
boolean |
init()
Overrides the method in the Algorithm class and initializes specific data components used in the NJ algorithm. |
boolean |
isEnd()
Implements the method in the Algorithm class and indicates if the algorithm terminates in the NJ algorithm. |
void |
join()
Defines how to join the two nodes when there are more than two nodes left in the NJ algorithm. |
void |
joinLastTwoNodes()
Defines how to joins the last two nodes in the NJ algorithm. |
void |
popUpQuestion1()
Generates type 1 pop up questions in the NJ algorithm. |
void |
popUpQuestion2()
Generates type 2 pop up questions in the NJ algorithm. |
void |
processLastTwoNodes()
Defines how to join last two nodes in the NJ algorithm. |
void |
processMoreThanTwoNodes()
Defines how to join more than two nodes in the NJ algorithm. |
void |
reset()
Overrides the method in the Algorithm class and resets all components in the NJ algorithm. |
void |
run()
Implements the method in the Algorithm classs and defines how to run the NJ algorithm. |
void |
trace()
Implements the method in the Algorithm class and defines how to trace the NJ algorithm. |
void |
updateTransformDistance()
Defines how to update transform distance table in the NJ algorithm. |
void |
updateUI()
Defines how to update the tree and the intermediate distance table when there are more than two nodes left in the NJ algorithm. |
void |
updateUILastTwoNodes()
Defines how to update the tree and the intermediate distance table when there are only two nodes left in the NJ algorithm. |
Methods inherited from class Algorithm |
computeMaxName, computeMinMaxLength, constructAnsFrame, constructButton, constructQuesFrame, deleteNodes, findMin, getCount, getDisplay, getInterNode, getMaxLength, getMaxName, getMinLength, getNames, getNode, getNodes, getNumOfNodes, getNumOfNodesLeft, getRoots, randomInt, setPopUpQues, setRoots, setRunType, setThreeFractionDigit, updateTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NJ(PTCControls inPhyTreesControls)
inPhyTreesControls
- the PTCControls objectMethod Detail |
public double[][] getDistance()
public double[][] getTransDistance()
public TransDistanceModel getPTransDistanceModel()
public boolean init()
init
in class Algorithm
true
- the algorithm is properly initialized
false
- input data is not rightpublic void trace()
trace
in class Algorithm
public void run()
run
in class Algorithm
public void processMoreThanTwoNodes()
public void processLastTwoNodes()
public void findAndCalculate()
public void join()
public void updateUI()
public void joinLastTwoNodes()
public void updateUILastTwoNodes()
public void calculateTransformDistance()
public void displayTransformDistance()
public void updateTransformDistance()
public void calculateNewDistance()
calculateNewDistance
in class Algorithm
public void calculateSumAndR()
public void constructTransFrame()
public void reset()
reset
in class Algorithm
public boolean isEnd()
isEnd
in class Algorithm
true
- the algorithm terminates
false
- the algorithm does not terminatepublic boolean findOne()
findOne
in class Algorithm
false
for the NJ algorithmpublic void generateRandom_mn()
public void generateRandom_ij()
public void popUpQuestion1()
public java.lang.String buildAnswer1()
public void popUpQuestion2()
public java.lang.String buildAnswer2()
public void actionPerformed(java.awt.event.ActionEvent e)
e
- the ActionEvent object which is responsible for the action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |