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


Java CreateConnectionRequest.getStartCommand方法代码示例

本文整理汇总了Java中org.eclipse.gef.requests.CreateConnectionRequest.getStartCommand方法的典型用法代码示例。如果您正苦于以下问题:Java CreateConnectionRequest.getStartCommand方法的具体用法?Java CreateConnectionRequest.getStartCommand怎么用?Java CreateConnectionRequest.getStartCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gef.requests.CreateConnectionRequest的用法示例。


在下文中一共展示了CreateConnectionRequest.getStartCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(
		CreateConnectionRequest request) {

	LinkCommand command = (LinkCommand) request
			.getStartCommand();
	command.setTarget(getComponentEditPart().getCastedModel());
	ConnectionAnchor ctor = getComponentEditPart().getTargetConnectionAnchor(
			request);
	if (ctor == null)
		return null;


	command.setTargetTerminal(getComponentEditPart()
			.mapConnectionAnchorToTerminal(ctor));

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

示例2: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
    final AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request.getStartCommand();
    final DiagramWalkerEditPart targetEditPart = (DiagramWalkerEditPart) request.getTargetEditPart();
    if (command instanceof AbstractCreateRelationshipCommand) {
        if (!(targetEditPart instanceof TableViewEditPart)) {
            return null;
        }
    }
    final String validatedMessage = command.validate();
    if (validatedMessage != null) {
        Activator.showErrorDialog(validatedMessage);
        return null;
    }
    command.setTarget(targetEditPart);
    if (!command.canExecute()) {
        return null;
    }
    return command;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:21,代码来源:DiagramWalkerGraphicalNodeEditPolicy.java

示例3: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
protected org.eclipse.gef.commands.Command getConnectionCompleteCommand(
		CreateConnectionRequest request )
{

	ConnectionCommand command = (ConnectionCommand) request.getStartCommand( );

	if ( command == null )
		return null;
	EditPart sourcePart = command.getSource( );
	if ( !( getHost( ) instanceof ColumnEditPart )
			|| getHost( ) == sourcePart
			|| getHost( ).getParent( ) == sourcePart.getParent( ) )
	{
		return null;
	}
	ColumnEditPart targetPart = (ColumnEditPart) getHost( );
	command.setTarget( targetPart );

	AddJoinConditionCommand addJoinConditionCommand = new AddJoinConditionCommand( sourcePart,
			targetPart );
	return addJoinConditionCommand;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ConnectionCreationEditPolicy.java

示例4: 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

示例5: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
	LinkCreateCommand cmd = (LinkCreateCommand) request.getStartCommand();
	Node end = (Node) getHost().getModel();
	Node start = cmd.getSource();
	if (end instanceof ReferenceNode && (!(start.getParent().getId().equalsIgnoreCase(end.getParent().getId())))) {
		ReferenceNode nd = (ReferenceNode) end;
		ServiceNode st = (ServiceNode) start;
		if (nd.getIntf().equalsIgnoreCase(st.getIntf())) {
			cmd.setTarget(end);
			return cmd;
		}
	}
	return null;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:16,代码来源:LinkCreatePolicy.java

示例6: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
	LinkCreateCommand result = (LinkCreateCommand) request.getStartCommand();
	if (getHost().getModel() instanceof GraphElement) {
		GraphElement target = (GraphElement) getHost().getModel();
		result.setLink((GWLink) request.getNewObject());
		result.setTarget(target);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4ENodeGraphicalNodeEditPolicy.java

示例7: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
	if (request.getStartCommand() != null) {
		ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
		cmd.setTarget((Table) getHost().getModel());
		return cmd;
	}
	return null;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:10,代码来源:BaseGraphicalNodeEditPolicy.java

示例8: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
	DwParentChildConnectionCreateCommand command = (DwParentChildConnectionCreateCommand)request.getStartCommand();
	command.setFeatureModel(featureModel);
	command.setTarget((DwFeatureWrapped)getHost().getModel());
	return command;
	

}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:DwFeatureGraphicalNodeEditPolicy.java

示例9: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
    final CreateCommentConnectionCommand command = (CreateCommentConnectionCommand) request.getStartCommand();

    command.setTarget(request.getTargetEditPart());

    if (!command.canExecute()) {
        return null;
    }

    return command;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:13,代码来源:ConnectionGraphicalNodeEditPolicy.java

示例10: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
    final AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request.getStartCommand();

    final NodeElementEditPart targetEditPart = (NodeElementEditPart) request.getTargetEditPart();

    if (command instanceof AbstractCreateRelationCommand) {
        if (!(targetEditPart instanceof TableViewEditPart)) {
            return null;
        }
    }

    final String validatedMessage = command.validate();
    if (validatedMessage != null) {
        ERDiagramActivator.showErrorDialog(validatedMessage);

        return null;
    }

    command.setTarget(targetEditPart);

    if (!command.canExecute()) {
        return null;
    }

    return command;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:31,代码来源:NodeElementGraphicalNodeEditPolicy.java

示例11: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(
		CreateConnectionRequest request) {
	CreateCommentConnectionCommand command = (CreateCommentConnectionCommand) request
			.getStartCommand();

	command.setTarget(request.getTargetEditPart());

	if (!command.canExecute()) {
		return null;
	}

	return command;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:15,代码来源:ConnectionGraphicalNodeEditPolicy.java

示例12: getConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getConnectionCompleteCommand(
		CreateConnectionRequest request) {
	AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request
			.getStartCommand();

	NodeElementEditPart targetEditPart = (NodeElementEditPart) request
			.getTargetEditPart();

	if (command instanceof AbstractCreateRelationCommand) {
		if (!(targetEditPart instanceof TableViewEditPart)) {
			return null;
		}
	}

	String validatedMessage = command.validate();
	if (validatedMessage != null) {
		ERDiagramActivator.showErrorDialog(validatedMessage);

		return null;
	}

	command.setTarget(targetEditPart);

	if (!command.canExecute()) {
		return null;
	}

	return command;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:34,代码来源:NodeElementGraphicalNodeEditPolicy.java

示例13: setupConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
 * This method completes and return the creation commands for all {@link Relation}s except for
 * {@link Relation}s from type cyclic, irreflexive, acyclic, reflexive and total.
 * 
 * @return {@link ORMRelationCreateCommand}
 * */
private ORMRelationCreateCommand setupConnectionCompleteCommand(
    final CreateConnectionRequest request) {
  final ORMRelationCreateCommand result = (ORMRelationCreateCommand) request.getStartCommand();
  result.setTarget(((Relation) getHost().getModel()).getConnectionAnchor());
  return result;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:13,代码来源:ORMRelationGraphicalNodeEditPolicy.java

示例14: getConnectionCompleteCommand

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 getConnectionCompleteCommand(final CreateConnectionRequest request) {
  Command retVal = null;
  if (!(request.getNewObjectType().equals(Type.RELATIONSHIP_IMPLICATION)||
  	  request.getNewObjectType().equals(Type.RELATIONSHIP_EXCLUSION))) {
    if (isCompleteOK(request)) {
      retVal = setupConnectionCompleteCommand(request);
    }

    // Irreflexive Acyclic Total Cyclic Reflexive End
    if ((oSTCheck(request, Type.CYCLIC, Type.ROLE_TYPE, Type.ROLE_TYPE)
        || oSTCheck(request, Type.IRREFLEXIVE, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
          request, Type.TOTAL, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
          request, Type.ACYCLIC, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
          request, Type.REFLEXIVE, Type.ROLE_TYPE, Type.ROLE_TYPE))
        && tNotEqualSCheck(request)
        && hasARelationship(request, true) && !hasConstraintsKind(request)) {
      final ORMRelationshipConstraintCreateCommand result =
          (ORMRelationshipConstraintCreateCommand) request.getStartCommand();
      result.setTarget((Shape) getHost().getModel());
      ArrayList<Relation> refrencedRelations = new ArrayList<Relation>();
      refrencedRelations.add(testedRelationship);
      result.setRefrencedRelations(refrencedRelations);

      retVal = result;
    }
  }
  return retVal;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:37,代码来源:ORMShapeGraphicalNodeEditPolicy.java

示例15: setupConnectionCompleteCommand

import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
 * This method completes and return the creation commands for all {@link Relation}s except for
 * {@link Relation}s from type cyclic, irreflexive, acyclic, reflexive and total.
 * 
 * @return {@link ORMRelationCreateCommand}
 * */
private ORMRelationCreateCommand setupConnectionCompleteCommand(
    final CreateConnectionRequest request) {
  final ORMRelationCreateCommand result = (ORMRelationCreateCommand) request.getStartCommand();
  result.setTarget((Shape) getHost().getModel());
  return result;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:13,代码来源:ORMShapeGraphicalNodeEditPolicy.java


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