本文整理汇总了Java中org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy类的典型用法代码示例。如果您正苦于以下问题:Java ICommandProxy类的具体用法?Java ICommandProxy怎么用?Java ICommandProxy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICommandProxy类属于org.eclipse.gmf.runtime.diagram.ui.commands包,在下文中一共展示了ICommandProxy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createChangeConstraintCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command createChangeConstraintCommand(EditPart child,
Object constraint) {
if (constraint instanceof TreeLayoutConstraint) {
if (((TreeLayoutConstraint) constraint).isRoot()) {
return UnexecutableCommand.INSTANCE;
} else {
return new ICommandProxy(new UpdateAnnotationsOnMoveCommand(
getHost().getEditingDomain(),
(IGraphicalEditPart) child,
(TreeLayoutConstraint) constraint));
}
}
return super.createChangeConstraintCommand(child, constraint);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:TreeLayoutEditPolicy.java
示例2: setConnectionPoints
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Sets the points of a connection.
*
* @param connection
* - The connection
* @param bendpoints
* - Start, end and bending points
*/
public static void setConnectionPoints(ConnectionNodeEditPart connection, List<Point> bendpoints) {
TransactionalEditingDomain editingDomain = connection.getEditingDomain();
SetConnectionBendpointsCommand cmd = new SetConnectionBendpointsCommand(editingDomain);
cmd.setEdgeAdapter(new EObjectAdapter(connection.getNotationView()));
Point first = bendpoints.get(0);
Point last = bendpoints.get(bendpoints.size() - 1);
Point sourceRef = new Point(first.x(), first.y());
Point targetRef = new Point(last.x(), last.y());
PointList pointList = new PointList();
for (Point bendpoint : bendpoints) {
pointList.addPoint(new Point(bendpoint.x(), bendpoint.y()));
}
cmd.setNewPointList(pointList, sourceRef, targetRef);
Command proxy = new ICommandProxy(cmd);
proxy.execute();
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:28,代码来源:DiagramElementsModifier.java
示例3: refreshSemantic
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshSemantic() {
List createdViews = new LinkedList();
createdViews.addAll(refreshSemanticChildren());
List createdConnectionViews = new LinkedList();
createdConnectionViews.addAll(refreshSemanticConnections());
createdConnectionViews.addAll(refreshConnections());
if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host()
.getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
}
createdViews.addAll(createdConnectionViews);
makeViewsImmutable(createdViews);
}
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:21,代码来源:SystemCanonicalEditPolicy.java
示例4: getCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* @generated
*/
protected Command getCommand(Request request) {
List operationSet = getOperationSet();
if (operationSet.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
Iterator editParts = operationSet.iterator();
CompositeTransactionalCommand command = new CompositeTransactionalCommand(
getEditingDomain(), getCommandLabel());
while (editParts.hasNext()) {
EditPart editPart = (EditPart) editParts.next();
Command curCommand = editPart.getCommand(request);
if (curCommand != null) {
command.compose(new CommandProxy(curCommand));
}
}
if (command.isEmpty() || command.size() != operationSet.size()) {
return UnexecutableCommand.INSTANCE;
}
return new ICommandProxy(command);
}
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:24,代码来源:DeleteElementAction.java
示例5: getOpenCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Gets the command to open a model editor.
*
* @param req
* The request.
* @return The executable command.
*/
@Override
protected Command getOpenCommand(Request request) {
EditPart targetEditPart = getTargetEditPart(request);
if (false == targetEditPart.getModel() instanceof View) {
return null;
}
View view = (View) targetEditPart.getModel();
Style link = view.getStyle(NotationPackage.eINSTANCE
.getHintedDiagramLinkStyle());
if (false == link instanceof HintedDiagramLinkStyle) {
return null;
}
return new ICommandProxy(new ModelOpenEditorCommand(
(HintedDiagramLinkStyle) link));
}
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:ModelOpenEditorEditPolicy.java
示例6: getOpenCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Gets the command to open an operator editor.
*
* @param req
* The request.
* @return The executable command.
*/
@Override
protected Command getOpenCommand(Request request) {
EditPart targetEditPart = getTargetEditPart(request);
if (false == targetEditPart.getModel() instanceof View) {
return null;
}
View view = (View) targetEditPart.getModel();
Style link = view.getStyle(NotationPackage.eINSTANCE
.getHintedDiagramLinkStyle());
if (false == link instanceof HintedDiagramLinkStyle) {
return null;
}
return new ICommandProxy(new OperatorOpenEditorCommand(
(HintedDiagramLinkStyle) link));
}
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:OperatorOpenEditorEditPolicy.java
示例7: getDropObjectsCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Gets the command to handle objects dropped into the Mapping diagram.
*
* @param dropRequest
* The drop request.
* @return The executable command.
*/
public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
ModelRelEditPart modelRelEditPart = (ModelRelEditPart) getHost();
CompoundCommand command = new CompoundCommand("Add model element references");
IElementType elementType = MIDElementTypes.getElementType(ModelElementReferenceEditPart.VISUAL_ID);
EReference containment = RelationshipPackage.Literals.MODEL_ENDPOINT_REFERENCE__MODEL_ELEM_REFS;
Iterator<?> it = dropRequest.getObjects().iterator();
while (it.hasNext()) {
RelationshipDiagramOutlineDropObject dropObj = (RelationshipDiagramOutlineDropObject) it.next();
ModelEndpointReference modelEndpointRef = dropObj.getModelEndpointReference();
CreateElementRequest createReq = new CreateElementRequest(modelRelEditPart.getEditingDomain(), modelEndpointRef, elementType, containment);
command.add(
new ICommandProxy( // convert GMF command to GEF command
new ModelElementReferenceDropCommand(createReq, dropObj)
)
);
}
return command;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:29,代码来源:RelationshipDiagramOutlineDragDropEditPolicy.java
示例8: executeReplaceCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Executes the command of replace to the BasicNode.
* @param basicNode The BasicNode that is changed
* @param attributeType the AttributeType
* @param replaceString The string which replaces
*/
private void executeReplaceCommand(BasicNode basicNode, AttributeType attributeType, String replaceString) {
// creates an attribute map.
Map<AttributeType, Object> attrMap = new HashMap<AttributeType, Object>();
// puts the values to set.
attrMap.put(attributeType, replaceString);
// creates a change the specified attribute command and perform it.
ICommand changeAttrCommand = new ChangeBasicNodePropertyTransactionCommand(
argumentEditPart.getEditingDomain(),
Messages.DescReplaceManager_ReplaceDescCommandName,
null,
basicNode,
attrMap);
argumentEditPart.getDiagramEditDomain().getDiagramCommandStack()
.execute(new ICommandProxy(
changeAttrCommand));
}
开发者ID:d-case,项目名称:d-case_editor,代码行数:25,代码来源:DescReplaceManager.java
示例9: makeMap
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* Makes mapping of module edit parts and basic nodes
*
* @param moduleName
* the module name
* @return the top edit part
*/
private DcaseNodeEditPart makeMap(ArgumentEditPart argumentEditPart) {
DcaseNodeEditPart topEditPart = null;
// select all nodes
ICommand selectCommand = new SelectExcludesCommand(
SELECT_SUBTREE_CMD_LABEL, argumentEditPart,
new HashSet<String>());
argumentEditPart.getDiagramEditDomain().getDiagramCommandStack()
.execute(new ICommandProxy(selectCommand));
topEditPart = DcaseEditorUtil.getTopCurrentSelectedPart();
// make mappings
moduleMap = new HashMap<DcaseNodeEditPart, BasicNode>();
for (DcaseNodeEditPart editPart : DcaseEditorUtil.getSelectedPart()) {
EObject eobj = DcaseEditorUtil.getElement(editPart);
if (eobj instanceof BasicNode) {
moduleMap.put(editPart, (BasicNode) eobj);
}
}
return topEditPart;
}
开发者ID:d-case,项目名称:d-case_editor,代码行数:30,代码来源:RestoreModuleHandler.java
示例10: refreshSemantic
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshSemantic() {
List createdViews = new LinkedList();
createdViews.addAll(refreshSemanticChildren());
List createdConnectionViews = new LinkedList();
createdConnectionViews.addAll(refreshSemanticConnections());
createdConnectionViews.addAll(refreshConnections());
if (createdViews.size() > 1) {
// perform a layout of the container
DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host()
.getEditingDomain(), createdViews, host());
executeCommand(new ICommandProxy(layoutCmd));
}
createdViews.addAll(createdConnectionViews);
makeViewsImmutable(createdViews);
}
开发者ID:d-case,项目名称:d-case_editor,代码行数:21,代码来源:ArgumentCanonicalEditPolicy.java
示例11: getCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* @generated
*/
protected Command getCommand(Request request) {
List operationSet = getOperationSet();
if (operationSet.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
Iterator editParts = operationSet.iterator();
CompositeTransactionalCommand command = new CompositeTransactionalCommand(
getEditingDomain(), getCommandLabel());
while (editParts.hasNext()) {
EditPart editPart = (EditPart) editParts.next();
Command curCommand = editPart.getCommand(request);
if (curCommand != null) {
command.compose(new CommandProxy(curCommand));
}
}
if (command.isEmpty() || command.size() != operationSet.size()) {
return UnexecutableCommand.INSTANCE;
}
return new ICommandProxy(command);
}
开发者ID:d-case,项目名称:d-case_editor,代码行数:24,代码来源:DeleteElementAction.java
示例12: getDirectEditCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
SetRequest setRequest = new SetRequest(getHost().resolveSemanticElement(), provider.getAttribute(), request
.getCellEditor().getValue());
SetValueCommand setCommand = new SetValueCommand(setRequest);
return new ICommandProxy(setCommand);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:8,代码来源:EAttributeDirectEditPolicy.java
示例13: getCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Command getCommand(Request request) {
if (!RequestConstants.REQ_RESIZE.equals(request.getType())
&& !RequestConstants.REQ_MOVE.equals(request.getType())) {
return null;
}
if (request instanceof SetPreferredSizeRequest) {
showSourceFeedback(request);
}
ChangeBoundsRequest cbr = (ChangeBoundsRequest) request;
CompoundCommand result = new CompoundCommand();
// Update Bounds of the container hierachy
for (IGraphicalEditPart currentContainer : containerHierachy) {
IFigure figure = currentContainer.getFigure();
SetBoundsCommand boundsCommand = new SetBoundsCommand(getHost().getEditingDomain(),
DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(
currentContainer.getNotationView()), figure.getBounds());
result.add(new ICommandProxy(boundsCommand));
// Update child bounds of elements that stand in the way...
List<IGraphicalEditPart> children = currentContainer.getParent().getChildren();
for (IGraphicalEditPart childPart : children) {
if (cbr.getEditParts().contains(childPart))
continue;
IFigure childFigure = childPart.getFigure();
if (childPart == currentContainer)
continue;
SetBoundsCommand childBoundsCommand = new SetBoundsCommand(getHost().getEditingDomain(),
DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(
childPart.getNotationView()), childFigure.getBounds());
result.add(new ICommandProxy(childBoundsCommand));
}
}
return result;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:40,代码来源:EnlargeContainerEditPolicy.java
示例14: createDeleteSemanticCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command createDeleteSemanticCommand(GroupRequest deleteRequest) {
SetRequest request = new SetRequest(getHost().resolveSemanticElement(),
SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION,
null);
SetValueCommand result = new SetValueCommand(request);
return new ICommandProxy(result);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:9,代码来源:TransitionExpressionComponentEditPolicy.java
示例15: createAddCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command createAddCommand(EditPart child, EditPart after) {
int index = getHost().getChildren().indexOf(after);
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
.getEditingDomain();
AddCommand command = new CompartmentAddCommand(editingDomain,
new EObjectAdapter((View) getHost().getModel()),
new EObjectAdapter((View) child.getModel()), index);
return new ICommandProxy(command);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:11,代码来源:CompartmentLayoutEditPolicy.java
示例16: createMoveChildCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
protected Command createMoveChildCommand(EditPart child, EditPart after) {
int newIndex;
int displacement;
int childIndex = getHost().getChildren().indexOf(child);
int afterIndex = getHost().getChildren().indexOf(after);
if (afterIndex == -1) {
newIndex = getHost().getChildren().size() - 1;
displacement = newIndex - childIndex;
} else {
newIndex = afterIndex;
displacement = afterIndex - childIndex;
if (childIndex <= afterIndex) {
newIndex--;
displacement--;
}
}
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
.getEditingDomain();
RepositionEObjectCommand command = new CompartmentRepositionEObjectCommand(
child, editingDomain, "", (EList) ((View) child.getParent()
.getModel()).getElement().eGet(feature),
((View) child.getModel()).getElement(), displacement, newIndex);
eraseLayoutTargetFeedback(null);
return new ICommandProxy(command);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:35,代码来源:CompartmentLayoutEditPolicy.java
示例17: getCreateCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command getCreateCommand(CreateRequest request) {
final CompoundCommand cmd = new CompoundCommand();
cmd.add(super.getCreateCommand(request));
if (request instanceof CreateViewAndElementRequest) {
final CreateViewAndElementRequest req = (CreateViewAndElementRequest) request;
if (shouldUpdateAnnotationsOnCreation(req)) {
cmd.add(new ICommandProxy(
new UpdateAnnotationsOnCreationCommand(getHost()
.getEditingDomain(), req)));
}
}
return cmd;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:15,代码来源:TreeLayoutEditPolicy.java
示例18: getOpenCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
/**
* @generated
*/
protected Command getOpenCommand(Request request) {
EditPart targetEditPart = getTargetEditPart(request);
if (false == targetEditPart.getModel() instanceof View) {
return null;
}
View view = (View) targetEditPart.getModel();
Style link = view.getStyle(NotationPackage.eINSTANCE
.getHintedDiagramLinkStyle());
if (false == link instanceof HintedDiagramLinkStyle) {
return null;
}
return new ICommandProxy(new OpenDiagramCommand(
(HintedDiagramLinkStyle) link));
}
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:18,代码来源:OpenDiagramEditPolicy.java
示例19: dropClassifierWithAttributesInDiagram
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
public static Command dropClassifierWithAttributesInDiagram(final IGraphicalEditPart graphicalTarget,
final EObject aClassifier, final Point location, final TransactionalEditingDomain theEditingDomain) {
final EditPart anExistingEditPart = graphicalTarget.findEditPart(graphicalTarget, aClassifier);
if (anExistingEditPart != null) {
return moveTheView(theEditingDomain, anExistingEditPart, location);
}
final CompoundCommand theCommand = new CompoundCommand(
Activator.INSTANCE.getString("_UI_DropClassifierWithAttributes_command_label"));
final View thePackageDiagram = (View) graphicalTarget.getModel();
final IHintedType theClassifierViewType = (IHintedType) UMLElementTypes.getElementType(UMLVisualIDRegistry
.getNodeVisualID(thePackageDiagram, aClassifier));
final ViewDescriptor theClassifierViewDescriptor = new ViewDescriptor(new EObjectAdapter(aClassifier), Node.class,
theClassifierViewType.getSemanticHint(), ViewUtil.APPEND, false, graphicalTarget.getDiagramPreferencesHint());
final CreateViewCommand createTheClassifierView = new CreateViewCommand(theEditingDomain,
theClassifierViewDescriptor, thePackageDiagram);
final IAdaptable theClassifierViewAdapter = (IAdaptable) createTheClassifierView.getCommandResult().getReturnValue();
final Command setTheClassifierViewLocation = moveTheView(theEditingDomain, theClassifierViewAdapter, location);
theCommand.add(new ICommandProxy(createTheClassifierView));
theCommand.add(setTheClassifierViewLocation);
final Collection<Property> ownedAttributes = getOwnedAttributes(aClassifier);
for (final Property anAttribute : ownedAttributes) {
theCommand.add(new DelegatingCreateAttributeViewCommand(theEditingDomain, anAttribute, theClassifierViewAdapter,
getTheClassDiagramPreferencesHint()));
}
return theCommand;
}
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:32,代码来源:DiagramExt.java
示例20: getCommand
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; //导入依赖的package包/类
@Override
protected Command getCommand() {
final TransactionalEditingDomain editingDomain = getEditingDomain();
if (editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
final List<IGraphicalEditPart> editParts = getSelectedElements();
if (editParts.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
final CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Delete From Model");
final Iterator<IGraphicalEditPart> it = editParts.iterator();
while (it.hasNext()) {
final IGraphicalEditPart editPart = it.next();
if (!(editPart instanceof DiagramEditPart)) {
final Command c = editPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE));
if (c != null) {
command.compose(new CommandProxy(c));
}
}
}
if (command.isEmpty()) {
return UnexecutableCommand.INSTANCE;
}
return new ICommandProxy(command);
}
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:33,代码来源:DeleteFromDiagramCommandHandler.java
注:本文中的org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论