public void removeComponent( Component component ) { boolean removed = this.components.remove( component ); if ( removed ) { component.setInteraction( null ); } }
public void removeComponent( Component component ) { boolean removed = this.components.remove( component ); if ( removed ) { component.setInteraction( null ); } }
public void addComponent( Component component ) { // make sure we don't add twice the same instance, but still allow multiple components with same data attached. for ( Component c : components ) { if( c == component ){ return; } } this.components.add( component ); component.setInteraction( this ); }
public void removeComponent( Component component ) { boolean removed = this.components.remove( component ); if ( removed ) { component.setInteraction( null ); } }
public void addComponent( Component component ) { // make sure we don't add twice the same instance, but still allow multiple components with same data attached. for ( Component c : components ) { if( c == component ){ return; } } this.components.add( component ); component.setInteraction( this ); }
public void addComponent( Component component ) { if ( !this.components.contains( component ) ) { this.components.add( component ); component.setInteraction( this ); } }
public Interaction createInteraction(Interactor ... interactors) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); Experiment experiment = createExperimentEmpty(); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experiment)), cvInteractionType, intType, "temp", getInstitution()); Component[] components = new Component[interactors.length]; for (int i=0; i<interactors.length; i++) { components[i] = createComponentNeutral(interaction, interactors[i]); components[i].setInteraction(null); } return createInteraction(components); }
public Interaction createInteraction(Interactor ... interactors) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION); Experiment experiment = createExperimentEmpty(); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experiment)), cvInteractionType, intType, "temp", getInstitution()); Component[] components = new Component[interactors.length]; for (int i=0; i<interactors.length; i++) { components[i] = createComponentNeutral(interaction, interactors[i]); components[i].setInteraction(null); } return createInteraction(components); }
protected void syncComponents(Interaction intactObject) { ComponentPersister compPersister = ComponentPersister.getInstance(); List<Component> components = new ArrayList<Component>(intactObject.getComponents().size()); for (Component component : intactObject.getComponents()) { Component c = compPersister.syncIfTransient(component); c.setInteraction(intactObject); c.setInteractor( component.getInteractor() ); components.add(c); } // for (Component c : components) { // c.setInteraction(intactObject); // } intactObject.setComponents(components); }
component.setInteraction(interaction);
@Override protected T syncAttributes(T intactObject) { if (intactObject.getBioSource() != null) { BioSource syncedBioSource = BioSourcePersister.getInstance().syncIfTransient(intactObject.getBioSource()); intactObject.setBioSource(syncedBioSource); } if (intactObject.getCvInteractorType() != null) { CvInteractorType cvIntType = (CvInteractorType) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteractorType()); intactObject.setCvInteractorType(cvIntType); } if ( intactObject.getActiveInstances() != null ) { Collection<Component> components = new ArrayList<Component>( intactObject.getActiveInstances().size() ); for ( Component component : intactObject.getActiveInstances() ) { final Component c = ComponentPersister.getInstance().syncIfTransient( component ); c.setInteractor( intactObject ); c.setInteraction( component.getInteraction() ); components.add( c ); } intactObject.setActiveInstances( components ); } return super.syncAttributes(intactObject); }
component.setInteraction( synchronize( component.getInteraction() ) ); component.setInteractor( synchronize( component.getInteractor() ) );
component.setInteraction( synchronize( component.getInteraction() ) ); component.setInteractor( synchronize( component.getInteractor() ) );
clone.setInteraction(clone(component.getInteraction())); clone.setCvBiologicalRole(clone(component.getCvBiologicalRole()));
clone.setInteraction(clone(component.getInteraction())); clone.setCvBiologicalRole(clone(component.getCvBiologicalRole()));
clonedComp.setInteraction(clone); clone.getComponents().add(clonedComp);
clonedComp.setInteraction(clone); clone.getComponents().add(clonedComp);