1 package csdl.jblanket.app.tree; 2 3 import csdl.jblanket.app.MethodCategoryColor; 4 5 import java.awt.Color ; 6 import java.util.List ; 7 8 18 public class MethodNode extends Node { 19 20 21 private Color origColor; 22 23 private Color newColor; 24 25 26 private boolean tested; 27 28 private List parameters; 29 30 37 public MethodNode(String name, List parameters) { 38 super(name); 39 40 this.origColor = Color.black; 41 this.newColor = null; 42 43 this.tested = false; 44 this.parameters = parameters; 45 } 46 47 52 public Color getNewColor() { 53 return this.newColor; 54 } 55 56 61 public Color getOrigColor() { 62 return this.origColor; 63 } 64 65 70 public boolean isIndividualExclude() { 71 return this.newColor == MethodCategoryColor.EXCLUDED_INDIVIDUAL.getColor(); 72 } 73 74 79 public boolean isTested() { 80 return this.tested; 81 } 82 83 88 public void setNewColor(Color color) { 89 this.newColor = color; 90 } 91 92 95 public void setOneLineMethod() { 96 this.origColor = MethodCategoryColor.ONE_LINE.getColor(); 97 this.newColor = MethodCategoryColor.ONE_LINE.getColor(); 98 } 99 100 103 public void setConstructor() { 104 this.origColor = MethodCategoryColor.CONSTRUCTOR.getColor(); 105 this.newColor = MethodCategoryColor.CONSTRUCTOR.getColor(); 106 } 107 108 111 public void setIndividualExclude() { 112 this.origColor = MethodCategoryColor.EXCLUDED_INDIVIDUAL.getColor(); 113 this.newColor = MethodCategoryColor.EXCLUDED_INDIVIDUAL.getColor(); 114 } 115 116 119 public void setTested() { 120 this.tested = true; 121 } 122 123 126 public void setUntested() { 127 this.tested = false; 128 } 129 130 135 public String toString() { 136 StringBuffer buffer = new StringBuffer (super.toString() + "("); 137 for (int i = 0; i < this.parameters.size(); i++) { 138 if (i > 0) { 139 buffer.append(", "); 140 } 141 buffer.append(this.parameters.get(i)); 142 } 143 buffer.append(")"); 144 return buffer.toString(); 145 } 146 } | Popular Tags |