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


Java CreateConnectionRequest类代码示例

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


CreateConnectionRequest类属于org.eclipse.gef.requests包,在下文中一共展示了CreateConnectionRequest类的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: 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

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

示例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(
				this.diagram, connection);

		command.setSource(request.getTargetEditPart());
		request.setStartCommand(command);

		return command;
	}

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

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

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

示例7: getFeedbackHelper

import org.eclipse.gef.requests.CreateConnectionRequest; //导入依赖的package包/类
/**
 * Returns the FeedbackHelper that is ready to use. The feedback helper must
 * be configured with the connection that will be used to display feedback,
 * and that connection must be added to the appropriate layer in the
 * diagram.
 * 
 * @param request
 *            the CreateConnectionRequest
 * @return a FeedbackHelper
 */
protected FeedbackHelper getFeedbackHelper(CreateConnectionRequest request) {
	if (feedbackHelper == null) {
		feedbackHelper = new FeedbackHelper();
		Point p = request.getLocation();
		connectionFeedback = createDummyConnection(request);
		connectionFeedback
				.setConnectionRouter(getDummyConnectionRouter(request));
		connectionFeedback
				.setSourceAnchor(getSourceConnectionAnchor(request));
		feedbackHelper.setConnection(connectionFeedback);
		addFeedback(connectionFeedback);
		feedbackHelper.update(null, p);
	}
	return feedbackHelper;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:26,代码来源:GraphicalNodeEditPolicy.java

示例8: handleButtonDown

import org.eclipse.gef.requests.CreateConnectionRequest; //导入依赖的package包/类
/**
 * When the button is first pressed, the source node and its command
 * contribution are determined and locked in. After that time, the tool will
 * be looking for the target node to complete the connection
 * 
 * @see org.eclipse.gef.tools.AbstractTool#handleButtonDown(int)
 * @param button
 *            which button is pressed
 * @return <code>true</code> if the button down was processed
 */
protected boolean handleButtonDown(int button) {
	if (isInState(STATE_INITIAL) && button == 1) {
		updateTargetRequest();
		updateTargetUnderMouse();
		setConnectionSource(getTargetEditPart());
		Command command = getCommand();
		((CreateConnectionRequest) getTargetRequest())
				.setSourceEditPart(getTargetEditPart());
		if (command != null) {
			setState(STATE_CONNECTION_STARTED);
			setCurrentCommand(command);
			viewer = getCurrentViewer();
		}
	}

	if (isInState(STATE_INITIAL) && button != 1) {
		setState(STATE_INVALID);
		handleInvalidInput();
	}
	return true;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:32,代码来源:AbstractConnectionCreationTool.java

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

示例10: isStartOK

import org.eclipse.gef.requests.CreateConnectionRequest; //导入依赖的package包/类
/**
 * This method tests if the conditions for the creation start of a {@link Relation} kind(except
 * {@link Relation}s from type total, cyclic, acyclic, reflexive and irreflexive) are fulfilled.
 * 
 * @return boolean
 * */
public boolean isStartOK(final CreateConnectionRequest request) {
  // Fufillment start
  return oTCheck(request, Type.FULFILLMENT, Type.NATURAL_TYPE)
      || oTCheck(request, Type.FULFILLMENT, Type.DATA_TYPE)
      || oTCheck(request, Type.FULFILLMENT, Type.COMPARTMENT_TYPE)
      // Role Implication start
      || oTCheck(request, Type.ROLE_IMPLICATION, Type.ROLE_TYPE)
      || oTCheck(request, Type.ROLE_IMPLICATION, Type.ROLE_GROUP)
      // Role Equivalence start
      || oTCheck(request, Type.ROLE_EQUIVALENCE, Type.ROLE_TYPE)
      || oTCheck(request, Type.ROLE_EQUIVALENCE, Type.ROLE_GROUP)
      // Role Prohibition start
      || oTCheck(request, Type.ROLE_PROHIBITION, Type.ROLE_TYPE)
      || oTCheck(request, Type.ROLE_PROHIBITION, Type.ROLE_GROUP)
      // Inheritance start
      || oTCheck(request, Type.INHERITANCE, Type.NATURAL_TYPE)
      || oTCheck(request, Type.INHERITANCE, Type.DATA_TYPE)
      || oTCheck(request, Type.INHERITANCE, Type.ROLE_TYPE)
      || oTCheck(request, Type.INHERITANCE, Type.COMPARTMENT_TYPE)
      // Relationship start
      || oTCheck(request, Type.RELATIONSHIP, Type.ROLE_TYPE);
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:29,代码来源:ORMShapeGraphicalNodeEditPolicy.java

示例11: hasConstraintsKind

import org.eclipse.gef.requests.CreateConnectionRequest; //导入依赖的package包/类
/**
 * This method tests if between source edit part and traget edit part already exist a
 * relationshipConstraint(total,irrflexive,cyclic, acyclic, reflexive) kind of the requested relationshipConstraint
 * kind.
 * 
 * @return boolean
 * */
private boolean hasConstraintsKind(final CreateConnectionRequest request) {
  if (testedRelationship != null) {
    for (Relation rel : testedRelationship.getReferencedRelation()) {
      if (request.getNewObjectType().equals(Type.IRREFLEXIVE)
          && rel.getType().equals(Type.IRREFLEXIVE))
        return true;
      if (request.getNewObjectType().equals(Type.TOTAL) && rel.getType().equals(Type.TOTAL))
        return true;
      if (request.getNewObjectType().equals(Type.CYCLIC) && rel.getType().equals(Type.CYCLIC))
        return true;
      if (request.getNewObjectType().equals(Type.ACYCLIC) && rel.getType().equals(Type.ACYCLIC))
          return true;
      if (request.getNewObjectType().equals(Type.REFLEXIVE) && rel.getType().equals(Type.REFLEXIVE))
          return true;
    }
  }
  return false;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:26,代码来源:ORMShapeGraphicalNodeEditPolicy.java

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

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

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

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


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