View Javadoc

1   /*
2    * IconGraphCell.java
3    *
4    * Created on 28. mai 2005, 22:11
5    */
6   
7   package com.vikash.firsttool.ProfileImpl; 
8   
9   import javax.swing.tree.*;
10  import org.jgraph.graph.DefaultGraphCell;
11  import org.jgraph.graph.GraphConstants;
12  
13  
14  /***
15   *
16   * @author  studajb
17   */
18  public class IconGraphCell extends DefaultGraphCell{
19    
20      /*** Creates a new instance of IconGraphCell */
21      public IconGraphCell() {
22          this(null);
23      }
24      
25       public IconGraphCell(Object object) {
26          super(object);
27      }
28     
29     
30     
31     public String toString() {
32  	if (userObject == null) {
33  	    Object[] labels=GraphConstants.getExtraLabels(this.getAttributes());
34              Object cellname=String.valueOf(labels[0]);
35              /*if(cellname=="Asset"){
36              Object vulnerability=String.valueOf(labels[1]);
37               //return ("New"+cellname.toString()+"\n\n"+"<font size=\"+0\">"+vulnerability.toString()+"</font>\n");
38              return ("New"+cellname.toString()+"\n\n"+"<b><u>"+vulnerability.toString()+"</b></u>\n");
39              }
40              else*/
41              return ("New"+cellname.toString());
42             
43              
44  	} 
45          else {
46              return userObject.toString();
47  	}
48         
49      }
50  }