• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ReconnectRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ReconnectRequest类属于org.eclipse.gef.requests包,在下文中一共展示了ReconnectRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectSourceCommand(
		ReconnectRequest request) {
	
	Link link=(Link)request.getConnectionEditPart().getModel();
	Component comp=getComponentEditPart().getCastedModel();
	
	LinkReconnectSourceCommand cmd=new LinkReconnectSourceCommand(link);
	cmd.setOldSource(link);
	cmd.setNewSource(comp);
	ConnectionAnchor anchor=getComponentEditPart().getSourceConnectionAnchor(request);
	if(anchor==null){
		return null;
	}
	cmd.setNewSourceTerminal(getComponentEditPart().mapConnectionAnchorToTerminal(anchor));
	

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


示例2: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectTargetCommand(
		ReconnectRequest request) {
	Link link=(Link)request.getConnectionEditPart().getModel();
	Component component=getComponentEditPart().getCastedModel();
	ConnectionAnchor anchor=getComponentEditPart().getTargetConnectionAnchor(request);
	if(anchor==null){
		return null;
	}
	LinkReconnectTargetCommand command=new LinkReconnectTargetCommand(link);
	command.setOldTarget(link);
	command.setNewTarget(component);
	command.setNewTargetTerminal(getComponentEditPart().mapConnectionAnchorToTerminal(anchor));
	
	return command;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:17,代码来源:NodeConnectionEditPolicy.java


示例3: showSourceFeedback

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
public void showSourceFeedback(Request req) {
	ReconnectRequest request = ((ReconnectRequest) req);
	Link link = (Link) request.getConnectionEditPart().getModel();
	ExchangeNode target = link.inputNode.getInput(link.processLink);
	ExchangeNode source = link.outputNode.getOutput(link.processLink);
	ExchangeNode n1 = request.isMovingStartAnchor() ? target : source;
	ExchangeNode n2 = request.isMovingStartAnchor() ? source : target;
	if (n1 != null) {
		ProductSystemNode productSystemNode = n1.parent().parent();
		productSystemNode.highlightMatchingExchanges(n1);
		n1.setHighlighted(true);
	}
	if (n2 != null)
		n2.setHighlighted(true);
	super.showSourceFeedback(req);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:18,代码来源:LinkPart.java


示例4: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
	ConnectionReconnectCommand result = new ConnectionReconnectCommand();
	GWLink link = (GWLink) request.getConnectionEditPart().getModel();
	if (getHost().getModel() instanceof GraphElement) {
		result.setGraph(((GraphElement) getHost().getModel()).getGraph());
		result.setNewSource((GraphElement) getHost().getModel());
		result.setLink(link);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4ENodeGraphicalNodeEditPolicy.java


示例5: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
	ConnectionReconnectCommand result = new ConnectionReconnectCommand();
	GWLink link = (GWLink) request.getConnectionEditPart().getModel();
	if (getHost().getModel() instanceof GraphElement) {
		result.setGraph(((GraphElement) getHost().getModel()).getGraph());
		result.setNewTarget((GraphElement) getHost().getModel());
		result.setLink(link);
		return result;
	}
	return UnexecutableCommand.INSTANCE;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4ENodeGraphicalNodeEditPolicy.java


示例6: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
	Transition transition=(Transition)request.getConnectionEditPart().getModel();
	AbstractNodeElement target=(AbstractNodeElement)request.getTarget().getModel();
	TransitionReconnectionCommand command=new TransitionReconnectionCommand(transition);
	command.setTarget(target);
	return command;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:TransitionEditPolicy.java


示例7: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
	Transition transition=(Transition)request.getConnectionEditPart().getModel();
	AbstractNodeElement target=(AbstractNodeElement)request.getTarget().getModel();
	TransitionReconnectionCommand command=new TransitionReconnectionCommand(transition);
	command.setSource(target);
	return command;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:TransitionEditPolicy.java


示例8: getFeedbackHelper

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
protected FeedbackHelper getFeedbackHelper(ReconnectRequest request) {
	if (feedbackHelper == null) {
		feedbackHelper = new HyParentChildConnectionFeedbackHelper();
		feedbackHelper.setConnection(getConnection());
		feedbackHelper.setMovingStartAnchor(request.isMovingStartAnchor());
	}
	
	return feedbackHelper;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:10,代码来源:DwParentChildConnectionEndpointEditPolicy.java


示例9: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getReconnectSourceCommand(final ReconnectRequest reconnectrequest) {
    final ConnectionElement connection = (ConnectionElement) reconnectrequest.getConnectionEditPart().getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    final NodeElement newSource = (NodeElement) reconnectrequest.getTarget().getModel();
    if (connection.getSource() != newSource) {
        return null;
    }

    final NodeElementEditPart sourceEditPart = (NodeElementEditPart) reconnectrequest.getConnectionEditPart().getSource();

    final Point location = new Point(reconnectrequest.getLocation());

    final IFigure sourceFigure = sourceEditPart.getFigure();
    sourceFigure.translateToRelative(location);

    int xp = -1;
    int yp = -1;

    final Rectangle bounds = sourceFigure.getBounds();

    final Rectangle centerRectangle = new Rectangle(bounds.x + (bounds.width / 4), bounds.y + (bounds.height / 4), bounds.width / 2, bounds.height / 2);

    if (!centerRectangle.contains(location)) {
        final Point point = NodeElementEditPart.getIntersectionPoint(location, sourceFigure);
        xp = 100 * (point.x - bounds.x) / bounds.width;
        yp = 100 * (point.y - bounds.y) / bounds.height;
    }

    final ReconnectSourceCommand command = new ReconnectSourceCommand(connection, xp, yp);

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


示例10: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getReconnectTargetCommand(final ReconnectRequest reconnectrequest) {
    final ConnectionElement connection = (ConnectionElement) reconnectrequest.getConnectionEditPart().getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    final NodeElement newTarget = (NodeElement) reconnectrequest.getTarget().getModel();
    if (connection.getTarget() != newTarget) {
        return null;
    }

    final NodeElementEditPart targetEditPart = (NodeElementEditPart) reconnectrequest.getConnectionEditPart().getTarget();

    final Point location = new Point(reconnectrequest.getLocation());

    final IFigure targetFigure = targetEditPart.getFigure();
    targetFigure.translateToRelative(location);

    int xp = -1;
    int yp = -1;

    final Rectangle bounds = targetFigure.getBounds();

    final Rectangle centerRectangle = new Rectangle(bounds.x + (bounds.width / 4), bounds.y + (bounds.height / 4), bounds.width / 2, bounds.height / 2);

    if (!centerRectangle.contains(location)) {
        final Point point = NodeElementEditPart.getIntersectionPoint(location, targetFigure);

        xp = 100 * (point.x - bounds.x) / bounds.width;
        yp = 100 * (point.y - bounds.y) / bounds.height;
    }
    final ReconnectTargetCommand command = new ReconnectTargetCommand(connection, xp, yp);

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


示例11: getCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * Extended request data key to hold editpart visual id.
 * Add visual id of edited editpart to extended data of the request
 * so command switch can decide what kind of diagram element is being edited.
 * It is done in those cases when it's not possible to deduce diagram
 * element kind from domain element.
 * 
 * @generated
 */
public Command getCommand(Request request) {
	if (request instanceof ReconnectRequest) {
		Object view = ((ReconnectRequest) request).getConnectionEditPart()
				.getModel();
		if (view instanceof View) {
			Integer id = new Integer(
					StatemachineVisualIDRegistry.getVisualID((View) view));
			request.getExtendedData().put(VISUAL_ID_KEY, id);
		}
	}
	return super.getCommand(request);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:22,代码来源:StatemachineBaseItemSemanticEditPolicy.java


示例12: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * @see GraphicalNodeEditPolicy#getReconnectSourceCommand(ReconnectRequest)
 */
protected Command getReconnectSourceCommand(ReconnectRequest request) {
	TableJoin tj = ((RelationshipPart) request.getConnectionEditPart()).getModel();
	TableEditPart tep = (TableEditPart) getHost();
	SQLQueryDesigner designer = ((TableEditPart) getHost()).getDesigner();
	if (tep.getModel() == tj.getJoinTable())
		return null;
	return new MoveJoinCommand(tep.getModel(), tj, designer);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:TableNodeEditPolicy.java


示例13: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * @see GraphicalNodeEditPolicy#getReconnectTargetCommand(ReconnectRequest)
 */
protected Command getReconnectTargetCommand(ReconnectRequest request) {
	TableJoin tj = ((RelationshipPart) request.getConnectionEditPart()).getModel();
	TableEditPart tep = (TableEditPart) getHost();
	if (tep.getModel() == tj.getFromTable())
		return null;

	SQLQueryDesigner designer = ((TableEditPart) getHost()).getDesigner();
	return new MoveJoinCommand(tj, tep.getModel(), designer);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:TableNodeEditPolicy.java


示例14: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectSourceCommand(ReconnectRequest reconnectrequest) {
    final WalkerConnection connection = (WalkerConnection) reconnectrequest.getConnectionEditPart().getModel();
    if (!(connection instanceof Relationship)) {
        return null;
    }
    final Relationship relation = (Relationship) connection;
    if (relation.getSourceWalker() == relation.getTargetWalker()) {
        return null;
    }
    final DiagramWalker newSource = ((DiagramWalker) reconnectrequest.getTarget().getModel()).toMaterialize();
    if (!relation.getSourceWalker().equals(newSource)) {
        return null;
    }
    final DiagramWalkerEditPart sourceEditPart = (DiagramWalkerEditPart) reconnectrequest.getConnectionEditPart().getSource();
    final Point location = new Point(reconnectrequest.getLocation());
    final IFigure sourceFigure = sourceEditPart.getFigure();
    sourceFigure.translateToRelative(location);
    int xp = -1;
    int yp = -1;
    final Rectangle bounds = sourceFigure.getBounds();
    final Rectangle centerRectangle =
            new Rectangle(bounds.x + (bounds.width / 4), bounds.y + (bounds.height / 4), bounds.width / 2, bounds.height / 2);
    if (!centerRectangle.contains(location)) {
        final Point point = ERTableEditPart.getIntersectionPoint(location, sourceFigure);
        xp = 100 * (point.x - bounds.x) / bounds.width;
        yp = 100 * (point.y - bounds.y) / bounds.height;
    }
    final ReconnectSourceCommand command = new ReconnectSourceCommand(relation, xp, yp);
    return command;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:32,代码来源:DiagramWalkerGraphicalNodeEditPolicy.java


示例15: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
@Override
protected Command getReconnectTargetCommand(ReconnectRequest reconnectrequest) {
    final WalkerConnection connection = (WalkerConnection) reconnectrequest.getConnectionEditPart().getModel();
    if (!(connection instanceof Relationship)) {
        return null;
    }
    final Relationship relation = (Relationship) connection;
    if (relation.getSourceWalker() == relation.getTargetWalker()) {
        return null;
    }
    final DiagramWalker newTarget = ((DiagramWalker) reconnectrequest.getTarget().getModel()).toMaterialize();
    if (!relation.getTargetWalker().equals(newTarget)) {
        return null;
    }
    final DiagramWalkerEditPart targetEditPart = (DiagramWalkerEditPart) reconnectrequest.getConnectionEditPart().getTarget();
    final Point location = new Point(reconnectrequest.getLocation());
    final IFigure targetFigure = targetEditPart.getFigure();
    targetFigure.translateToRelative(location);
    int xp = -1;
    int yp = -1;
    final Rectangle bounds = targetFigure.getBounds();
    final Rectangle centerRectangle =
            new Rectangle(bounds.x + (bounds.width / 4), bounds.y + (bounds.height / 4), bounds.width / 2, bounds.height / 2);
    if (!centerRectangle.contains(location)) {
        final Point point = ERTableEditPart.getIntersectionPoint(location, targetFigure);
        xp = 100 * (point.x - bounds.x) / bounds.width;
        yp = 100 * (point.y - bounds.y) / bounds.height;
    }
    final ReconnectTargetCommand command = new ReconnectTargetCommand(relation, xp, yp);
    return command;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:32,代码来源:DiagramWalkerGraphicalNodeEditPolicy.java


示例16: eraseConnectionMoveFeedback

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * Erases connection move feedback. This method is called when a
 * ReconnectRequest is received.
 * 
 * @param request
 *            the reconnect request.
 */
protected void eraseConnectionMoveFeedback(ReconnectRequest request) {
	if (originalAnchor == null)
		return;
	if (request.isMovingStartAnchor())
		getConnection().setSourceAnchor(originalAnchor);
	else
		getConnection().setTargetAnchor(originalAnchor);
	originalAnchor = null;
	feedbackHelper = null;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:18,代码来源:ConnectionEndpointEditPolicy.java


示例17: getCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * Factors the request into one of four abstract methods. Subclasses must
 * implement these methods.
 * 
 * @see org.eclipse.gef.EditPolicy#getCommand(Request)
 */
public Command getCommand(Request request) {
	if (REQ_CONNECTION_START.equals(request.getType()))
		return getConnectionCreateCommand((CreateConnectionRequest) request);
	if (REQ_CONNECTION_END.equals(request.getType()))
		return getConnectionCompleteCommand((CreateConnectionRequest) request);
	if (REQ_RECONNECT_TARGET.equals(request.getType()))
		return getReconnectTargetCommand((ReconnectRequest) request);
	if (REQ_RECONNECT_SOURCE.equals(request.getType()))
		return getReconnectSourceCommand((ReconnectRequest) request);

	return null;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:GraphicalNodeEditPolicy.java


示例18: getCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
/**
 * Extended request data key to hold editpart visual id.
 * Add visual id of edited editpart to extended data of the request
 * so command switch can decide what kind of diagram element is being edited.
 * It is done in those cases when it's not possible to deduce diagram
 * element kind from domain element.
 * 
 * @generated
 */
public Command getCommand(Request request) {
	if (request instanceof ReconnectRequest) {
		Object view = ((ReconnectRequest) request).getConnectionEditPart()
				.getModel();
		if (view instanceof View) {
			Integer id = new Integer(SmcVisualIDRegistry
					.getVisualID((View) view));
			request.getExtendedData().put(VISUAL_ID_KEY, id);
		}
	}
	return super.getCommand(request);
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:22,代码来源:SmcBaseItemSemanticEditPolicy.java


示例19: getReconnectSourceCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
protected Command getReconnectSourceCommand(ReconnectRequest request) {
	ReconnectSourceCommand cmd = new ReconnectSourceCommand();
	cmd.setTransition((Transition) request.getConnectionEditPart()
			.getModel());
	cmd.setSource(getNodeElement());
	return cmd;
}
 
开发者ID:snakerflow,项目名称:snaker-designer,代码行数:8,代码来源:ProcessGraphicalNodeEditPolicy.java


示例20: getReconnectTargetCommand

import org.eclipse.gef.requests.ReconnectRequest; //导入依赖的package包/类
protected Command getReconnectTargetCommand(ReconnectRequest request) {
	ReconnectTargetCommand cmd = new ReconnectTargetCommand();
	cmd.setTransition((Transition) request.getConnectionEditPart()
			.getModel());
	cmd.setTarget(getNodeElement());
	return cmd;
}
 
开发者ID:snakerflow,项目名称:snaker-designer,代码行数:8,代码来源:ProcessGraphicalNodeEditPolicy.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UplevelReference类代码示例发布时间:2022-05-21
下一篇:
Java SpawnPlacementType类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap