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


Java ReconnectRequest类代码示例

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


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


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