01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.gui.prooftree;
12:
13: /** this class implements a TreeModel that can be displayed using the
14: * JTree class framework
15: */
16: import javax.swing.tree.TreeNode;
17:
18: import de.uka.ilkd.key.proof.Node;
19:
20: class GUIProofTreeNode extends GUIAbstractTreeNode implements TreeNode {
21:
22: private Node node;
23:
24: public GUIProofTreeNode(GUIProofTreeModel tree, Node node) {
25: super (tree);
26: this .node = node;
27: }
28:
29: public TreeNode getChildAt(int childIndex) {
30: return null;
31: }
32:
33: public int getChildCount() {
34: return 0;
35: }
36:
37: public TreeNode getParent() {
38: Node n = node;
39: while (n.parent() != null && findChild(n.parent()) != null) {
40: n = n.parent();
41: }
42: return findBranch(n);
43: }
44:
45: public boolean isLeaf() {
46: return true;
47: }
48:
49: public Node getNode() {
50: return node;
51: }
52:
53: public String toString() {
54: // changed to serial:name for searching
55: // the proof tree in ProofTreeView.java
56: return node.serialNr() + ":" + node.name();
57: }
58:
59: }
|