当前位置: 首页>>代码示例>>Java>>正文


Java CreateConnectionRequest.setStartCommand方法代码示例

本文整理汇总了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;

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:NodeConnectionEditPolicy.java

示例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;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:18,代码来源:ConnectionGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:19,代码来源:ConnectionGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:19,代码来源:ConnectionGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:26,代码来源:ORMShapeGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:19,代码来源:ProcessLinkCreatePolicy.java

示例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;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:13,代码来源:LinkCreatePolicy.java

示例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;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:13,代码来源:LinkCreatePolicy.java

示例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;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例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());
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:14,代码来源:TableEditPart.java

示例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;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:BaseGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:16,代码来源:DwFeatureGraphicalNodeEditPolicy.java

示例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;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:DiagramGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:17,代码来源:ORMRelationGraphicalNodeEditPolicy.java

示例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;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:39,代码来源:ORMShapeGraphicalNodeEditPolicy.java


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