@RelatedSetObj(Plant3D.URIs.HasNext)
public void setNext(PipelineComponent comp) {
if (next == comp)
- return;
+ return;
if (this.next != null)
- this.next._removeRef(this);
- this.next = comp;
- this.syncnext = false;
- if (DEBUG) System.out.println(this + " next " + comp);
- syncNext();
- firePropertyChanged(Plant3D.URIs.HasNext);
- if (comp != null)
- comp.sync();
-
+ this.next._removeRef(this);
+ _setNext(comp);
+ this.syncnext = false;
+ if (DEBUG) System.out.println(this + " next " + comp);
+ syncNext();
+ firePropertyChanged(Plant3D.URIs.HasNext);
+ if (comp != null)
+ comp.sync();
+ }
+
+ protected void _setNext(PipelineComponent comp) {
+ this.next = comp;
}
return;
if (this.previous != null)
this.previous._removeRef(this);
- this.previous = comp;
+ _setPrevious(comp);
this.syncprev = false;
if (DEBUG) System.out.println(this + " prev " + comp);
syncPrevious();
firePropertyChanged(Plant3D.URIs.HasPrevious);
if (comp != null)
comp.sync();
-
}
+
+ protected void _setPrevious(PipelineComponent comp) {
+ this.previous = comp;
+ }
+
private PipelineComponent branch0;
@RelatedGetObj(Plant3D.URIs.HasBranch0)
// Control point structure is left into illegal state.
private void _removeRef(PipelineComponent comp) {
if (next == comp) {
- next = null;
+ _setNext(null);
syncnext = false;
if (DEBUG) System.out.println(this + " remove next " + comp);
firePropertyChanged(Plant3D.URIs.HasNext);
syncNext();
} else if (previous == comp) {
- previous = null;
+ _setPrevious(null);
syncprev = false;
if (DEBUG) System.out.println(this + " remove prev " + comp);
firePropertyChanged(Plant3D.URIs.HasPrevious);