• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DiagramEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.graphiti.ui.editor.DiagramEditor的典型用法代码示例。如果您正苦于以下问题:Java DiagramEditor类的具体用法?Java DiagramEditor怎么用?Java DiagramEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DiagramEditor类属于org.eclipse.graphiti.ui.editor包,在下文中一共展示了DiagramEditor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAdapter

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
	if (GFPreferences.getInstance().isGenericOutlineActive()) {
		if (IContentOutlinePage.class.equals(adapterType)) {
			if (adaptableObject instanceof DiagramEditor) {
				DiagramEditor diagramEditor = (DiagramEditor) adaptableObject;
				if (diagramEditor.getConfigurationProvider() != null) { // diagram editor initialized?
					GraphicsEditorOutlinePage outlinePage = new GraphicsEditorOutlinePage(new TreeViewer(), diagramEditor
							.getGraphicalViewer(), diagramEditor.getActionRegistryInternal(), diagramEditor.getEditDomain(),
							diagramEditor.getCommonKeyHandler(), diagramEditor.getAdapter(ZoomManager.class), diagramEditor
									.getSelectionSynchronizerInternal(), diagramEditor);
					return outlinePage;
				}
			}
		}
	}
	return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:ContentOutlinePageAdapterFactory.java


示例2: getCustomServiceTasks

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * Gets a list of {@link CustomServiceTask} objects based on the
 * {@link TabbedPropertySheetPage} provided.
 * 
 * @param tabbedPropertySheetPage
 *          the property sheet page linked to a diagram in a project that has
 *          {@link CustomServiceTask}s defined
 * @return a list of all {@link CustomServiceTask}s or an empty list if none
 *         were found
 */
public static List<CustomServiceTask> getCustomServiceTasks(final TabbedPropertySheetPage tabbedPropertySheetPage) {

  // Determine the part the property sheet page is in
  final IWorkbenchPart part = tabbedPropertySheetPage.getSite().getWorkbenchWindow().getPartService().getActivePart();

  // If the part is a diagram editor, get the project from the diagram
  if (part instanceof DiagramEditor) {
    final DiagramEditor editor = (DiagramEditor) part;
    final IProject project = ActivitiUiUtil.getProjectFromDiagram(editor.getDiagramTypeProvider().getDiagram());

    // Determine the custom service tasks using the project found
    return getCustomServiceTasks(project);
  }

  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:ExtensionUtil.java


示例3: refresh

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void refresh() {
	EObject be = getBusinessObjectForSelection(getSelection());
	
	if (be!=null) {
		AbstractFixFlowComposite sectionRoot = getSectionRoot();
		if (sectionRoot!=null) {
			if (sectionRoot.getBusinessObject() != be) {
				sectionRoot.setDiagramEditor((DiagramEditor) getDiagramEditor());
				if (!parent.isLayoutDeferred())
					parent.setLayoutDeferred(true);
				sectionRoot.setBusinessObject(be);
				if (parent.isLayoutDeferred())
					parent.setLayoutDeferred(false);
			}
			sectionRoot.refresh();
		}
	}
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:20,代码来源:AbstractFixFlowPropertySection.java


示例4: start

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * This method is called upon plug-in activation.
 * 
 * @param context
 *          the context
 * 
 * @throws Exception
 *           the exception
 */
@Override
public void start(BundleContext context) throws Exception {
  super.start(context);

  IAdapterManager manager = Platform.getAdapterManager();
  manager.registerAdapters(new ContentOutlinePageAdapterFactory(), DiagramEditor.class);

  // Initialize the image cache
  imageCache = new ImageCache();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:ActivitiPlugin.java


示例5: removePressed

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * Notifies that the Remove button has been pressed.
 */
private void removePressed() {
	PictogramElement pe = getSelectedPictogramElement();
      if (pe != null) {
        Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
        if (bo instanceof Activity) {
          DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
          TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
          ActivitiUiUtil.runModelChange(new Runnable() {

            public void run() {
	Object bobj = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(getSelectedPictogramElement());
	if (bobj == null) {
         return;
       }
	else{
		//get the selected action
		Activity activity= (Activity)bobj;
		List<ActivityAction> availableActions =activity.getActivityActions();
		for(TableItem temp:table.getItems()){
			if(temp.getChecked()){
				for(ActivityAction aa:availableActions){
					if(temp.getText(3).equals(aa.getActionName())){
						aa.getPermissions().remove(0);
						activity.getActivityActions().remove(aa);
						break;
					}
				}
			}
		}			
		displayPermissions(activity);			
			      
           }
            }
    }, editingDomain, "Model Update");
  }

}
	
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:43,代码来源:PropertyRbacSection.java


示例6: focusLost

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void focusLost(final FocusEvent e) {
  PictogramElement pe = getSelectedPictogramElement();
    if (pe == null) return;
    
    Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
    if (bo instanceof Activity == false) return;
    final Activity activity = (Activity) bo;
    
	DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
	TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
	ActivitiUiUtil.runModelChange(new Runnable() {
		public void run() {
		  
			if (loopCardinaltyText.getText() != null) {
			  getMultiInstanceDef(activity).setLoopCardinality(loopCardinaltyText.getText());
			}
			
			if (collectionText.getText() != null) {
          getMultiInstanceDef(activity).setInputDataItem(collectionText.getText());
        }
			
			if (elementVariableText.getText() != null) {
          getMultiInstanceDef(activity).setElementVariable(elementVariableText.getText());
        }
			
			if (completionConditionText.getText() != null) {
          getMultiInstanceDef(activity).setCompletionCondition(completionConditionText.getText());
        }
		}
	}, editingDomain, "Model Update");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:32,代码来源:PropertyMultiInstanceSection.java


示例7: focusLost

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void focusLost(final FocusEvent e) {
	DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
	TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
	ActivitiUiUtil.runModelChange(new Runnable() {
		public void run() {
			org.eclipse.bpmn2.Process process = ActivitiUiUtil.getProcessObject(getDiagram());
			if (process == null) {
				return;
			}
			
			String id = idText.getText();
			if (id != null) {
			  process.setId(id);
			} else {
				process.setId("");
			}
			
			String name = nameText.getText();
			if (name != null) {
				process.setName(name);
			} else {
				process.setName("");
			}
			
			String namespace = namespaceText.getText();
			if (namespace != null) {
				process.setNamespace(namespace);
			} else {
				process.setNamespace("");
			}
			
			String documentation = documentationText.getText();
			if (documentation != null) {
				process.getDocumentation().get(0).setText(documentation);
			} else {
				process.getDocumentation().get(0).setText("");
			}
		}
	}, editingDomain, "Model Update");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:41,代码来源:PropertyDiagramSection.java


示例8: runModelChange

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void runModelChange(final Runnable runnable) {
  PictogramElement pe = getSelectedPictogramElement();
  if (pe != null) {
    Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
    if (bo instanceof ServiceTask) {
      DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
      TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
      ActivitiUiUtil.runModelChange(runnable, editingDomain, "Model Update");
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:PropertyCustomServiceTaskSection.java


示例9: getActionRegistry

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * Gets the {@link ActionRegistry} for the currently active editor.
 * 
 * @return the ActionRegistry or null
 */
public static final ActionRegistry getActionRegistry() {
  IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (part instanceof DiagramEditor) {
    DiagramEditor editor = (DiagramEditor) part;
    return editor.getActionRegistryInternal();
  }
  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:ActivitiUiUtil.java


示例10: getTargetRuntime

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
private TargetRuntime getTargetRuntime(EObject object) {
	DiagramEditor editor = ModelUtil.getDiagramEditor(object);
	if (editor!=null) {
		return (TargetRuntime) editor.getAdapter(TargetRuntime.class);
	}
	return null;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:8,代码来源:FoxBPMPropertyLabelProvider.java


示例11: setInput

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void setInput(IWorkbenchPart part, ISelection selection) {
	super.setInput(part, selection);
	Object bpmn2Editor = part.getAdapter(DiagramEditor.class);
	if (bpmn2Editor instanceof DiagramEditor) {
		editor = (DiagramEditor)bpmn2Editor;
	}
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:9,代码来源:AbstractFixFlowPropertySection.java


示例12: appliesTo

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
	if (part instanceof ContentOutline) {
		ContentOutline outline = (ContentOutline)part;
		IContributedContentsView v = (IContributedContentsView)outline.getAdapter(IContributedContentsView.class);
		if (v!=null)
			part = v.getContributingPart();
	}
	editor = (DiagramEditor)part.getAdapter(DiagramEditor.class);
	
	if (editor!=null) {
		return true;
	}
	return false;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:16,代码来源:AbstractFixFlowPropertySection.java


示例13: NewStatemachineWizard

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public NewStatemachineWizard() {
  super("State Machine Graphiti", "statemachine_graphiti", "statemachine", "statemachine", DiagramEditor.DIAGRAM_EDITOR_ID);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:4,代码来源:NewStatemachineWizard.java


示例14: SyncObjects

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
protected SyncObjects(final Connection connection, final DiagramEditor diagramEditor) {
	this.graphicalRepresentation = connection;
	this.diagramEditor = diagramEditor;
	setup();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:6,代码来源:SequenceFlowSynchronizer.java


示例15: refresh

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
public void refresh() {
	
	// try to get the roles if combo is still empty
	if (roleCombo.getItems().length == 0) {
		for (Role role : SecurityUtil.getRoles(getDiagram())) {
			roleCombo.add(role.getName());
		}
	}

	// update task IO specifications
	System.out.print("[SCVM-BPMN] updating task IO specifications...");
	final Diagram diagram = getDiagram();

	DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
	TransactionalEditingDomain editingDomain = diagramEditor
			.getEditingDomain();
	ActivitiUiUtil.runModelChange(new Runnable() {
		public void run() {
			final List<Task> tasks = new ArrayList<Task>();
			for (EObject obj : diagram.eResource().getContents()) {
				if (obj instanceof Task) {
					tasks.add((Task) obj);
				}
			}

			for (Task t : tasks) {
				NeedToKnowUtil.updateIOSpecification(t, diagram);
			}
		}
	}, editingDomain, "Model Update");
	System.out.println("done!");

	// refresh process variable combo box
	List<String> accessedProcessVariables = new ArrayList<String>();
	;

	PictogramElement pe = getSelectedPictogramElement();
	if (pe != null) {
		Object bo = Graphiti.getLinkService()
				.getBusinessObjectForLinkedPictogramElement(pe);
		if (bo instanceof UserTask) {
			accessedProcessVariables = NeedToKnowUtil
					.getAccessedProcessVariableNames((UserTask) bo);
			updateTable((Activity) bo);
		} else if (bo instanceof ServiceTask) {
			accessedProcessVariables = NeedToKnowUtil
					.getAccessedProcessVariableNames((ServiceTask) bo);
			updateTable((Activity) bo);
		}
	} else {
		return;
	}

	processVariableCombo.removeAll();
	for (String processVariableName : accessedProcessVariables) {
		processVariableCombo.add(processVariableName);
	}

}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:61,代码来源:PropertyNtkSection.java


示例16: setDiagramEditor

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void setDiagramEditor(DiagramEditor diagramEditor) {
	this.diagramEditor = diagramEditor;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:4,代码来源:AbstractFixFlowComposite.java


示例17: partActivated

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
public void partActivated(IWorkbenchPart part) {
	Object bpmn2Editor = part.getAdapter(DiagramEditor.class);
	if (bpmn2Editor instanceof DiagramEditor) {
		editor = (DiagramEditor)bpmn2Editor;
	}
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:7,代码来源:AbstractFixFlowPropertySection.java


示例18: getDiagramEditor

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
@Override
protected DiagramEditor getDiagramEditor() {
	return editor;
}
 
开发者ID:FoxBPM,项目名称:FoxBPM-Designer,代码行数:5,代码来源:AbstractFixFlowPropertySection.java


示例19: GraphicsEditorOutlinePage

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * Creates a new GraphicsEditorOutlinePage. It is important, that this
 * outline page uses the same handlers (ActionRegistry, KeyHandler,
 * ZoomManagerAdapter, ...) as the main editor, so that the behaviour is
 * synchronized between them.
 * 
 * @param viewer
 *            The viewer (typically a tree-viewer) for the hierarchical
 *            outline.
 * @param graphicalViewer
 *            The GraphicalViewer for the Thumbnail.
 * @param actionRegistry
 *            The ActionRegistry to find/register Actions.
 * @param editDomain
 *            The EditDomain to use for Commands.
 * @param keyHandler
 *            The KeyHandler to use.
 * @param zoomManagerAdapter
 *            The ZoomManagerAdapter to use for the Thumbnail-Display.
 * @param selectionSynchronizer
 *            The selection-synchronizer for the main-editor and this
 *            outline page.
 * @param configurationProviderHolder
 *            the configuration provider holder
 */
public GraphicsEditorOutlinePage(EditPartViewer viewer, GraphicalViewer graphicalViewer, ActionRegistry actionRegistry,
		EditDomain editDomain, KeyHandler keyHandler, Object zoomManagerAdapter, SelectionSynchronizer selectionSynchronizer,
		DiagramEditor diagramEditor) {
	super(viewer);
	_graphicalViewer = graphicalViewer;
	_actionRegistry = actionRegistry;
	_editDomain = editDomain;
	_keyHandler = keyHandler;
	_zoomManagerAdapter = zoomManagerAdapter;
	_selectionSynchronizer = selectionSynchronizer;
	_diagramEditor = diagramEditor;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:38,代码来源:GraphicsEditorOutlinePage.java


示例20: synchronize

import org.eclipse.graphiti.ui.editor.DiagramEditor; //导入依赖的package包/类
/**
 * Synchronizes the provided list of {@link Connection}s by inspecting any differences between the graphical
 * representation and business model objects. For any {@link Connection} where the ids of corresponding graphical
 * and business objects don't match, the business objects are relinked in the model so they accurately reflect the
 * graphical representation.
 * 
 * @param connections
 *            the list of {@link Connection} objects to inspect. In most cases, this list would contain all
 *            connections of the diagram
 * @param diagramEditor
 *            the {@link DiagramEditor} of which the diagram is currently being inspected
 */
public static void synchronize(final List<Connection> connections, final DiagramEditor diagramEditor) {

	for (final Connection connection : connections) {

		final SyncObjects objects = new SyncObjects(connection, diagramEditor);

		if (objects.isOutOfSync()) {
			objects.update();
		}
	}

}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:25,代码来源:SequenceFlowSynchronizer.java



注:本文中的org.eclipse.graphiti.ui.editor.DiagramEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RouteContext类代码示例发布时间:2022-05-22
下一篇:
Java ReflectionEntityInformation类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap