de.fxdiagram.core/xtend-gen/de/fxdiagram/core/XConnection.java
protected void addOppositeListeners() {
    final ChangeListener<XNode> _function = (ObservableValue<? extends XNode> p, XNode oldSource, XNode newSource) -> {
      ObservableList<XConnection> _outgoingConnections = null;
      if (oldSource!=null) {
        _outgoingConnections=oldSource.getOutgoingConnections();
      }
      if (_outgoingConnections!=null) {
        _outgoingConnections.remove(this);
      }
      if (((!Objects.equal(newSource, null)) && (!newSource.getOutgoingConnections().contains(this)))) {
        newSource.getOutgoingConnections().add(this);
      }
      this.setNeedsLayout(true);
    };
    this.sourceProperty.addListener(_function);
    final ChangeListener<XNode> _function_1 = (ObservableValue<? extends XNode> p, XNode oldTarget, XNode newTarget) -> {
      ObservableList<XConnection> _incomingConnections = null;
      if (oldTarget!=null) {
        _incomingConnections=oldTarget.getIncomingConnections();
      }
      if (_incomingConnections!=null) {
        _incomingConnections.remove(this);
      }
      if (((!Objects.equal(newTarget, null)) && (!newTarget.getIncomingConnections().contains(this)))) {
        newTarget.getIncomingConnections().add(this);
      }
      this.setNeedsLayout(true);
    };
    this.targetProperty.addListener(_function_1);
    InitializingListListener<XConnectionLabel> _initializingListListener = new InitializingListListener<XConnectionLabel>();
    final Procedure1<InitializingListListener<XConnectionLabel>> _function_2 = (InitializingListListener<XConnectionLabel> it) -> {
      final Procedure1<XConnectionLabel> _function_3 = (XConnectionLabel it_1) -> {
        it_1.setConnection(this);
      };
      it.setAdd(_function_3);
      final Procedure1<XConnectionLabel> _function_4 = (XConnectionLabel it_1) -> {
        it_1.setConnection(null);
      };
      it.setRemove(_function_4);
    };
    InitializingListListener<XConnectionLabel> _doubleArrow = ObjectExtensions.<InitializingListListener<XConnectionLabel>>operator_doubleArrow(_initializingListListener, _function_2);
    this.labelsProperty.addListener(_doubleArrow);
  }
/**
   * Adds listeners that keep bi-directional references in sync
   */
Adds listeners that keep bi-directional references in sync
Adds listeners that keep bi - directional references in sync
protected void addOppositeListeners() {
    final ChangeListener<XNode> _function = (ObservableValue<? extends XNode> p, XNode oldSource, XNode newSource) -> {
      ObservableList<XConnection> _outgoingConnections = null;
      if (oldSource!=null) {
        _outgoingConnections=oldSource.getOutgoingConnections();
      }
      if (_outgoingConnections!=null) {
        _outgoingConnections.remove(this);
      }
      if (((!Objects.equal(newSource, null)) && (!newSource.getOutgoingConnections().contains(this)))) {
        newSource.getOutgoingConnections().add(this);
      }
      this.setNeedsLayout(true);
    };
    this.sourceProperty.addListener(_function);
    final ChangeListener<XNode> _function_1 = (ObservableValue<? extends XNode> p, XNode oldTarget, XNode newTarget) -> {
      ObservableList<XConnection> _incomingConnections = null;
      if (oldTarget!=null) {
        _incomingConnections=oldTarget.getIncomingConnections();
      }
      if (_incomingConnections!=null) {
        _incomingConnections.remove(this);
      }
      if (((!Objects.equal(newTarget, null)) && (!newTarget.getIncomingConnections().contains(this)))) {
        newTarget.getIncomingConnections().add(this);
      }
      this.setNeedsLayout(true);
    };
    this.targetProperty.addListener(_function_1);
    InitializingListListener<XConnectionLabel> _initializingListListener = new InitializingListListener<XConnectionLabel>();
    final Procedure1<InitializingListListener<XConnectionLabel>> _function_2 = (InitializingListListener<XConnectionLabel> it) -> {
      final Procedure1<XConnectionLabel> _function_3 = (XConnectionLabel it_1) -> {
        it_1.setConnection(this);
      };
      it.setAdd(_function_3);
      final Procedure1<XConnectionLabel> _function_4 = (XConnectionLabel it_1) -> {
        it_1.setConnection(null);
      };
      it.setRemove(_function_4);
    };
    InitializingListListener<XConnectionLabel> _doubleArrow = ObjectExtensions.<InitializingListListener<XConnectionLabel>>operator_doubleArrow(_initializingListListener, _function_2);
    this.labelsProperty.addListener(_doubleArrow);
  }
protected void addOppositeListeners ( ) { final ChangeListener < XNode > _function = ( ObservableValue < ? extends XNode > p , XNode oldSource , XNode newSource ) -> { ObservableList < XConnection > _outgoingConnections = null ; if ( oldSource != null ) { _outgoingConnections = oldSource . getOutgoingConnections ( ) ; } if ( _outgoingConnections != null ) { _outgoingConnections . remove ( this ) ; } if ( ( ( ! Objects . equal ( newSource , null ) ) && ( ! newSource . getOutgoingConnections ( ) . contains ( this ) ) ) ) { newSource . getOutgoingConnections ( ) . add ( this ) ; } this . setNeedsLayout ( true ) ; } ; this . sourceProperty . addListener ( _function ) ; final ChangeListener < XNode > _function_1 = ( ObservableValue < ? extends XNode > p , XNode oldTarget , XNode newTarget ) -> { ObservableList < XConnection > _incomingConnections = null ; if ( oldTarget != null ) { _incomingConnections = oldTarget . getIncomingConnections ( ) ; } if ( _incomingConnections != null ) { _incomingConnections . remove ( this ) ; } if ( ( ( ! Objects . equal ( newTarget , null ) ) && ( ! newTarget . getIncomingConnections ( ) . contains ( this ) ) ) ) { newTarget . getIncomingConnections ( ) . add ( this ) ; } this . setNeedsLayout ( true ) ; } ; this . targetProperty . addListener ( _function_1 ) ; InitializingListListener < XConnectionLabel > _initializingListListener = new InitializingListListener < XConnectionLabel > ( ) ; final Procedure1 < InitializingListListener < XConnectionLabel > > _function_2 = ( InitializingListListener < XConnectionLabel > it ) -> { final Procedure1 < XConnectionLabel > _function_3 = ( XConnectionLabel it_1 ) -> { it_1 . setConnection ( this ) ; } ; it . setAdd ( _function_3 ) ; final Procedure1 < XConnectionLabel > _function_4 = ( XConnectionLabel it_1 ) -> { it_1 . setConnection ( null ) ; } ; it . setRemove ( _function_4 ) ; } ; InitializingListListener < XConnectionLabel > _doubleArrow = ObjectExtensions . < InitializingListListener < XConnectionLabel > > operator_doubleArrow ( _initializingListListener , _function_2 ) ; this . labelsProperty . addListener ( _doubleArrow ) ; }
Adds listeners that keep bi-directional references in sync
Adds listeners that keep bi - directional references in sync