/** * Builds the command which will execute the user-specified operations to create a new observation * point. * * @param diagramElement the clicked diagram element. * @param tool the tool to use to create the execution. * @param startingEndPredecessor the event end graphically preceding the starting position of the * new execution. * @param finishingEndPredecessor the event end graphically preceding the finishing position of * the new execution. * @return a command to create the execution. */ public static Command buildCreateObservationPointCommandFromTool( final DDiagramElement diagramElement, final ObservationPointCreationTool tool, final EventEnd startingEndPredecessor, final EventEnd finishingEndPredecessor) { NodeCreationCommandBuilder builder = new ObservationPointCreationCommandBuilder( tool, diagramElement, startingEndPredecessor, finishingEndPredecessor); Session session = SessionManager.INSTANCE.getSession(diagramElement.getTarget()); return getCommand(builder, session); }
/** * Get all the hidden existing diagram elements related to a semantic element. * * @param semanticElement Semantic element * @param containerView Container view * @return List of all existing diagram elements for the given semantic element which are * currently hidden in the diagram */ private List<DDiagramElement> getHiddenExistingDiagramElements( EObject semanticElement, DSemanticDecorator containerView) { final List<DDiagramElement> existingDiagramElements = Lists.newArrayList(); if (containerView instanceof DSemanticDiagram) { for (final DDiagramElement element : ((DSemanticDiagram) containerView).getDiagramElements()) { if (semanticElement.equals(element.getTarget())) { final DDiagramElementQuery query = new DDiagramElementQuery(element); if (query.isHidden()) { existingDiagramElements.add(element); } // Get the hidden parent container of the element to reveal, // in order to reveal all the // hierarchy existingDiagramElements.addAll(getHiddenParentContainerViews(element)); } } } return existingDiagramElements; }