Examples of Diagram


Examples of org.eclipse.gmf.runtime.notation.Diagram

        } else if (selectedElement instanceof IAdaptable) {
          selectedElement = ((IAdaptable) selectedElement)
              .getAdapter(View.class);
        }
        if (selectedElement instanceof Diagram) {
          Diagram diagram = (Diagram) selectedElement;
          if (OntoUML.diagram.edit.parts.ContainerEditPart.MODEL_ID
              .equals(OntoUML.diagram.part.OntoUMLVisualIDRegistry
                  .getModelID(diagram))) {
            myDiagram = diagram;
          }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    IGraphicalEditPart editPart = (IGraphicalEditPart) host
        .getAdapter(IGraphicalEditPart.class);
    if (editPart == null) {
      return null;
    }
    Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
    Collection elements = new HashSet();
    for (Iterator it = diagram.getElement().eAllContents(); it.hasNext();) {
      EObject element = (EObject) it.next();
      if (isApplicableElement(element, types)) {
        elements.add(element);
      }
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

          IProgressMonitor monitor, IAdaptable info)
          throws ExecutionException {
        OntoUML.Container model = createInitialModel();
        attachModelToResource(model, modelResource);

        Diagram diagram = ViewService
            .createDiagram(
                model,
                OntoUML.diagram.edit.parts.ContainerEditPart.MODEL_ID,
                OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
        if (diagram != null) {
          diagramResource.getContents().add(diagram);
          diagram.setName(diagramName);
          diagram.setElement(model);
        }

        try {
          modelResource
              .save(OntoUML.diagram.part.OntoUMLDiagramEditorUtil
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

        int diagramVID = options.getDiagramVisualID(modelFile, modelRoot);
        if (diagramVID != options.visualId) {
          return CommandResult
              .newErrorCommandResult(options.errorMessage);
        }
        Diagram diagram = ViewService.createDiagram(
            modelRoot,
            options.modelId,
            options.prefHint);
        diagramResource.getContents().add(diagram);
        return CommandResult.newOKCommandResult();
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    protected Diagram getDiagramToOpen() {
      return diagramFacet.getDiagramLink();
    }

    protected Diagram intializeNewDiagram() throws ExecutionException {
      Diagram d = ViewService.createDiagram(getDiagramDomainElement(),
          getDiagramKind(), getPreferencesHint());
      if (d == null) {
        throw new ExecutionException(
            "Can't create diagram of '"+ getDiagramKind()
            + "' kind"
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

   * @generated
   */
  private Collection getDiagramLinksByType(Collection diagrams, String type) {
    Collection result = new ArrayList();
    for (Iterator it = diagrams.iterator(); it.hasNext();) {
      Diagram nextDiagram = (Diagram) it.next();
      result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

          IProgressMonitor monitor, IAdaptable info)
          throws ExecutionException {
        Package model = createInitialModel();
        attachModelToResource(model, modelResource);

        Diagram diagram = ViewService.createDiagram(model,
            PackageEditPart.MODEL_ID,
            DispelDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
        if (diagram != null) {
          diagramResource.getContents().add(diagram);
          diagram.setName(diagramName);
          diagram.setElement(model);
        }

        try {
          modelResource
              .save(eu.admire.workbench.pd.packages.diagram.part.DispelDiagramEditorUtil
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

        .getInstance().getDocumentProvider()
        .getDiagramDocument(anInput);
    if (document == null) {
      return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
      eu.admire.visual.pmml.treemodel._40.diagram.navigator.PMMLNavigatorItem item = new eu.admire.visual.pmml.treemodel._40.diagram.navigator.PMMLNavigatorItem(
          diagram, file, false);
      return new StructuredSelection(item);
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

          IProgressMonitor monitor, IAdaptable info)
          throws ExecutionException {
        org.dmg.pmml._40.TreeModelType model = createInitialModel();
        attachModelToResource(model, modelResource);

        Diagram diagram = ViewService
            .createDiagram(
                model,
                eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.TreeModelTypeEditPart.MODEL_ID,
                eu.admire.visual.pmml.treemodel._40.diagram.part.PMMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
        if (diagram != null) {
          diagramResource.getContents().add(diagram);
          diagram.setName(diagramName);
          diagram.setElement(model);
        }

        try {
          modelResource
              .save(eu.admire.visual.pmml.treemodel._40.diagram.part.PMMLDiagramEditorUtil
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    /* Get selection */
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

    // Get selection from the window
    final ISelection selection = window.getSelectionService().getSelection();
        Diagram diagramView = null;
       
        // get the editing domain
        if (selection instanceof IStructuredSelection) {

            IStructuredSelection structuredSelection = (IStructuredSelection) selection;

            // Walk selection
            for (Iterator i = structuredSelection.iterator(); i.hasNext();) {

                // Try to adapt the selection to a view
                Object selectedObject = i.next();
                if (selectedObject instanceof IAdaptable) {

                    // Try to get a View (new notation)
                    Object object = ((IAdaptable) selectedObject)
                        .getAdapter(View.class);
                   
                    diagramView = ((View)object).getDiagram();
                }
            }
        }
       
        if (diagramView != null) {
            final Diagram diag = diagramView;
           

           
            TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagramView);
            AbstractEMFOperation operation = new AbstractEMFOperation(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.