/** * Removes the combined fragment from this view. Removes the combined fragment from all covered * lifeline views. * * @param combinedFragment the {@link CombinedFragment} to remove */ private void removeCombinedFragment(CombinedFragment combinedFragment) { CombinedFragmentView combinedFragmentView = combinedFragments.remove(combinedFragment); // For debug purpose only. if (combinedFragmentView == null) { System.err.println( "Should not happen: Something went wrong in the order of removing objects."); } for (Lifeline lifeline : combinedFragment.getCovered()) { LifelineView lifelineView = lifelines.get(lifeline); lifelineView.removeCombinedFragment(combinedFragment); } removeChild(combinedFragmentView); combinedFragmentView.destroy(); layoutMessageView(); }