Skip to content

Commit 26a69c1

Browse files
author
lhwlyd
committed
add the interactive class constructer paint comp
1 parent e26148a commit 26a69c1

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

src/paintcomponents/java/interactive/ClassConstructorPaintComponent.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public Object provideInformationToDataFromPoint(
100100

101101
/**
102102
* Check whether the data is good to return from this component
103+
* @param dataFromPoint
103104
* @return the return value
104105
*/
105106
@Override
@@ -108,7 +109,27 @@ public boolean canProvideInformationToDataFromPoint(
108109

109110
return returnVal != null;
110111
}
111-
112+
113+
/**
114+
* Retrieve the instance of what this component manipulated.
115+
* @param dataFromPoint
116+
* @return that instance
117+
*/
118+
public Object provideInstanceToDataFromPoint(
119+
DataFromPoint dataFromPoint){
120+
return instance;
121+
}
122+
123+
/**
124+
* Check whether there's an instance to retrieve
125+
* @param dataFromPoint
126+
* @return true if there is, false if not
127+
*/
128+
public boolean canProvideInstanceToDataFromPoint(
129+
DataFromPoint dataFromPoint){
130+
return instance != null;
131+
}
132+
112133
@Override
113134
public void saveToElement(Element rootElement, Document doc) {
114135
super.saveToElement(rootElement, doc);

0 commit comments

Comments
 (0)