Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

BUISessionPane.java

00001 package edu.ksu.cis.bandera.bui;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Bandera, a Java(TM) analysis and transformation toolkit           *
00005  * Copyright (C) 2000   Robby (robby@cis.ksu.edu)                    *
00006  * All rights reserved.                                              *
00007  *                                                                   *
00008  * This work was done as a project in the SAnToS Laboratory,         *
00009  * Department of Computing and Information Sciences, Kansas State    *
00010  * University, USA (http://www.cis.ksu.edu/santos).                  *
00011  * It is understood that any modification not identified as such is  *
00012  * not covered by the preceding statement.                           *
00013  *                                                                   *
00014  * This work is free software; you can redistribute it and/or        *
00015  * modify it under the terms of the GNU Library General Public       *
00016  * License as published by the Free Software Foundation; either      *
00017  * version 2 of the License, or (at your option) any later version.  *
00018  *                                                                   *
00019  * This work is distributed in the hope that it will be useful,      *
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00022  * Library General Public License for more details.                  *
00023  *                                                                   *
00024  * You should have received a copy of the GNU Library General Public *
00025  * License along with this toolkit; if not, write to the             *
00026  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00027  * Boston, MA  02111-1307, USA.                                      *
00028  *                                                                   *
00029  * Java is a trademark of Sun Microsystems, Inc.                     *
00030  *                                                                   *
00031  * To submit a bug report, send a comment, or get the latest news on *
00032  * this project and other SAnToS projects, please visit the web-site *
00033  *                http://www.cis.ksu.edu/santos                      *
00034  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00035 import edu.ksu.cis.bandera.pdgslicer.datastructure.*;
00036 import ca.mcgill.sable.soot.*;
00037 import ca.mcgill.sable.soot.jimple.*;
00038 import edu.ksu.cis.bandera.annotation.*;
00039 import edu.ksu.cis.bandera.specification.assertion.datastructure.*;
00040 import edu.ksu.cis.bandera.jjjc.*;
00041 import edu.ksu.cis.bandera.jjjc.symboltable.*;
00042 import edu.ksu.cis.bandera.jjjc.symboltable.Package;
00043 import edu.ksu.cis.bandera.specification.predicate.datastructure.*;
00044 import edu.ksu.cis.bandera.util.*;
00045 import java.awt.*;
00046 import java.awt.event.*;
00047 import java.util.*;
00048 import javax.swing.*;
00049 import javax.swing.tree.*;
00050 
00051 
00052 public class BUISessionPane extends JPanel {
00053     private boolean showIconRightTree;
00054     private JSplitPane ivjBUISplitPane = null;
00055     private JScrollPane ivjLeftScrollPane = null;
00056     private JTree ivjLeftTree = null;
00057     private JScrollPane ivjRightScrollPane = null;
00058     private JTree ivjRightTree = null;
00059     IvjEventHandler ivjEventHandler = new IvjEventHandler();
00060 
00061 class IvjEventHandler implements java.awt.event.MouseListener, javax.swing.event.TreeSelectionListener {
00062         public void mouseClicked(java.awt.event.MouseEvent e) {};
00063         public void mouseEntered(java.awt.event.MouseEvent e) {};
00064         public void mouseExited(java.awt.event.MouseEvent e) {};
00065         public void mousePressed(java.awt.event.MouseEvent e) {};
00066         public void mouseReleased(java.awt.event.MouseEvent e) {
00067             if (e.getSource() == BUISessionPane.this.getLeftTree()) 
00068                 connEtoC2(e);
00069         };
00070         public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
00071             if (e.getSource() == BUISessionPane.this.getLeftTree()) 
00072                 connEtoC1();
00073         };
00074     };
00075 /**
00076  * BUISessionPane constructor comment.
00077  */
00078 public BUISessionPane() {
00079     super();
00080     initialize();
00081 }
00082 /**
00083  * BUISessionPane constructor comment.
00084  * @param layout java.awt.LayoutManager
00085  */
00086 public BUISessionPane(LayoutManager layout) {
00087     super(layout);
00088 }
00089 /**
00090  * BUISessionPane constructor comment.
00091  * @param layout java.awt.LayoutManager
00092  * @param isDoubleBuffered boolean
00093  */
00094 public BUISessionPane(LayoutManager layout, boolean isDoubleBuffered) {
00095     super(layout, isDoubleBuffered);
00096 }
00097 /**
00098  * BUISessionPane constructor comment.
00099  * @param isDoubleBuffered boolean
00100  */
00101 public BUISessionPane(boolean isDoubleBuffered) {
00102     super(isDoubleBuffered);
00103 }
00104 /**
00105  * 
00106  * @param node com.sun.java.swing.tree.DefaultMutableTreeNode
00107  * @param ann edu.ksu.cis.bandera.annotation.BlockStmtAnnotation
00108  */
00109 private static void addBlock(DefaultMutableTreeNode node, BlockStmtAnnotation ann) {
00110     if (ann == null) return;
00111     
00112     Vector anns = ann.getContainedAnnotations();
00113     for (Enumeration e = anns.elements(); e.hasMoreElements();) {
00114         for (Enumeration e2 = buildTree((Annotation) e.nextElement()).elements(); e2.hasMoreElements();) {
00115             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e2.nextElement();
00116             Object o = n.getUserObject();
00117             if (!"".equals(o.toString().trim())) node.add(n);
00118         }
00119     }
00120 }
00121 /**
00122  * 
00123  * @return javax.swing.tree.DefaultMutableTreeNode
00124  * @param sc ca.mcgill.sable.soot.SootClass
00125  */
00126 private DefaultMutableTreeNode buildClassNode(SootClass sc) {
00127     AnnotationManager am = CompilationManager.getAnnotationManager();
00128 
00129     TreeSet ts = new TreeSet();
00130     for (ca.mcgill.sable.util.Iterator i = sc.getFields().iterator(); i.hasNext();) {
00131         Annotation a = am.getAnnotation(sc, i.next());
00132         if (a != null) 
00133             ts.add(a);
00134     }
00135     for (ca.mcgill.sable.util.Iterator i = sc.getMethods().iterator(); i.hasNext();) {
00136         Annotation a = am.getAnnotation(sc, i.next());
00137         if (a != null)
00138             ts.add(a);
00139     }
00140     
00141     DefaultMutableTreeNode node = new DefaultMutableTreeNode(sc);
00142 
00143     for (Iterator i = ts.iterator(); i.hasNext();) {
00144         node.add(new DefaultMutableTreeNode(i.next()));
00145     }
00146     
00147     return node;
00148 }
00149 /**
00150  * 
00151  * @return javax.swing.tree.DefaultMutableTreeNode
00152  * @param p edu.ksu.cis.bandera.jjjc.symboltable.Package
00153  */
00154 private DefaultMutableTreeNode buildPackageNode(Package p) {
00155     DefaultMutableTreeNode pNode = new DefaultMutableTreeNode(p);
00156     Hashtable compiledClasses = CompilationManager.getCompiledClasses();
00157     
00158     TreeSet cNames = new TreeSet();
00159     for (Enumeration e = compiledClasses.elements(); e.hasMoreElements();) {
00160         Name cName = new Name(((SootClass) e.nextElement()).getName());
00161         if (cName.getSuperName().equals(p.getName()))
00162             cNames.add(cName);
00163     }
00164     
00165     for (Iterator j = cNames.iterator(); j.hasNext();) {
00166         Name cName = (Name) j.next();
00167         SootClass sc = (SootClass) compiledClasses.get(cName.toString());
00168         pNode.add(buildClassNode(sc));
00169     }
00170     return pNode;
00171 }
00172 /**
00173  * 
00174  * @return java.util.Vector
00175  * @param annotation edu.ksu.cis.bandera.annotation.Annotation
00176  */
00177 public static Vector buildTree(Annotation annotation) {
00178     Vector result = new Vector();
00179 
00180     if (annotation == null) return result;
00181 
00182     DefaultMutableTreeNode node = new DefaultMutableTreeNode(annotation);
00183 
00184     result.addElement(node);
00185     
00186     if (annotation instanceof BlockStmtAnnotation) {
00187         addBlock(node, (BlockStmtAnnotation) annotation);
00188     } else if (annotation instanceof BreakStmtAnnotation) {
00189     } else if (annotation instanceof ContinueStmtAnnotation) {
00190     } else if (annotation instanceof DoWhileStmtAnnotation) {
00191         Annotation ann = ((DoWhileStmtAnnotation) annotation).getBlockAnnotation();
00192         if (ann instanceof BlockStmtAnnotation) {
00193             addBlock(node, (BlockStmtAnnotation) ann);
00194         } else {
00195             for (Enumeration e = buildTree(ann).elements(); e.hasMoreElements();) {
00196                 node.add((DefaultMutableTreeNode) e.nextElement());
00197             }
00198         }
00199     } else if (annotation instanceof EmptyStmtAnnotation) {
00200     } else if (annotation instanceof ExpStmtAnnotation) {
00201     } else if (annotation instanceof FieldDeclarationAnnotation) {
00202     } else if (annotation instanceof ForStmtAnnotation) {
00203         Annotation ann = ((ForStmtAnnotation) annotation).getBlockAnnotation();
00204         if (ann instanceof BlockStmtAnnotation) {
00205             addBlock(node, (BlockStmtAnnotation) ann);
00206         } else {
00207             for (Enumeration e = buildTree(ann).elements(); e.hasMoreElements();) {
00208                 node.add((DefaultMutableTreeNode) e.nextElement());
00209             }
00210         }
00211     } else if (annotation instanceof IfStmtAnnotation) {
00212         Annotation tann = ((IfStmtAnnotation) annotation).getThenAnnotation();
00213         Annotation eann = ((IfStmtAnnotation) annotation).getElseAnnotation();
00214         for (Enumeration e = buildTree(tann).elements(); e.hasMoreElements();) {
00215             node.add((DefaultMutableTreeNode) e.nextElement());
00216         }
00217         
00218         if (!(eann instanceof EmptyStmtAnnotation)) {
00219             DefaultMutableTreeNode elseNode = new DefaultMutableTreeNode("else");
00220             for (Enumeration e = buildTree(eann).elements(); e.hasMoreElements();) {
00221                 elseNode.add((DefaultMutableTreeNode) e.nextElement());
00222             }
00223             result.addElement(elseNode);
00224         }
00225     } else if (annotation instanceof InstanceInitializerAnnotation) {
00226     } else if (annotation instanceof LabeledStmtAnnotation) {
00227         for (Enumeration e = buildTree(((LabeledStmtAnnotation) annotation).getAnnotation()).elements();
00228                 e.hasMoreElements();) {
00229             node.add((DefaultMutableTreeNode) e.nextElement());
00230         }
00231     } else if (annotation instanceof EmptyStmtAnnotation) {
00232     } else if (annotation instanceof LocalDeclarationStmtAnnotation) {
00233     } else if (annotation instanceof ReturnStmtAnnotation) {
00234     } else if (annotation instanceof StaticInitializerAnnotation) {
00235     } else if (annotation instanceof SwitchStmtAnnotation) {
00236         Hashtable cases = ((SwitchStmtAnnotation) annotation).getSwitchCases();
00237         for (Enumeration e = ((SwitchStmtAnnotation) annotation).getSwitchCases().elements(); e.hasMoreElements();) {
00238             BlockStmtAnnotation a = (BlockStmtAnnotation) e.nextElement();
00239             DefaultMutableTreeNode caseNode = new DefaultMutableTreeNode(a.getNode());
00240             if (a.getNode() instanceof edu.ksu.cis.bandera.jjjc.node.ACaseSwitchLabel) {
00241                 edu.ksu.cis.bandera.jjjc.node.ACaseSwitchLabel caseLabel = (edu.ksu.cis.bandera.jjjc.node.ACaseSwitchLabel) a.getNode();
00242                 caseNode.setUserObject("case " + caseLabel.getExp().toString().trim() + ":");
00243             } else if (a.getNode() instanceof edu.ksu.cis.bandera.jjjc.node.ASwitchBlockStmtGroup) {
00244                 edu.ksu.cis.bandera.jjjc.node.ASwitchBlockStmtGroup caseLabel = (edu.ksu.cis.bandera.jjjc.node.ASwitchBlockStmtGroup) a.getNode();
00245                 String label = "";
00246                 for (ca.mcgill.sable.util.Iterator i = caseLabel.getSwitchLabel().iterator(); i.hasNext();) {
00247                     label += i.next();
00248                 }
00249 
00250                 caseNode.setUserObject(label);
00251             }
00252             addBlock(caseNode, a);
00253             node.add(caseNode);
00254         }
00255         Annotation da = ((SwitchStmtAnnotation) annotation).getDefaultAnnotation();
00256         if (da != null) {
00257             DefaultMutableTreeNode defaultNode = new DefaultMutableTreeNode("default:");
00258             addBlock(defaultNode, (BlockStmtAnnotation) da);
00259             node.add(defaultNode);
00260         }
00261     } else if (annotation instanceof SynchronizedStmtAnnotation) {
00262         addBlock(node, (BlockStmtAnnotation) ((SynchronizedStmtAnnotation) annotation).getBlockAnnotation());
00263     } else if (annotation instanceof ThrowStmtAnnotation) {
00264     } else if (annotation instanceof TryFinallyStmtAnnotation) {
00265         addBlock(node, (BlockStmtAnnotation) ((TryStmtAnnotation) annotation).getBlockAnnotation());
00266         for (Enumeration e = ((TryStmtAnnotation) annotation).getCatchClauses().elements();
00267                 e.hasMoreElements();) {
00268             Annotation a = (Annotation) e.nextElement();
00269             edu.ksu.cis.bandera.jjjc.node.ACatchClause catchClause = (edu.ksu.cis.bandera.jjjc.node.ACatchClause) a.getNode();
00270     
00271             DefaultMutableTreeNode catchNode = new DefaultMutableTreeNode(a);
00272             addBlock(catchNode, (BlockStmtAnnotation) a);
00273             result.addElement(catchNode);
00274         }
00275         Annotation a = ((TryFinallyStmtAnnotation) annotation).getFinallyAnnotation();
00276         DefaultMutableTreeNode finallyNode = new DefaultMutableTreeNode(a);
00277         finallyNode.setUserObject("finally");
00278         addBlock(finallyNode, (BlockStmtAnnotation) a);
00279         result.addElement(finallyNode);
00280     } else if (annotation instanceof TryStmtAnnotation) {
00281         addBlock(node, (BlockStmtAnnotation) ((TryStmtAnnotation) annotation).getBlockAnnotation());
00282         for (Enumeration e = ((TryStmtAnnotation) annotation).getCatchClauses().elements();
00283                 e.hasMoreElements();) {
00284             Annotation a = (Annotation) e.nextElement();
00285             edu.ksu.cis.bandera.jjjc.node.ACatchClause catchClause = (edu.ksu.cis.bandera.jjjc.node.ACatchClause) a.getNode();
00286     
00287             DefaultMutableTreeNode catchNode = new DefaultMutableTreeNode(a);
00288             addBlock(catchNode, (BlockStmtAnnotation) a);
00289             result.addElement(catchNode);
00290         }
00291     } else if (annotation instanceof WhileStmtAnnotation) {
00292         Annotation ann = ((WhileStmtAnnotation) annotation).getBlockAnnotation();
00293         if (ann instanceof BlockStmtAnnotation) {
00294             addBlock(node, (BlockStmtAnnotation) ann);
00295         } else {
00296             for (Enumeration e = buildTree(ann).elements(); e.hasMoreElements();) {
00297                 node.add((DefaultMutableTreeNode) e.nextElement());
00298             }
00299         }
00300     } else if (annotation instanceof ConstructorInvocationStmtAnnotation) {
00301     } else if (annotation instanceof SequentialAnnotation) {
00302         node.setUserObject("");
00303     }
00304 
00305     Vector discard = new Vector();
00306 
00307     for (Enumeration e = node.children(); e.hasMoreElements();) {
00308         DefaultMutableTreeNode child = (DefaultMutableTreeNode) e.nextElement();
00309         Object o = child.getUserObject();
00310         if ("".equals(o.toString().trim())) discard.addElement(child);
00311     }
00312 
00313     for (Enumeration e = discard.elements(); e.hasMoreElements();) {
00314         node.remove((MutableTreeNode) e.nextElement());
00315     }
00316     
00317     return result;
00318 }
00319 /**
00320  * connEtoC1:  (LeftTree.treeSelection. --> BUISessionPane.leftTree_TreeSelectionEvents()V)
00321  */
00322 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00323 private void connEtoC1() {
00324     try {
00325         // user code begin {1}
00326         // user code end
00327         this.leftTree_TreeSelectionEvents();
00328         // user code begin {2}
00329         // user code end
00330     } catch (java.lang.Throwable ivjExc) {
00331         // user code begin {3}
00332         // user code end
00333         handleException(ivjExc);
00334     }
00335 }
00336 /**
00337  * connEtoC2:  (LeftTree.mouse.mouseReleased(java.awt.event.MouseEvent) --> BUISessionPane.leftTree_MouseReleased(Ljava.awt.event.MouseEvent;)V)
00338  * @param arg1 java.awt.event.MouseEvent
00339  */
00340 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00341 private void connEtoC2(java.awt.event.MouseEvent arg1) {
00342     try {
00343         // user code begin {1}
00344         // user code end
00345         this.leftTree_MouseReleased(arg1);
00346         // user code begin {2}
00347         // user code end
00348     } catch (java.lang.Throwable ivjExc) {
00349         // user code begin {3}
00350         // user code end
00351         handleException(ivjExc);
00352     }
00353 }
00354 /**
00355  * 
00356  */
00357 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00358 private static void getBuilderData() {
00359 /*V1.1
00360 **start of data**
00361     D0CB838494G88G88G3AE8AFA9GGGGGGGGGGGG8CGGGE2F5E9ECE4E5F2A0E4E1F4E135BB8BF49457F5FCE4DB4682ABAEC9F1CCDCCE40ADEDE9A35758079AB987A73445B1BD0514E363065AC447E9F10BED1D96D35C027D2415E4E18B8CC6B6CA40E11B10C498A196C996D8D2936B67C8F8859BA401508A41E8F734DAE935334C4CCA3BC2923D773DF933332B9989B9D867DCE65E3D6FF35F7D3DFB5FAC247048225C2C6CC2C232F20976F7BA0B10E5E788D9F95C769E47ED3E14E1A3063F7F85
00362     58CF1E886640B393E84B6F4D306DA3CFF667C3BB27A34316BAAF43F6905E8F103F6D1ED189AF966BF4G6D4985D9364957D92D2F7396ED3F96A90067DE00FCD82B84A052016B6F0996E9F8973477EA6F88D9590458AFE39FE7D311811F2E755B864FFC202F26FD0A2307B5FA9F34314F8CF84E3F4C7AAE0367EE4A5D7573E778BC79DFA55E32D05E9EDC4BB0BF0702CEB65621BD89A94AC3C158480827841EB52E815F2FC5EF38F4C08917FA7CCAE90F90740A32D05A9376D7D55535B7370A0A621702AEA1A8AE6A
00363     C49E6526FCBA9EF804F6099BF17F5604F2F9915ABB818A5D1C4FD7DAEAB4BE2E3D7CCDE2FFBEEA49E7484D781B6F0E7139614D0C379B3AF07E5FC58B34F19B00DEGB8464B7DD14ECBF29767E5CE9D76DD856D0DG19BA7EF775084F3F12E133831C3942F94C788D67B150774764451363F96FDA70683A42F80BDC097168BAFDA87B4754B6DCA1546FF220ED84588A302FBB4366GF0819C22B6790E7491BCEBFB54FAE9F0D08A5606C2F5812F5CA2F945G3CD7D581C543DD90BD126CA504595DF0D30989BF9C7A
00364     3A63ED8E016D6D9261F632A07B8192B9F2B755FD625E9AFA3B73C635B9D23BE3FBDB530DF26BEEC6392541BB0EC3FE983E1F628B2E4670CCD719549630FD94E849D7391C6797F3DE8A6E7B8AD96873673DE5420B6B6F6E485BFA157110F3AD468B1371C7B24A5881F8A70097E094E0A1C07AB5AE63F629FCAA99B787D5D18E8A0156F0CFC810553A30BFGB62F497AD2F4B2D91B819BA7CEFB9C134B52F2230EF6BCBEE8AA17D0FAB4EF23A60FCC03DC585A8FDA2E3DCF18E89BFBF59D3EC1FD652840F4E8537179
00365     54D7AA8CF8265BD45A1F3601369400757F9B5A3F2007754F5567D9C771F6831E4DF3096231DD813485GCC3FEB940CFFBB21DD64815F81E8826883C882D86061BADEA41D3CC5BFF299744B46DE8EFDGCFB1224AC2F3D0D10520C73CA848FE21A7A0AAC46B5393C23976440D73D17F76409A3F950390A1D59A95E5E1D084E3D2D81FD0E8BF7611C5CAED738F0A3040E00870F9A32183708C880A5A9E728A2A986B4168B3C2E893C342C51891A60077AD9E1457BC9AF3D7407B868F1755EBAA62CA3C993686AF174B
00366     7F0470607C9C0CDB8CD4D5B578BD4806A0C7390DFA294FF6C07F65B8CE5463F48737419DBFFA002CF92C5F5486913AC4E6CF2A18E803A1BA77C2402783EC927919393D294342B6110F29FC0473B9396F3D5BEC35066D967CB0D71B470A4E646D99427D6D84DE0AFA617C6865B22F3CEEE736D8A7A8A2373E73B2980E680DE90075AD1771EC910744205AA006C4B8E9032A22693ECA5E9D334BDEC93719CFA99E63D4BD980E2263BF1377B3BC4CE134F2CEBFC769022A4A7E1E30AA360A2A6A8F7AE263AFD2DE1438
00367     9028E8FB9507F12FAE58E39FC0C45F6B8B728103FDB9A5E9A09CEAC34F516C74D1FA9E27C07FA53DDC7FB97518C32D515BFBE9BBC67FDA1D156E2CG671ADEEC7E56345738953B09DF6369FA5CBB0F178C778C453D887C967878FE2F54F7987ACD0727DB67E5082EE153EC7BF62F41EC617B0A35ADBF27185B728B0A39AD7FC8195CD6DFD64CEC155136A938C7E9B8E8307D57950C039EA9989429836AC3884BFDDFE943FD7803FE75125F6B9355D67F0888314D07B67C900D3595705E646371F17867BCBEFAAFFE
00368     0DB846BACD7328547D3373967918EDAE774562A363693FD574A9B1A08E02206A25F0D0E5F8924E0F61959B455DEFBB87CFFB31D36CD55BE4D1ACD1611FD668C3F7D3EABFF1625776785C3CA420F53D5AE66C5A086AD10A0FDDBC66E076F000941D1D9DBF772094D644D27A6F859887D14CDB5CAF8C89254230DACA75DB5A02C4BA5731C957EE091B44E9B9CBB5B0F4CA63A7777D3761F936C58C061BD5F170940F378BE82D358164388500747198B49AC6BA0FC1DA202D17825A0E019669C3BDAEEEAEB46826280F
00369     55EBDEF8B27A5133E674D5BA7D21B87A860D9E33FF7F50BE34C971FAD8049482036067E2146781C36FA550AE8A01F0AC3F088C3D834F00A1FEB27C4030390DDC9F4618B9204F9F9E4EA318A730B919CD2789B8E7C8768F42F1038702D6F72E0D9A6B4E9CBF54A3300FE2F856G30310FB6A0ADDE2B30E7BF4D859BF8CD5A866DGC00AB647D2BF13876B77DD3D1F3D1F75BB534F7A297D1ACF74E33FF43DFEBC29637E1162DE056075D48E4F0BDB7699EB5C2E75D1D31FC358214DDFB010D8AF7CBDBD0FCAGDFB3
00370     406D6755E16399D62BA81247CF53B5CD878FC60C7E48F00BA3E8233DFED9015A41ABC6389E7FB4023CE2BE2721B5DD7C79717FA3937353C62FDF15E41EA2548FD3D7E8136AA125EC82D328574355C53FB88C63D90D7BCF4DDCDE2E819E0F3EDEE62C2BC73B3A725E3110CD32A6132586592C023A1A4D6DBE4B675EB240ED61258FFEB6A56F4D9EF4B4567FBF0F21FD51FB847477C829B28C313B2A6AAC9AD1002DD3B9026BA00F76G2F475FE82339A834C3G49G2CB6B85540EB03C5005B98607EF8A0EA7447FD
00371     0399368A008EG96C796D09B0E8F141C471F590E201EA68F111A5D9157275A9A4B9A3EC1BABE12CC6F83567A7B7282035A1D45E0CC36073F3BB95B81407632D55F4BE668D394643C36B682EBE4FA01176F2565E605F1AF5388395A1DC0D91CDF6D7AC3CB3FF285593E3C41C43FFA78866AF38660678739DF9D0D6EB7785585902E9074C1E4537305280D45B02D7DCCB41747B0427316971A27D3C3AF8D72DA6815D1340DF4E8EF8448844817A046C91C37ABA3D35E89B4C6A6399338F6F6BAFCB5C9BC572B9E6163
00372     3AG9782C81218AC9740F319B4B10FE5F5335CCE6F3024443AFC146257C909F5F9CEBB2F4BB7832DA14457BF5D10487752D07C1A2B935AECDC6304F125896DAD896334B3286D20F9ACC0D3554E232743467308DC07F8G608270DE6777FAE7E95C46B9C72FF39DB70C6379329C5A6BG36G644820E3008600BE196BFA5908D96C0D5735D5600D55D0CC8E7F718565C79A93477DB4211DAC470FE3FBCC3A097BDE8434B4FDBF3BEF6CB17815CB7287D55D279E3B01F900A47BFD7EA0472D24B80FA453041855E55B
00373     6999328A665C244F3BFD54BAFF5FB5EA1E3F5B464C73775DE31357227B472C72FB465F70D94EDFA6G43DD20E7C60E12E133AB9C17652439B9341BF45C73AD088BC0FB060E3BF29EF1CB201D2E631EEEC55CBAECAB5CBFA26D18D795283CBD0B36519ED97B6DF6E35D087DEEB5865C8A30B5FE9E37466D2E89BF24F3BE75413BD4BF0AA2AA54789B84D550E87F2A3ECFCCEA25F34220C8F84D90EC582D75E9D4257AD33A3F7B9ABFB47777D60F8C99B9CBA3B53FFF245D6877C7D5F6C7600467B5157B3DED087BFD
00374     C465F9C2B72D8352203D86E0332E2B7316F71EBB20CFC1F8222E34FB11F1EB3BEF9FB737FB77B87A20A205E50F18E85BBD63C5BAAD96C93014C191EAF9BD9D2F8AB2541A0963E5BA1E512C465F9837729F261FE30DC67D1469F35FFD934F09085E1ECB5BD1DDFFE26DDEFD6D4620D78BAEACA75FC3FD72E1G4946F173A88E3FE979EDFCED7F886EADA40B3D228C1598AB25C9C7987B4F22BEEC077712B04FFD0A1C981FFAA4198A21F0887B4DF5F25BD8887D1683EC815899E6B642463D56026382C2D48A2BFCDC
00375     41B9BE2E8B5AAA40C20034A163B875BC666EBD02E740A7C3C565653C25509831867AEE9862396F43431823764A42A00837B5A4FA487CE16C1B514A57A150AE8428GE883D00779BA0F3851CE31068A857CAA1ABE1B7301524396BE427BB15B7F77F6EE7B1B06396D9706F14E428834819AA25C7673070C365F95093775D044AA2F78BE752524C8E2DE31096267C792738AEF046795CB00169F653134171E4F81E8A7693850E59EDF97GAEBD0A5FD3A3A708EE235BBF3743B3A88E5B759C35418FB596561B45158E
00376     C7093D3C4CF10C6528BFA4469C152427DA6628E4046D35D0FB6EB830BE17717E2813736E84DA528857F12E7D97A67AA8E586D9D55528FA7AC4EF1DE61EDA8D364B496F7652C738EE0E37607C5B20DDF0A343F674862F4DC6EC3CB65BF9ECB189644DB27D66F9F8E5A82F668663795A0DD8FEDDF87A10D6BBD41C635FBC9782FD438D4E7F3F149EB2720F022C2AE27CBA19F3B01EC74FF11E8BC6B94FFFC667EC00F69700BA4A753472E4CCCF2BDA0FA46A29DE8AC8F2F11923220442479F9F535648EF63EB2440DC
00377     2BC7E92D57E62C53F04E1732D87E4868FDF1F40CEBD05A9868DF0F2323CC5F4FB152574651F38D63197C0F3B397C5BAA7F04944F6E357EB6BE26FD9B571ECB762E4FCD4F7E0966E3196D5C477A46A67A5328890E79D2B27559543144EFE1FFC071CB46923F057DA44CEB4495C0BBBC4E7D6948904FF5E6683801A16EE32963BC96EC0CE04E122E37B3E89B6FDFD83BBFB25D3BEFB340792DF3185937E58D2B5C075965D854BC0EFF154622F5405FA6G962F6F3A4C63F57ECD10A9C08DC0974068CD6E27A74F98E3
00378     4C728F2F64E5D95849421B5A9D4A4D44BAF81B83575E84789DB7F9DE7D440963703CA874CF3CB98124CB16C2222CC699165E8AEAB2DC691C2A46AC1AE1D6EBBCB56538445A030D4BEE196E77EAE647FFC463DE458CE647D9BAFEA945FFEA40EB77B9ADBC0EB90116B60357F33FA8C39D954E4C30B9G1AG2E814CGD8B8134BB22F54C12628655A241093123900216CE07B2BBA77453E63B7FD41F1B327BD0E496D2767E9FEBBB3D11E3F227874190972CC534F05B5C0AB19457DFCCF5B977B7D41DBEDBCDE4E7F
00379     56FD24A3F04572AEB1F596333FB46D69A06BF371497439229C753999E8BB816C33B3ECE7G1CG5E59DC1F44D142740966DF2B2A02270F5E32F2E56245E78C0D89980BFBEFDD6435E0E4B60F05CF29BC96264C66B218C73F252C0076869DF7BF4561DDE1260E33074D62950E79FD62578AEDBCDB639353B5FE5F6FF1BCC6B6A5218C1A06B0569742FB9AED4F9A32EB74142409FBD92461D8BCFD66844A05FF85E2F9402FBEA6BADD3CBCD59E602860F940DFDC66F9400EA41E877C60F2E29E7095E2BC4777F4A666
00380     81D9F1745FF4A666815F0823DF6FCC4C8378F8E60F9B68DE34EF658E4C79CCE3B2D85DD9585F791EFEA83C5A841FBE66F5874E2B57DCACD4EBB4F28A57466F07FEA1609F211F8FDA21E35047EA6AD58776D0FA409F946B59AFC6F43BF82805686FFFE9F8BF5DF2BB4E5049E3146BCBDD034926344C3A3E7E384C3C3E2EAEB33FD72AAD1B7C3BF0F31975F7E1D719713BB05B7F5173B1F91FB03CBFF66E4B177DBFFC29EBB01B7FE1A55A25638E083BGA100A40085F770787BFC1976ED47A476B6FAFDF8FF013F08
00381     D239FC1FAC3756651A7229FFC7353E1C66EC122ACA03B8BF47BFDB0EB2D12590C5B25C26F23481596F6BD3D9D78D1FD1CEEBCD08D308E6B91F031E874BE1DF2BG481D085B2C5AA7114F56BB0C31AF2D8A5FB17699AF2A986DBE7A3D678272E1A032BB2C451DE6F757CD30FE571D7C9E20FB28981E2CA07BCC70C01C091652DF0409CEE9983FD557E13A426845DA3D1BDCEE4CC5DFEC766761DCE6E730FAA75BC7521D31FA174560FD91FEFF30DC672509558230CF364ED881BF6B377E76FE32E253F85EFE0BF536
00382     EA73975D954BF9E3367CD717271BEBB0DD3ED4E9EDCF1915D35B536B15745BAC58C1DBB4245D0D3DD1C96F40FBFB95D137DB5B69FDBA2ED9F1C90A9FA3B4BB63562028B5DDFF1B5A4CD4F7922C6FAE95572997713723BCF7AA0D986539F67EBCCBF93AB4B90EA64813696E871DDCF7E9F771DAFDBD3DCF5A82ED121CE1ABCA66F973631F20CE9D495C27671FC61F362AB77074E1A793575D7B91236E9AE01E0E6449739E36EEC6954AAAGFD138116812C865888108910F3B754D9F7F31E1EBBBDD98D24DFFC51F0
00383     A38BF8694856F056609AE7E01EB60088C0AA409200F400F5GDB74B58ABEA91EE48D66DF3185585EB7F79A771EB3A7FE5FC5F32CEA7A46AE54C5491C44FB337394DFB3A7715E6CD937FE77843434B91C67EFFF02B624E87AE0F9EC89755B42FBB2EC17F2B86E944515G6E55EC7DB7D0D5563E332DEAEA5F59D5E59E0BED5593E3F1FE35F9AC5EDBED0C458CF7209A6715C59F788C7BE84070BF2E469C085D573688C141E738733ED4E33D176E1A2977622BB15F4BE04D443D48B566FB0954CC5C4B18B62F2CFFG
00384     E17859B5E6FBE13A7A2FCE7D1B54BD3CB629F7735A24639EDEF3FC5E05FE1B24375BE9FB215E7EE737D5FE00E3EECF8E325DF20D5B715D095DCF8A3FC45B57F263CBFE2F5A477007A3FBE278A69175C1F89DE3F753BB2CFBF89D536936EBF3E61A6CBDA745F816EF7523FE69F9CD3FB2735FFF5D591578FB912C7F0AD27859D8691E4EB94D6274ACB70F53A57ABC0F3BF339FD919E4F1F68627D3CA9DC3FF7390D31E7A16053D2A657AB9B771DAE2B33F6B50C5FE8B2873341875DBC2EBCE2633845EEE3DCE13867
00385     3A78DD7E5694EE3F17EA397D1239E043B4674A3E02382350F64C6577EC41DA7D7B8B60C2G29GE9G6B66723B656F6167F8CDD74E5ADB2FA96757721AB2F3AE2FA93FD3BBF9CD392DF6721A7217F51357149DF5D6B525F617D0BB5D3C077DDF344A410378FF5BDEA6390ACC5E1B18EB544EFB6E59E5D79B8A33C9F6B3496B234E51CCF20751FBA2A16062D3C232BBE06C5EF839E5BDF4F0763EFB4B4359A46FB31257AB84C2FD820C23BF2AF112EC0F2212C374A7C1A7E148C98F8EB9C9873606840FD86DA63BFB
00386     E5DF8F6D2E12EC77E7EE1804362E13F11263A4EF2BFDF8C82B900DD5F2B0B6138B0FD40DD00D8C9272665A35EF0660CF4121599AE62D0EA17AA6A65035DCAA3D5118839FAE3CEE7DFB3FFB355F7B25A65E47AE1750E61AG6FCD65E7EE0E049F212CEA7F56C1A190D00540C0ED500B77GF5D1D50C5517FFAD617C8A6F239199ED1504FC779B467CBFD0CB8788D0FAE0CB6793GG54B8GGD0CB818294G94G88G88G3AE8AFA9D0FAE0CB6793GG54B8GG8CGGGGGGGGGGGGGGGGGE2
00387     F5E9ECE4E5F2A0E4E1F4E1D0CB8586GGGG81G81GBAGGGA194GGGG
00388 **end of data**/
00389 }
00390 /**
00391  * Return the BUISplitPane property value.
00392  * @return javax.swing.JSplitPane
00393  */
00394 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00395 private javax.swing.JSplitPane getBUISplitPane() {
00396     if (ivjBUISplitPane == null) {
00397         try {
00398             ivjBUISplitPane = new javax.swing.JSplitPane(javax.swing.JSplitPane.HORIZONTAL_SPLIT);
00399             ivjBUISplitPane.setName("BUISplitPane");
00400             ivjBUISplitPane.setPreferredSize(new java.awt.Dimension(600, 320));
00401             getBUISplitPane().add(getLeftScrollPane(), "left");
00402             getBUISplitPane().add(getRightScrollPane(), "right");
00403             // user code begin {1}
00404             // user code end
00405         } catch (java.lang.Throwable ivjExc) {
00406             // user code begin {2}
00407             // user code end
00408             handleException(ivjExc);
00409         }
00410     }
00411     return ivjBUISplitPane;
00412 }
00413 /**
00414  * Return the LeftScrollPane property value.
00415  * @return javax.swing.JScrollPane
00416  */
00417 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00418 private javax.swing.JScrollPane getLeftScrollPane() {
00419     if (ivjLeftScrollPane == null) {
00420         try {
00421             ivjLeftScrollPane = new javax.swing.JScrollPane();
00422             ivjLeftScrollPane.setName("LeftScrollPane");
00423             ivjLeftScrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
00424             getLeftScrollPane().setViewportView(getLeftTree());
00425             // user code begin {1}
00426             // user code end
00427         } catch (java.lang.Throwable ivjExc) {
00428             // user code begin {2}
00429             // user code end
00430             handleException(ivjExc);
00431         }
00432     }
00433     return ivjLeftScrollPane;
00434 }
00435 /**
00436  * Return the LeftTree property value.
00437  * @return javax.swing.JTree
00438  */
00439 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00440 public javax.swing.JTree getLeftTree() {
00441     if (ivjLeftTree == null) {
00442         try {
00443             ivjLeftTree = new javax.swing.JTree();
00444             ivjLeftTree.setName("LeftTree");
00445             ivjLeftTree.setBackground(new java.awt.Color(204,204,204));
00446             ivjLeftTree.setBounds(0, 0, 78, 72);
00447             // user code begin {1}
00448             ivjLeftTree.setUI(new javax.swing.plaf.metal.MetalTreeUI() {
00449                 public javax.swing.plaf.metal.MetalTreeUI setAngledColor() {
00450                     setHashColor(Color.black);
00451                     return this;
00452                 }
00453             }.setAngledColor());
00454             ivjLeftTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
00455             ivjLeftTree.setCellRenderer(new DefaultTreeCellRenderer() {
00456                 public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
00457                     super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
00458                     setIcon(null);
00459                     Object o = ((DefaultMutableTreeNode) value).getUserObject();
00460                     if (o instanceof Package) {
00461                         String name = ((Package) o).getName().toString().trim();
00462                         name = "".equals(name) ? "<default package>" : name;
00463                         setText(name);
00464                         setIcon(IconLibrary.packageIcon);
00465                     } else
00466                         if (o instanceof SootClass) {
00467                             SootClass sc = (SootClass) o;
00468                             Name cName = new Name(sc.getName());
00469                             setText(cName.getLastIdentifier());
00470                             setIcon(IconLibrary.classIcon);
00471                             try {
00472                                 if (Package.getClassOrInterfaceType(cName).isInterface()) {
00473                                     setIcon(IconLibrary.interfaceIcon);
00474                                 }
00475                             } catch (Exception e) {
00476                             }
00477                         } else
00478                             if (o instanceof FieldDeclarationAnnotation) {
00479                                 FieldDeclarationAnnotation fda = (FieldDeclarationAnnotation) o;
00480                                 setText(fda.getField().getType() + " " + fda.getField().getName());
00481                                 setIcon(IconLibrary.fieldIcon);
00482                             } else
00483                                 if (o instanceof ConstructorDeclarationAnnotation) {
00484                                     ConstructorDeclarationAnnotation cda = (ConstructorDeclarationAnnotation) o;
00485                                     try {
00486                                         SootMethod sm = cda.getSootMethod();
00487                                         Method m = cda.getConstructor();
00488                                         boolean isAbstractNative = Modifier.isAbstract(sm.getModifiers()) || Modifier.isNative(sm.getModifiers());
00489                                         String result = m.getDeclaringClassOrInterface().getName().getLastIdentifier().trim() + "(";
00490                                         JimpleBody body = (JimpleBody) sm.getBody(Jimple.v());
00491                                         String parm = "";
00492                                         for (Enumeration e = m.getParameters().elements(); e.hasMoreElements();) {
00493                                             Variable v = (Variable) e.nextElement();
00494                                             if (body.declaresLocal(v.getName().toString().trim()) || isAbstractNative) {
00495                                                 parm += (v.toString() + ", ");
00496                                             }
00497                                         }
00498                                         if (parm.length() > 1)
00499                                             parm = parm.substring(0, parm.length() - 2);
00500                                         result += (parm + ")");
00501                                         setText(result);
00502                                     } catch (Exception e) {
00503                                     }
00504                                     setIcon(IconLibrary.methodIcon);
00505                                 } else
00506                                     if (o instanceof MethodDeclarationAnnotation) {
00507                                         MethodDeclarationAnnotation mda = (MethodDeclarationAnnotation) o;
00508                                         SootMethod sm = mda.getSootMethod();
00509                                         boolean isAbstractNative = Modifier.isAbstract(sm.getModifiers()) || Modifier.isNative(sm.getModifiers());
00510                                         Method m = mda.getMethod();
00511                                         String result = sm.getReturnType().toString().trim() + " " + sm.getName().trim() + "(";
00512                                         JimpleBody body = (JimpleBody) sm.getBody(Jimple.v());
00513                                         String parm = "";
00514                                         for (Enumeration e = m.getParameters().elements(); e.hasMoreElements();) {
00515                                             Variable v = (Variable) e.nextElement();
00516                                             if (body.declaresLocal(v.getName().toString().trim()) || isAbstractNative) {
00517                                                 parm += (v.toString() + ", ");
00518                                             }
00519                                         }
00520                                         if (parm.length() > 1)
00521                                             parm = parm.substring(0, parm.length() - 2);
00522                                         result += (parm + ")");
00523                                         setText(result);
00524                                         setIcon(IconLibrary.methodIcon);
00525                                     }
00526                     return this;
00527                 }
00528             });
00529             ((DefaultTreeCellRenderer) ivjLeftTree.getCellRenderer()).setBackgroundNonSelectionColor(new Color(204, 204, 204));
00530             ((DefaultTreeCellRenderer) ivjLeftTree.getCellRenderer()).setBackgroundSelectionColor(Preferences.getHighlightColor());
00531             ivjLeftTree.putClientProperty("JTree.lineStyle", "Angled");
00532             // user code end
00533         } catch (java.lang.Throwable ivjExc) {
00534             // user code begin {2}
00535             // user code end
00536             handleException(ivjExc);
00537         }
00538     }
00539     return ivjLeftTree;
00540 }
00541 /**
00542  * Return the RightScrollPane property value.
00543  * @return javax.swing.JScrollPane
00544  */
00545 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00546 private javax.swing.JScrollPane getRightScrollPane() {
00547     if (ivjRightScrollPane == null) {
00548         try {
00549             ivjRightScrollPane = new javax.swing.JScrollPane();
00550             ivjRightScrollPane.setName("RightScrollPane");
00551             ivjRightScrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
00552             getRightScrollPane().setViewportView(getRightTree());
00553             // user code begin {1}
00554             // user code end
00555         } catch (java.lang.Throwable ivjExc) {
00556             // user code begin {2}
00557             // user code end
00558             handleException(ivjExc);
00559         }
00560     }
00561     return ivjRightScrollPane;
00562 }
00563 /**
00564  * Return the RightTree property value.
00565  * @return javax.swing.JTree
00566  */
00567 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00568 public javax.swing.JTree getRightTree() {
00569     if (ivjRightTree == null) {
00570         try {
00571             ivjRightTree = new javax.swing.JTree();
00572             ivjRightTree.setName("RightTree");
00573             ivjRightTree.setBackground(new java.awt.Color(204,204,204));
00574             ivjRightTree.setBounds(0, 0, 78, 72);
00575             // user code begin {1}
00576             ivjRightTree.setUI(new javax.swing.plaf.metal.MetalTreeUI() {
00577                 public javax.swing.plaf.metal.MetalTreeUI setAngledColor() {
00578                     setHashColor(Color.black);
00579                     return this;
00580                 }
00581             }
00582             .setAngledColor());
00583             ivjRightTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
00584             ivjRightTree.setCellRenderer(new DefaultTreeCellRenderer() {
00585                 public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
00586                     super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
00587                     setIcon(null);
00588                     Object o = ((DefaultMutableTreeNode) value).getUserObject();
00589                     if (o instanceof Predicate) {
00590                         setForeground(Preferences.getPredicateColor());
00591                         if (!((Predicate) o).isValid())
00592                             setIcon(IconLibrary.errorIcon);
00593                     } else
00594                         if (o instanceof Assertion) {
00595                             setForeground(Preferences.getAssertionColor());
00596                             if (!((Assertion) o).isValid())
00597                                 setIcon(IconLibrary.errorIcon);
00598                         } else {
00599                             setForeground(Color.black);
00600                         }
00601                     if (o instanceof Package) {
00602                         String name = ((Package) o).getName().toString().trim();
00603                         name = "".equals(name) ? "<default package>" : name;
00604                         setText(name);
00605                         if (showIconRightTree)
00606                             setIcon(IconLibrary.packageIcon);
00607                     } else
00608                         if (o instanceof SootClass) {
00609                             SootClass sc = (SootClass) o;
00610                             Name cName = new Name(sc.getName());
00611                             String text = null;
00612                             if (Modifier.isInterface(sc.getModifiers())) {
00613                                 text = Modifier.toString(sc.getModifiers()) + cName;
00614                             } else {
00615                                 text = Modifier.toString(sc.getModifiers()) + " class " + cName;
00616                             }
00617                             if (sc.hasSuperClass()) {
00618                                 String superClassName = sc.getSuperClass().getName().trim();
00619                                 //if (!"java.lang.Object".equals(superClassName))
00620                                 text += " extends " + superClassName;
00621                             }
00622                             if (sc.getInterfaceCount() > 0) {
00623                                 text += " implements ";
00624                                 for (ca.mcgill.sable.util.Iterator i = sc.getInterfaces().iterator(); i.hasNext();) {
00625                                     text += ((SootClass) i.next()).getName().trim() + ", ";
00626                                 }
00627                                 text.substring(0, text.length() - 2);
00628                             }
00629                             setText(text.trim());
00630                             if (showIconRightTree) {
00631                                 setIcon(IconLibrary.classIcon);
00632                                 try {
00633                                     if (Package.getClassOrInterfaceType(cName).isInterface()) {
00634                                         setIcon(IconLibrary.interfaceIcon);
00635                                     }
00636                                 } catch (Exception e) {
00637                                 }
00638                             }
00639                         } else
00640                             if (showIconRightTree && (o instanceof FieldDeclarationAnnotation)) {
00641                                 setIcon(IconLibrary.fieldIcon);
00642                             } else
00643                                 if (showIconRightTree && (o instanceof ConstructorDeclarationAnnotation)) {
00644                                     setIcon(IconLibrary.methodIcon);
00645                                 } else
00646                                     if (showIconRightTree && (o instanceof MethodDeclarationAnnotation)) {
00647                                         setIcon(IconLibrary.methodIcon);
00648                                     }
00649                     if (o instanceof Annotation) {
00650                         Annotation a = (Annotation) o;
00651                         if (!(a instanceof MethodDeclarationAnnotation) && !(a instanceof ConstructorDeclarationAnnotation) && !((DefaultMutableTreeNode) value).isRoot() && !(a instanceof LocalDeclarationStmtAnnotation) && (a.getStatements().length == 0)) {
00652                             setForeground(Preferences.getSlicedColor());
00653                         } else
00654                             if ((a instanceof LocalDeclarationStmtAnnotation) && (((LocalDeclarationStmtAnnotation) a).getDeclaredLocals().size() == 0)) {
00655                                 setForeground(Preferences.getSlicedColor());
00656                             }
00657                     }
00658                     return this;
00659                 }
00660             });
00661             ((DefaultTreeCellRenderer) ivjRightTree.getCellRenderer()).setBackgroundNonSelectionColor(new Color(204, 204, 204));
00662             ((DefaultTreeCellRenderer) ivjRightTree.getCellRenderer()).setBackgroundSelectionColor(Preferences.getHighlightColor());
00663             ivjRightTree.putClientProperty("JTree.lineStyle", "Angled");
00664             // user code end
00665         } catch (java.lang.Throwable ivjExc) {
00666             // user code begin {2}
00667             // user code end
00668             handleException(ivjExc);
00669         }
00670     }
00671     return ivjRightTree;
00672 }
00673 /**
00674  * Called whenever the part throws an exception.
00675  * @param exception java.lang.Throwable
00676  */
00677 private void handleException(java.lang.Throwable exception) {
00678 
00679     /* Uncomment the following lines to print uncaught exceptions to stdout */
00680     // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
00681     // exception.printStackTrace(System.out);
00682 }
00683 /**
00684  * Initializes connections
00685  * @exception java.lang.Exception The exception description.
00686  */
00687 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00688 private void initConnections() throws java.lang.Exception {
00689     // user code begin {1}
00690     // user code end
00691     getLeftTree().addTreeSelectionListener(ivjEventHandler);
00692     getLeftTree().addMouseListener(ivjEventHandler);
00693 }
00694 /**
00695  * Initialize the class.
00696  */
00697 /* WARNING: THIS METHOD WILL BE REGENERATED. */
00698 private void initialize() {
00699     try {
00700         // user code begin {1}
00701         // user code end
00702         setName("BUISessionPane");
00703         setPreferredSize(new java.awt.Dimension(600, 320));
00704         setBorder(new javax.swing.border.EtchedBorder());
00705         setLayout(new java.awt.BorderLayout());
00706         setBackground(new java.awt.Color(204,204,255));
00707         setSize(522, 244);
00708         add(getBUISplitPane(), "Center");
00709         initConnections();
00710     } catch (java.lang.Throwable ivjExc) {
00711         handleException(ivjExc);
00712     }
00713     // user code begin {2}
00714     updateLeftTree();
00715     // user code end
00716 }
00717 /**
00718  * Comment
00719  */
00720 public void leftTree_MouseReleased(java.awt.event.MouseEvent mouseEvent) {
00721 }
00722 /**
00723  * Comment
00724  */
00725 public void leftTree_TreeSelectionEvents() {
00726     updateRightTree(((DefaultMutableTreeNode) getLeftTree().getLastSelectedPathComponent()).getUserObject());
00727 }
00728 /**
00729  * main entrypoint - starts the part when it is run as an application
00730  * @param args java.lang.String[]
00731  */
00732 public static void main(java.lang.String[] args) {
00733     try {
00734         JFrame frame = new javax.swing.JFrame();
00735         BUISessionPane aBUISessionPane;
00736         aBUISessionPane = new BUISessionPane();
00737         frame.setContentPane(aBUISessionPane);
00738         frame.setSize(aBUISessionPane.getSize());
00739         frame.addWindowListener(new java.awt.event.WindowAdapter() {
00740             public void windowClosing(java.awt.event.WindowEvent e) {
00741                 System.exit(0);
00742             };
00743         });
00744         frame.setVisible(true);
00745     } catch (Throwable exception) {
00746         System.err.println("Exception occurred in main() of javax.swing.JPanel");
00747         exception.printStackTrace(System.out);
00748     }
00749 }
00750 /**
00751  * 
00752  * @param leftObject java.lang.Object
00753  * @param rightObject java.lang.Object
00754  */
00755 public void select(Object leftObject, Object rightObject) {
00756     select(getLeftTree(), leftObject, true);
00757     updateRightTree(leftObject);
00758     select(getRightTree(), rightObject, false);
00759 }
00760 /**
00761  * 
00762  * @param tree javax.swing.JTree
00763  * @param object java.lang.Object
00764  */
00765 public static void select(JTree tree, Object object, boolean collapseAbove) {
00766     for (int i = 0; i < tree.getRowCount(); i++) {
00767         tree.setSelectionRow(i);
00768         DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
00769         Object o = node.getUserObject();
00770         if (o == object) {
00771             TreePath path = tree.getSelectionPath();
00772             if (collapseAbove) {
00773                 Object[] objects = path.getPath();
00774                 for (int j = 0, k = 0; j < tree.getRowCount(); j++) {
00775                         tree.setSelectionRow(j);
00776                         if (objects[k] == tree.getLastSelectedPathComponent()) {
00777                             k++;
00778                             if (k == objects.length) break;
00779                         } else {
00780                             tree.collapseRow(j);
00781                         }
00782                     }
00783             }
00784             tree.scrollPathToVisible(path);
00785             return;
00786         } else {
00787             tree.expandRow(i);
00788         }
00789     }
00790 }
00791 /**
00792  * 
00793  */
00794 public void updateLeftTree() {
00795     if (CompilationManager.getExceptions().size() > 0) {
00796         DefaultMutableTreeNode root = new DefaultMutableTreeNode(BUI.sessions.getActiveSession().getName() + " -- Exception");
00797         Hashtable table = CompilationManager.getExceptions();
00798         for (Enumeration e = table.keys(); e.hasMoreElements();) {
00799             Object key = e.nextElement();
00800             DefaultMutableTreeNode node = new DefaultMutableTreeNode(key);
00801             root.add(node);
00802             Vector v = (Vector) table.get(key);
00803             for (Enumeration e2 = v.elements(); e2.hasMoreElements();) {
00804                 Exception ex = (Exception) e2.nextElement();
00805                 node.add(new DefaultMutableTreeNode(ex.getMessage()));
00806             }
00807         }
00808         getLeftTree().setRootVisible(true);
00809         getLeftTree().setModel(new DefaultTreeModel(root));
00810         getLeftScrollPane().validate();
00811         getLeftScrollPane().repaint();
00812         return;
00813     }
00814 
00815     String rootName = "root";
00816 
00817     if (BUI.sessions.getActiveSession() != null) {
00818         rootName = BUI.sessions.getActiveSession().getName();
00819         getLeftTree().setRootVisible(true);
00820     } else {
00821         getLeftTree().setRootVisible(false);
00822     }
00823     
00824     DefaultMutableTreeNode root = new DefaultMutableTreeNode(rootName);
00825     
00826     Hashtable compiledClasses = CompilationManager.getCompiledClasses();
00827     
00828     TreeSet pNames = new TreeSet();
00829     for (Enumeration e = compiledClasses.elements(); e.hasMoreElements();) {
00830         pNames.add(new Name(((SootClass) e.nextElement()).getName()).getSuperName());
00831     }
00832     
00833     for (Iterator i = pNames.iterator(); i.hasNext();) {
00834         try {
00835             Package p = Package.getPackage((Name) i.next());
00836             DefaultMutableTreeNode pNode = buildPackageNode(p);
00837             root.add(pNode);
00838         } catch (Exception e) {
00839         }
00840     }
00841     getLeftTree().setModel(new DefaultTreeModel(root));
00842     getLeftScrollPane().validate();
00843     getLeftScrollPane().repaint();
00844     updateRightTree((Object) null);
00845     getBUISplitPane().resetToPreferredSizes();
00846 }
00847 /**
00848  * 
00849  * @param sc ca.mcgill.sable.soot.SootClass
00850  */
00851 private void updateRightTree(SootClass sc) {
00852     DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
00853 
00854     for (Iterator i = PredicateSet.getDefinedPredicates(sc).iterator(); i.hasNext();) {
00855         root.add(new DefaultMutableTreeNode(i.next()));
00856     }
00857     
00858     root.add(buildClassNode(sc));
00859     showIconRightTree = true;
00860     getRightTree().setRootVisible(false);
00861     getRightTree().setModel(new DefaultTreeModel(root));
00862     getRightScrollPane().validate();
00863     getRightScrollPane().repaint();
00864 }
00865 /**
00866  * 
00867  * @param cda edu.ksu.cis.bandera.annotation.ConstructorDeclarationAnnotation
00868  */
00869 private void updateRightTree(ConstructorDeclarationAnnotation cda) {
00870     if (cda.getNode() == null) {
00871         updateRightTree("nocode");
00872         return;
00873     }
00874     
00875     DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
00876 
00877     for (Iterator i = PredicateSet.getDefinedPredicates(cda).iterator(); i.hasNext();) {
00878         root.add(new DefaultMutableTreeNode(i.next()));
00879     }
00880     for (Iterator i = AssertionSet.getDefinedAssertions(cda).iterator(); i.hasNext();) {
00881         root.add(new DefaultMutableTreeNode(i.next()));
00882     }
00883     
00884     root.add((DefaultMutableTreeNode) buildTree(cda).elementAt(0));
00885     
00886     JTree rightTree = getRightTree();
00887     rightTree.setRootVisible(false);
00888     rightTree.setModel(new DefaultTreeModel(root));
00889     for (int i = 0; i < rightTree.getRowCount(); i++) {
00890         rightTree.expandPath(rightTree.getPathForRow(i));
00891     }
00892     getRightScrollPane().validate();
00893     getRightScrollPane().repaint();
00894 }
00895 /**
00896  * 
00897  * @param fda edu.ksu.cis.bandera.annotation.FieldDeclarationAnnotation
00898  */
00899 private void updateRightTree(FieldDeclarationAnnotation fda) {
00900     showIconRightTree = false;
00901     getRightTree().setRootVisible(true);
00902     getRightTree().setModel(new DefaultTreeModel(new DefaultMutableTreeNode(fda)));
00903     getRightScrollPane().validate();
00904     getRightScrollPane().repaint();
00905 }
00906 /**
00907  * 
00908  * @param mda edu.ksu.cis.bandera.annotation.MethodDeclarationAnnotation
00909  */
00910 private void updateRightTree(MethodDeclarationAnnotation mda) {
00911     DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
00912 
00913     for (Iterator i = PredicateSet.getDefinedPredicates(mda).iterator(); i.hasNext();) {
00914         root.add(new DefaultMutableTreeNode(i.next()));
00915     }
00916     for (Iterator i = AssertionSet.getDefinedAssertions(mda).iterator(); i.hasNext();) {
00917         root.add(new DefaultMutableTreeNode(i.next()));
00918     }
00919     
00920     root.add((DefaultMutableTreeNode) buildTree(mda).elementAt(0));
00921     
00922     JTree rightTree = getRightTree();
00923     rightTree.setRootVisible(false);
00924     rightTree.setModel(new DefaultTreeModel(root));
00925     for (int i = 0; i < rightTree.getRowCount(); i++) {
00926         rightTree.expandPath(rightTree.getPathForRow(i));
00927     }
00928     getRightScrollPane().validate();
00929     getRightScrollPane().repaint();
00930 }
00931 /**
00932  * 
00933  * @param p edu.ksu.cis.bandera.jjjc.symboltable.Package
00934  */
00935 private void updateRightTree(Package p) {
00936     showIconRightTree = true;
00937     getRightTree().setRootVisible(true);
00938     getRightTree().setModel(new DefaultTreeModel(buildPackageNode(p)));
00939     getRightScrollPane().validate();
00940     getRightScrollPane().repaint();
00941 }
00942 /**
00943  * 
00944  * @param object java.lang.Object
00945  */
00946 public void updateRightTree(Object object) {
00947     showIconRightTree = false;
00948     if (object instanceof Package) {
00949         updateRightTree((Package) object);
00950     } else if (object instanceof SootClass) {
00951         updateRightTree((SootClass) object);
00952     } else if (object instanceof FieldDeclarationAnnotation) {
00953         updateRightTree((FieldDeclarationAnnotation) object);
00954     } else if (object instanceof ConstructorDeclarationAnnotation) {
00955         updateRightTree((ConstructorDeclarationAnnotation) object);
00956     } else if (object instanceof MethodDeclarationAnnotation) {
00957         updateRightTree((MethodDeclarationAnnotation) object);
00958     } else if ("nocode".equals(object)) {
00959         getRightTree().setRootVisible(true);
00960         getRightTree().setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Source code unavailable")));
00961         getRightScrollPane().validate();
00962         getRightScrollPane().repaint();
00963     } else {
00964         getRightTree().setRootVisible(false);
00965         getRightTree().setModel(new DefaultTreeModel(new DefaultMutableTreeNode("")));
00966         getRightScrollPane().validate();
00967         getRightScrollPane().repaint();
00968     }
00969 }
00970 }

Generated at Thu Feb 7 06:41:36 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001