|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpqrtreeapplet.PQRController
public class PQRController
The controller component of the model/view/controller for this application This class starts the execution and either loads the GUI. Based in the PQController class of Jon Harris' Graphical Implementation of PQ Tree Data Structure. PQ Tree link.
Field Summary | |
---|---|
java.util.concurrent.locks.Lock |
addSetLock
|
private java.util.concurrent.ExecutorService |
application
|
java.util.concurrent.locks.Condition |
canAddSet
|
java.util.concurrent.locks.Condition |
canBePainted
|
private int |
delayInSeconds
|
private boolean |
drawAllSteps
|
java.util.concurrent.locks.Condition |
nextStep
|
private PQRTree |
pqrTree
|
boolean |
setToBePainted
|
private javax.swing.Timer |
timer
|
private PQRWindow |
window
|
Constructor Summary | |
---|---|
PQRController(int universeSize)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
button click handlers for the gui. |
void |
destroy()
Kills the thread. |
private int[] |
getConstraintsFromGUI()
Reduces the tree using the constraints provided by the GUI. |
Node |
getLeafAt(int index)
Gets the leaf at a specific position of the leaves vector. |
PQRWindow |
getWindow()
Gets the window created by the controller. |
void |
init()
Creates a new window. |
void |
reduceTree(int[] constraints)
Reduce the tree using the constraints provided in a vector. |
void |
reduceTreeByStep()
Reduces the tree by one step. |
void |
resetTree()
Resets the tree back to the universal tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PQRTree pqrTree
private PQRWindow window
private javax.swing.Timer timer
public java.util.concurrent.locks.Lock addSetLock
public java.util.concurrent.locks.Condition canAddSet
public java.util.concurrent.locks.Condition canBePainted
public java.util.concurrent.locks.Condition nextStep
public boolean setToBePainted
private java.util.concurrent.ExecutorService application
private boolean drawAllSteps
private int delayInSeconds
Constructor Detail |
---|
public PQRController(int universeSize) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void init() throws java.lang.Exception
java.lang.Exception
public PQRWindow getWindow()
private int[] getConstraintsFromGUI()
public void reduceTree(int[] constraints) throws java.lang.Exception
constraints
- The set to be added to the tree.
java.lang.Exception
public void reduceTreeByStep() throws java.lang.Exception
java.lang.Exception
public void resetTree() throws java.lang.Exception
java.lang.Exception
public Node getLeafAt(int index)
index
- Position of the vector.
index
.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- The action event occurred.public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |