use of javax.swing.tree.TreeNode in project fql by CategoricalData.
the class AqlOutline method conv.
@SuppressWarnings("unchecked")
TreePath conv(TreePath path) {
TreePath parent = path.getParentPath();
if (parent == null) {
return new TreePath(getComp().getModel().getRoot());
}
TreePath rest = conv(parent);
DefaultMutableTreeNode last = (DefaultMutableTreeNode) rest.getLastPathComponent();
DefaultMutableTreeNode us = (DefaultMutableTreeNode) path.getLastPathComponent();
Enumeration<TreeNode> cs = last.children();
if (cs == null) {
return null;
}
while (cs.hasMoreElements()) {
DefaultMutableTreeNode m = (DefaultMutableTreeNode) cs.nextElement();
if (nodeEq(m, us)) {
return rest.pathByAddingChild(m);
}
}
return null;
}
use of javax.swing.tree.TreeNode in project ffx by mjschnie.
the class Joint method getPiOrbitalTorsions.
/**
* <p>
* getPiOrbitalTorsions</p>
*
* @return a {@link ffx.potential.bonded.MSNode} object.
*/
public MSNode getPiOrbitalTorsions() {
for (Enumeration e = children(); e.hasMoreElements(); ) {
MSNode m = (MSNode) e.nextElement();
TreeNode node = m.getChildAt(0);
if (node instanceof PiOrbitalTorsion) {
return m;
}
}
return null;
}
use of javax.swing.tree.TreeNode in project ffx by mjschnie.
the class Joint method getOutOfPlaneBends.
/**
* <p>
* getOutOfPlaneBends</p>
*
* @return a {@link ffx.potential.bonded.MSNode} object.
*/
public MSNode getOutOfPlaneBends() {
for (Enumeration e = children(); e.hasMoreElements(); ) {
MSNode m = (MSNode) e.nextElement();
TreeNode node = m.getChildAt(0);
if (node instanceof OutOfPlaneBend) {
return m;
}
}
return null;
}
use of javax.swing.tree.TreeNode in project ffx by mjschnie.
the class Joint method getAngles.
/**
* <p>
* getAngles</p>
*
* @return a {@link ffx.potential.bonded.MSNode} object.
*/
public MSNode getAngles() {
for (Enumeration e = children(); e.hasMoreElements(); ) {
MSNode m = (MSNode) e.nextElement();
TreeNode node = m.getChildAt(0);
if (node instanceof Angle) {
return m;
}
}
return null;
}
use of javax.swing.tree.TreeNode in project ffx by mjschnie.
the class Joint method getUreyBradleys.
/**
* <p>
* getUreyBradleys</p>
*
* @return a {@link ffx.potential.bonded.MSNode} object.
*/
public MSNode getUreyBradleys() {
for (Enumeration e = children(); e.hasMoreElements(); ) {
MSNode m = (MSNode) e.nextElement();
TreeNode node = m.getChildAt(0);
if (node instanceof UreyBradley) {
return m;
}
}
return null;
}
Aggregations