View Javadoc

1   /*
2    * ToolEdge.java
3    *
4    * Created on 10. juli 2005, 19:04
5    */
6   
7   package com.vikash.firsttool.ProfileImpl;
8   
9   import org.jgraph.graph.DefaultEdge;
10  import org.jgraph.graph.EdgeView;
11  import org.jgraph.graph.GraphContext;
12  
13  import java.awt.event.*;
14  import javax.swing.tree.*;
15  import javax.swing.*;
16  /***
17   *
18   * @author  studajb
19   */
20  public class ToolEdge extends DefaultEdge{
21      //TreeNode parent;
22      /*** Creates a new instance of ToolEdge */
23      public ToolEdge() {
24          this(null);
25      }
26      public ToolEdge(Object userobject){
27          super(userobject);
28      }
29      
30      public void setParent(MutableTreeNode parent){
31          if(parent!=null)
32         /* if(!(parent instanceof EdgeElements)){
33          
34               throw new IllegalArgumentException("Parent not allowed");
35          }  */
36              parent=parent;
37          
38          
39      }
40      public TreeNode getParent(){
41          return parent;
42      }
43      public String toString(){
44          if (userObject == null) {
45              return ("");
46              
47          }
48          else {
49              return userObject.toString();
50          }
51      }
52      public boolean isLeaf(){
53          return true;
54      }
55      
56  }
57