00001 package edu.ksu.cis.bandera.abstraction.gui; 00002 00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00004 * Bandera, a Java(TM) analysis and transformation toolkit * 00005 * Copyright (C) 1998, 1999, 2000 Shawn Laubach (laubach@acm.org) * 00006 * All rights reserved. * 00007 * * 00008 * Modifications by Robby (robby@cis.ksu.edu) are * 00009 * Copyright (C) 2000 Robby. All rights reserved. * 00010 * * 00011 * This work was done as a project in the SAnToS Laboratory, * 00012 * Department of Computing and Information Sciences, Kansas State * 00013 * University, USA (http://www.cis.ksu.edu/santos). * 00014 * It is understood that any modification not identified as such is * 00015 * not covered by the preceding statement. * 00016 * * 00017 * This work is free software; you can redistribute it and/or * 00018 * modify it under the terms of the GNU Library General Public * 00019 * License as published by the Free Software Foundation; either * 00020 * version 2 of the License, or (at your option) any later version. * 00021 * * 00022 * This work is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00025 * Library General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU Library General Public * 00028 * License along with this toolkit; if not, write to the * 00029 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * 00030 * Boston, MA 02111-1307, USA. * 00031 * * 00032 * Java is a trademark of Sun Microsystems, Inc. * 00033 * * 00034 * To submit a bug report, send a comment, or get the latest news on * 00035 * this project and other SAnToS projects, please visit the web-site * 00036 * http://www.cis.ksu.edu/santos * 00037 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00038 import java.util.*; 00039 import javax.swing.table.*; 00040 import ca.mcgill.sable.soot.*; 00041 import javax.swing.tree.TreeNode; 00042 public class ClassTreeNode extends TypeTreeNode { 00043 SootClass cls; 00044 /** 00045 * ClassTreeNode constructor comment. 00046 */ 00047 public ClassTreeNode(SootClass cls) { 00048 super(cls.getName()); 00049 this.cls = cls; 00050 for (ca.mcgill.sable.util.Iterator i = cls.getFields().iterator(); i.hasNext();) { 00051 SootField field = (SootField) i.next(); 00052 if (field.getName().indexOf("quantification$") == -1) 00053 addChild(new FieldTreeNode(field)); 00054 } 00055 for (ca.mcgill.sable.util.Iterator i = cls.getMethods().iterator(); i.hasNext();) { 00056 SootMethod method = (SootMethod) i.next(); 00057 if (!method.getName().equals("<clinit>")) 00058 addChild(new MethodTreeNode(method)); 00059 } 00060 } 00061 /** 00062 * Insert the method's description here. 00063 * Creation date: (3/24/00 12:20:36 AM) 00064 * @return javax.swing.table.TableCellRenderer 00065 * @param row int 00066 * @param column int 00067 */ 00068 public TableCellEditor getCellEditor(int column) { 00069 return null; 00070 } 00071 /** 00072 * Insert the method's description here. 00073 * Creation date: (3/24/00 12:20:36 AM) 00074 * @return javax.swing.table.TableCellRenderer 00075 * @param row int 00076 * @param column int 00077 */ 00078 public TableCellRenderer getCellRenderer(int column) { 00079 return null; 00080 } 00081 /** 00082 * Insert the method's description here. 00083 * Creation date: (5/12/00 12:03:48 PM) 00084 * @param result java.util.Hashtable 00085 */ 00086 public void getOption(Hashtable result) { 00087 result.put(cls, new HashSet()); 00088 for (int i = 0; i < getChildCount(); i++) { 00089 if (getChildAt(i) instanceof FieldTreeNode) { 00090 FieldTreeNode field = (FieldTreeNode) getChildAt(i); 00091 field.getOption(result); 00092 } else { 00093 MethodTreeNode method = (MethodTreeNode) getChildAt(i); 00094 method.getOption(result); 00095 } 00096 } 00097 } 00098 /** 00099 * Insert the method's description here. 00100 * Creation date: (3/23/00 11:30:08 PM) 00101 * @return java.lang.String 00102 */ 00103 public String toString() { 00104 return getName().toString(); 00105 } 00106 }