Skip to content

Commit 478f353

Browse files
committed
added setDirtyOnValueChange()
1 parent f5185a0 commit 478f353

File tree

1 file changed

+10
-7
lines changed
  • src/main/java/com/marginallyclever/nodegraphcore/port

1 file changed

+10
-7
lines changed

src/main/java/com/marginallyclever/nodegraphcore/port/Port.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,16 @@ public boolean isValidType(Object arg0) {
115115
*/
116116
@SuppressWarnings("unchecked")
117117
public void setValue(Object arg0) {
118-
if(isValidType(arg0)) {
119-
if(value!=null && !value.equals(arg0)) {
120-
isDirty = true;
121-
} else if(arg0 != null) {
122-
isDirty = true;
123-
}
124-
value = (T)arg0;
118+
if(!isValidType(arg0)) return;
119+
setDirtyOnValueChange(arg0);
120+
value = (T)arg0;
121+
}
122+
123+
protected void setDirtyOnValueChange(Object arg0) {
124+
if(value!=null) {
125+
if(!value.equals(arg0)) isDirty = true;
126+
} else if(arg0 != null) {
127+
isDirty = true;
125128
}
126129
}
127130

0 commit comments

Comments
 (0)