/** * Move uma realizacão inteira. * * @param realization - Realização a ser movida * @param client - Novo Cliente * @param supplier - Novo Supplier */ public void moveRealization( RealizationRelationship realization, Element client, Element supplier) { realization.getClient().removeRelationship(realization); realization.getSupplier().removeRelationship(realization); realization.setClient(client); realization.setSupplier(supplier); client.addRelationship(realization); supplier.addRelationship(realization); }
public RealizationRelationship(Element client, Element supplier, String name, String id) { setClient(client); setSupplier(supplier); setId(id); super.setName(name); super.setType(ElementsTypes.REALIZATION); if ((client instanceof Package) && (supplier instanceof Interface)) { ((Package) client).addImplementedInterface((Interface) supplier); } if ((client instanceof Class) && (supplier instanceof Interface)) { ((Class) client).addImplementedInterface((Interface) supplier); } }
/** * Move o supplier de uma {@link RealizationRelationship} para outro elemento (Classe ou Package). * * @param realization * @param newSupplier */ public void moveRealizationSupplier(RealizationRelationship realization, Element newSupplier) { realization.getSupplier().removeRelationship(realization); realization.setSupplier(newSupplier); newSupplier.addRelationship(realization); }