/** * Adds a new view for the given lifeline to this view. * * @param lifeline the {@link Lifeline} a view is required for */ private void addLifelineView(Lifeline lifeline) { LayoutElement layoutElement = layout.getValue().get(lifeline); LifelineView lifelineView = new LifelineView(this, lifeline, layoutElement); addChild(lifelineView); lifelineView.setHandler(HandlerFactoryMessageView.INSTANCE.getLifelineViewHandler()); lifelines.put(lifeline, lifelineView); }
/** * Builds the visualization of this view. Takes care of initializing all contents and the actual * elements of the message view. */ private void build() { building = true; for (Lifeline lifeline : specification.getLifelines()) { LayoutElement layoutElement = layout.getValue().get(lifeline); // This should only happen for lifelines created outside TouchCORE, e.g., in the Eclipse // editor. if (layoutElement == null) { layoutElement = RamFactory.eINSTANCE.createLayoutElement(); layout.getValue().put(lifeline, layoutElement); } addLifelineView(lifeline); } buildFragments(specification); building = false; }