本文整理汇总了Java中org.eclipse.gef.requests.CreateConnectionRequest.setStartCommand方法的典型用法代码示例。如果您正苦于以下问题:Java CreateConnectionRequest.setStartCommand方法的具体用法?Java CreateConnectionRequest.setStartCommand怎么用?Java CreateConnectionRequest.setStartCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.CreateConnectionRequest
的用法示例。
在下文中一共展示了CreateConnectionRequest.setStartCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(
CreateConnectionRequest request) {
LinkCommand command = new LinkCommand();
command.setConnection(new Link());
command.setSource(getComponentEditPart().getCastedModel());
ConnectionAnchor ctor = getComponentEditPart().getSourceConnectionAnchor(
request);
if (ctor == null)
return null;
command.setSourceTerminal(getComponentEditPart()
.mapConnectionAnchorToTerminal(ctor));
request.setStartCommand(command);
return command;
}
示例2: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(final CreateConnectionRequest request) {
final Object object = request.getNewObject();
if (object instanceof CommentConnection) {
final CommentConnection connection = (CommentConnection) object;
final CreateConnectionCommand command = new CreateCommentConnectionCommand(connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例3: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Object object = request.getNewObject();
if (object instanceof CommentConnection) {
CommentConnection connection = (CommentConnection) object;
CreateConnectionCommand command = new CreateCommentConnectionCommand(
this.diagram, connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例4: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Object object = request.getNewObject();
if (object instanceof CommentConnection) {
CommentConnection connection = (CommentConnection) object;
CreateConnectionCommand command = new CreateCommentConnectionCommand(
connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例5: setupConnectionStartCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* This method creates and return the creation command for all {@link Relation}s except the
* relations from type cyclic, total, acyclic, reflexive and irrflexive.
*
* @return {@link ORMRelationCreateCommand}
* */
private ORMRelationCreateCommand setupConnectionStartCommand(
final CreateConnectionRequest request, final Model container) {
final ORMRelationCreateCommand result = new ORMRelationCreateCommand();
result.setSource((Shape) getHost().getModel());
result.setRelation((Relation) request.getNewObject());
result.setRelationContainer(container);
if (request.getNewObjectType().equals(Type.RELATIONSHIP)) {
NamedElement ele = OrmFactory.eINSTANCE.createNamedElement();
ele.setName("*");
result.setSourceLabel(ele);
NamedElement ele2 = OrmFactory.eINSTANCE.createNamedElement();
ele2.setName("*");
result.setTargetLabel(ele2);
((Relation) request.getNewObject()).getConnectionAnchor().setContainer(container);
}
request.setStartCommand(result);
return result;
}
示例6: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest req) {
CreateLinkCommand cmd = (CreateLinkCommand) req.getStartCommand();
if (cmd == null)
return null;
ExchangeNode toConnect = (ExchangeNode) req.getTargetEditPart().getModel();
ExchangeNode other = cmd.startedFromOutput ? cmd.output : cmd.input;
if (!toConnect.matches(other) || toConnect.parent().isConnected(toConnect.exchange.getId())) {
cmd.completeWith(null);
req.setStartCommand(cmd);
return null;
}
cmd.completeWith(toConnect);
req.setStartCommand(cmd);
if (cmd.output == null || cmd.input == null)
return null;
return cmd;
}
示例7: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Node start = (Node) getHost().getModel();
if (start instanceof ServiceOperationNode || start instanceof TriggerInstanceTerminalNode || start instanceof DynamicTriggerInstanceTerminalNode || start instanceof ModuleOperationNode) {
LinkCreateCommand cmd = new LinkCreateCommand();
cmd.setSource(start);
cmd.setLink((Link) request.getNewObject());
request.setStartCommand(cmd);
return cmd;
}
return null;
}
示例8: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Node start = (Node) getHost().getModel();
if (start instanceof ServiceNode) {
LinkCreateCommand cmd = new LinkCreateCommand();
cmd.setSource(start);
cmd.setLink((Link) request.getNewObject());
request.setStartCommand(cmd);
return cmd;
}
return null;
}
示例9: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
LinkCreateCommand result = new LinkCreateCommand();
if (getHost().getModel() instanceof GraphElement) {
result.setSource((GraphElement) getHost().getModel());
result.setGraph(((GraphElement) getHost().getModel()).getGraph());
request.setStartCommand(result);
return result;
}
return UnexecutableCommand.INSTANCE;
}
示例10: getTargetConnectionAnchor
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
if (request instanceof CreateConnectionRequest) {
CreateConnectionRequest crequest = (CreateConnectionRequest) request;
Table table = (Table) crequest.getSourceEditPart().getModel();
Column c = table.getFirstPkColumn();
if (c == null) {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "提示", "此表没有主键,请先设置主键!");
crequest.setStartCommand(null);
}
}
return new ChopboxAnchor(getFigure());
}
示例11: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Table source = (Table) getHost().getModel();
Connection c = (Connection) request.getNewObject();
ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, c);
request.setStartCommand(cmd);
return cmd;
}
示例12: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
DwFeatureModelWrapped featureModel = ((DwFeatureEditPart)getHost()).getFeatureModel();
DwParentChildConnection connection = (DwParentChildConnection)request.getNewObject();
connection.setModel(featureModel);
DwParentChildConnectionCreateCommand command = new DwParentChildConnectionCreateCommand();
command.setSource((DwFeatureWrapped)getHost().getModel());
command.setConnection(connection);
command.setFeatureModel(featureModel);
request.setStartCommand(command);
return command;
}
示例13: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*/
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
CreateConnectionCommand command = new CreateConnectionCommand();
AbstractConnection connection = (AbstractConnection) request.getNewObject();
AbstractView objNode = (AbstractNode) (getHost().getModel());
if (objNode instanceof AbstractConnection) {
return null;
}
AbstractNode abstractNode = (AbstractNode) objNode;
if (!UMLPolicyManager.isConnectableFromSource(connection.getRelationType(), abstractNode.getNodeType())) {
return null;
}
ConnectionAnchor sourceAnchor = ((NodeEditPart) getHost()).getSourceConnectionAnchor(request);
command.setSourceAnchorPoint(sourceAnchor.getLocation(request.getLocation()));
command.setConnection(connection);
command.setSource((AbstractNode) getHost().getModel());
request.setStartCommand(command);
request.setSourceEditPart(getHost());
return command;
}
示例14: setupConnectionStartCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* This method creates and return the creation command for all {@link Relation}s except the
* relations from type cyclic, total, acyclic, reflexive and irrflexive.
*
* @return {@link ORMRelationCreateCommand}
* */
private ORMRelationCreateCommand setupConnectionStartCommand(
final CreateConnectionRequest request, final Model container) {
final ORMRelationCreateCommand result = new ORMRelationCreateCommand();
result.setSource(((Relation) getHost().getModel()).getConnectionAnchor());
result.setRelation((Relation) request.getNewObject());
result.setRelationContainer(container);
request.setStartCommand(result);
return result;
}
示例15: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* @return {@link ORMRelationshipConstraintCreateCommand}( in case a {@link Relation} from type
* cyclic, total, acyclic, reflexive or irreflexive should be created) or {@link ORMRelationCreateCommand}( in
* case any other Relation should be created)
* */
@Override
protected Command getConnectionCreateCommand(final CreateConnectionRequest request) {
Command retVal = null;
if (!(request.getNewObjectType().equals(Type.RELATIONSHIP_IMPLICATION) ||
request.getNewObjectType().equals(Type.RELATIONSHIP_EXCLUSION))) {
if (isStartOK(request)) {
retVal =
setupConnectionStartCommand(request, ((Shape) getHost().getModel()).getContainer());
}
// Irreflexive Acyclic Total start
if ((oTCheck(request, Type.CYCLIC, Type.ROLE_TYPE)
|| oTCheck(request, Type.IRREFLEXIVE, Type.ROLE_TYPE) || oTCheck(request, Type.TOTAL,
Type.ROLE_TYPE)|| oTCheck(request, Type.ACYCLIC, Type.ROLE_TYPE) || oTCheck(
request, Type.REFLEXIVE, Type.ROLE_TYPE)) && hasARelationship(request, false)) {
final ORMRelationshipConstraintCreateCommand result =
new ORMRelationshipConstraintCreateCommand();
result.setSource((Shape) getHost().getModel());
result.setRelation((Relation) request.getNewObject());
request.setStartCommand(result);
result.setRelationContainer(((Shape) getHost().getModel()).getContainer());
retVal = result;
}
}
return retVal;
}