Package org.eclipse.gmf.runtime.notation

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


          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

        .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

          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

    /* 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

    /* 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

  /**
   * @generated
   */
  public Diagram createDiagram(IAdaptable semanticAdapter,
      String diagramKind, PreferencesHint preferencesHint) {
    Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
    diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
    diagram.setType(DispelFunctionEditPart.MODEL_ID);
    diagram.setElement(getSemanticElement(semanticAdapter));
    diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
    return diagram;
  }
View Full Code Here

      throws CoreException {
    IDiagramDocument diagramDocument = (IDiagramDocument) document;
    TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
    if (element instanceof FileEditorInput) {
      IStorage storage = ((FileEditorInput) element).getStorage();
      Diagram diagram = DiagramIOUtil.load(domain, storage, true,
          getProgressMonitor());
      document.setContent(diagram);
    } else if (element instanceof URIEditorInput) {
      URI uri = ((URIEditorInput) element).getURI();
      Resource resource = null;
View Full Code Here

                "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
      }
      IDiagramDocument diagramDocument = (IDiagramDocument) document;
      final Resource newResource = diagramDocument.getEditingDomain()
          .getResourceSet().createResource(newResoruceURI);
      final Diagram diagramCopy = (Diagram) EcoreUtil
          .copy(diagramDocument.getDiagram());
      try {
        new AbstractTransactionalCommand(
            diagramDocument.getEditingDomain(),
            NLS.bind(
                Messages.DispelDocumentProvider_SaveAsOperation,
                diagramCopy.getName()), affectedFiles) {
          protected CommandResult doExecuteWithResult(
              IProgressMonitor monitor, IAdaptable info)
              throws ExecutionException {
            newResource.getContents().add(diagramCopy);
            return CommandResult.newOKCommandResult();
View Full Code Here

    protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
        IAdaptable info) throws ExecutionException {
      try {
       
//iFO       
        Diagram diagram = getDiagramToOpen();
        if (diagram == null) {
          diagram = intializeNewDiagram();
        }
        URI uri = EcoreUtil.getURI(diagram);
        String editorName = uri.lastSegment()
            + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
        IEditorInput editorInput = new URIEditorInput(uri, editorName);
        IWorkbenchPage page = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage();
        page.openEditor(editorInput, getEditorID());
        return CommandResult.newOKCommandResult();
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.notation.Diagram

Copyright © 2018 www.massapicom. 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.