001: /* Soot - a J*va Optimization Framework
002: * Copyright (C) 2004 Jennifer Lhotak
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the
016: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
017: * Boston, MA 02111-1307, USA.
018: */
019:
020: package ca.mcgill.sable.soot.callgraph;
021:
022: import ca.mcgill.sable.graph.model.*;
023: import soot.*;
024:
025: public class CallGraphNode extends SimpleNode {
026:
027: private CallGraphGenerator generator;
028: private boolean expand = true;
029: private boolean expandCollape = false;
030: private boolean collapse = false;
031:
032: public boolean isLeaf() {
033: if ((getOutputs() == null) || (getOutputs().size() == 0))
034: return true;
035: return false;
036: }
037:
038: public CallGraphNode() {
039: super ();
040: }
041:
042: public void setData(Object obj) {
043: if (obj instanceof SootMethod) {
044: data = obj;
045: firePropertyChange(DATA, obj);
046: }
047: }
048:
049: /**
050: * @return
051: */
052: public CallGraphGenerator getGenerator() {
053: return generator;
054: }
055:
056: /**
057: * @param generator
058: */
059: public void setGenerator(CallGraphGenerator generator) {
060: this .generator = generator;
061: }
062:
063: /**
064: * @return
065: */
066: public boolean isExpand() {
067: return expand;
068: }
069:
070: /**
071: * @param b
072: */
073: public void setExpand(boolean b) {
074: expand = b;
075: }
076:
077: /**
078: * @return
079: */
080: public boolean isCollapse() {
081: return collapse;
082: }
083:
084: /**
085: * @return
086: */
087: public boolean isExpandCollape() {
088: return expandCollape;
089: }
090:
091: /**
092: * @param b
093: */
094: public void setCollapse(boolean b) {
095: collapse = b;
096: }
097:
098: /**
099: * @param b
100: */
101: public void setExpandCollape(boolean b) {
102: expandCollape = b;
103: }
104:
105: }
|