private void removePortsFromArcs ( List < Arc > arcs ) { for ( Arc arc : arcs ) { // If source is port, first clear port indicators else retrieve it from hashmaps if ( arc . getSource ( ) instanceof Port ) { Glyph source = portIDToOwnerGlyph . get ( ( ( Port ) arc . getSource ( ) ) . getId ( ) ) ; arc . setSource ( source ) ; } // If target is port, first clear port indicators else retrieve it from hashmaps if ( arc . getTarget ( ) instanceof Port ) { Glyph target = portIDToOwnerGlyph . get ( ( ( Port ) arc . getTarget ( ) ) . getId ( ) ) ; arc . setTarget ( target ) ; } } }
This method replaces ports of arc objects with their owners .