Skip to content

Commit f83bd54

Browse files
author
lhwlyd
committed
add some comments
1 parent ac572c9 commit f83bd54

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/paintcomponents/java/interactive/ClassConstructorPaintComponent.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@
2222
import typesystem.JavaType;
2323
import ui.PaintPanel;
2424

25+
/*
26+
* This is the interactive constructor paint component, must call evaluate
27+
* to update the instance this component manipulates before use the output.
28+
*/
2529
public class ClassConstructorPaintComponent extends DataTextIOPaintComponent
2630
implements DataFromPointDataProvider {
2731

2832
private Constructor displayingConstructor;
33+
//Store a reference to the object this component operates.
2934
private Object instance;
3035

3136

src/paintcomponents/java/interactive/MethodPaintComponent.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@
2222
import typesystem.JavaType;
2323
import ui.PaintPanel;
2424

25+
/*
26+
* This is the interactive method paint component, must call the evaluate
27+
* method to calculate the data inside before trying to get data from this
28+
* component.
29+
*/
2530
public class MethodPaintComponent extends DataTextIOPaintComponent
2631
implements DataFromPointDataProvider {
2732

2833
private Method displayingMethod;
34+
//The data stored
2935
private Object returnVal;
36+
//Store an instance of the object this method manipulates
3037
private Object instance;
3138

3239
public MethodPaintComponent(Method displayingMethod, Object instance, int x, int y) {
@@ -87,6 +94,7 @@ public void evaluate(DataFromPoint dataFromPoint){
8794
// args takes toPoint 1 to size
8895
Object[] args = new Object[toPoints.size() - 1];
8996

97+
//Get the input data from each the input points
9098
for (int i = 0; i < toPoints.size() - 1; i++) {
9199
DataToPoint toPoint = toPoints.get(i+1);
92100
try {

0 commit comments

Comments
 (0)