本文整理汇总了Java中org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.setSourceEditPart方法的典型用法代码示例。如果您正苦于以下问题:Java CreateConnectionViewRequest.setSourceEditPart方法的具体用法?Java CreateConnectionViewRequest.setSourceEditPart怎么用?Java CreateConnectionViewRequest.setSourceEditPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest
的用法示例。
在下文中一共展示了CreateConnectionViewRequest.setSourceEditPart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<StatemachineLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (StatemachineLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
StatemachineVisualIDRegistry.getType(nextLinkDescriptor
.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例2: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection createConnections(Collection linkDescriptors,
Map domain2NotationMap) {
List adapters = new LinkedList();
for (Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator
.hasNext();) {
final SmcLinkDescriptor nextLinkDescriptor = (SmcLinkDescriptor) linkDescriptorsIterator
.next();
EditPart sourceEditPart = getEditPart(nextLinkDescriptor
.getSource(), domain2NotationMap);
EditPart targetEditPart = getEditPart(nextLinkDescriptor
.getDestination(), domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(), String
.valueOf(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例3: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<Wc2014LinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (Wc2014LinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
Wc2014VisualIDRegistry.getType(nextLinkDescriptor
.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例4: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<SimpleBPMN.diagram.part.SimpleBPMNLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (SimpleBPMN.diagram.part.SimpleBPMNLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:41,代码来源:BusinessProcessDiagramCanonicalEditPolicy.java
示例5: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVOLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVOLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVOVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例6: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例7: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<MIDLinkDescriptor> linkDescriptors, Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (MIDLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
MIDVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND,
false,
((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例8: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(Collection<MIDLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (MIDLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
MIDVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例9: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.RelationalDatabase_MAVOLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.RelationalDatabase_MAVOLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.RelationalDatabase_MAVOVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例10: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<RelationalDatabaseLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (RelationalDatabaseLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
RelationalDatabaseVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例11: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例12: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<IStarLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (IStarLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
IStarVisualIDRegistry.getType(nextLinkDescriptor
.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例13: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<StateMachineLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (StateMachineLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
StateMachineVisualIDRegistry.getType(nextLinkDescriptor
.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例14: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.StateMachine_MAVOLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.StateMachine_MAVOLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.StateMachine_MAVOVisualIDRegistry
.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
示例15: createConnections
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; //导入方法依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<ClassDiagramLinkDescriptor> linkDescriptors, Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (ClassDiagramLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
ClassDiagramVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()),
ViewUtil.APPEND,
false,
((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}