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


Java BendpointRequest.getLocation方法代码示例

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


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

示例1: getMoveBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointMoveCommand cmd = new BendpointMoveCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setIndex(request.getIndex());
	cmd.setNewLocation(p);
	return cmd;
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:14,代码来源:BendpointPolicy.java

示例2: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
protected Command getCreateBendpointCommand(BendpointRequest request) {
	CreateBendpointCommand com = new CreateBendpointCommand();
	Point p = request.getLocation();
	conn = getConnection();
	conn.translateToRelative(p);
	com.setLocation(p);
	Point ref1 = conn.getSourceAnchor().getReferencePoint();
	Point ref2 = conn.getTargetAnchor().getReferencePoint();

	conn.translateToRelative(ref1);
	conn.translateToRelative(ref2);

	com.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
	com.setConn((Connection) request.getSource().getModel());
	com.setIndex(request.getIndex());
	return com;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:18,代码来源:ConnectionBendpointEditPolicy.java

示例3: getMoveBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
protected Command getMoveBendpointCommand(BendpointRequest request) {
	MoveBendpointCommand com = new MoveBendpointCommand();
	Point p = request.getLocation();
	conn = getConnection();
	conn.translateToRelative(p);

	com.setLocation(p);

	Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
	Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

	conn.translateToRelative(ref1);
	conn.translateToRelative(ref2);

	com.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
	com.setConn((Connection) request.getSource().getModel());
	com.setIndex(request.getIndex());
	return com;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:20,代码来源:ConnectionBendpointEditPolicy.java

示例4: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(final BendpointRequest bendpointrequest) {
    final AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) getHost();
    final ConnectionElement connection = (ConnectionElement) connectionEditPart.getModel();

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

    final Point point = bendpointrequest.getLocation();
    getConnection().translateToRelative(point);

    final CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:ERDiagramBendpointEditPolicy.java

示例5: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(
		BendpointRequest bendpointrequest) {
	AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) this
			.getHost();
	ConnectionElement connection = (ConnectionElement) connectionEditPart
			.getModel();

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

	Point point = bendpointrequest.getLocation();
	this.getConnection().translateToRelative(point);

	CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(
			this.diagram.getCurrentCategory(),
			connection, point.x, point.y, bendpointrequest.getIndex());

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

示例6: showCreateBendpointFeedback

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * Shows feedback when a bendpoint is being created.  The original figure is used for
 * feedback and the original constraint is saved, so that it can be restored when feedback
 * is erased.
 * @param request the BendpointRequest
 */
protected void showCreateBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    List constraint;
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    if (originalConstraint == null) {
        saveOriginalConstraint();
        constraint = (List)getConnection().getRoutingConstraint();
        constraint.add(request.getIndex(), bp);
    } else {
        constraint = (List)getConnection().getRoutingConstraint();
    }
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:SequenceBendpointEditPolicy.java

示例7: showMoveBendpointFeedback

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * Shows feedback when a bendpoint is being moved.  Also checks to see if the bendpoint 
 * should be deleted and then calls {@link #showDeleteBendpointFeedback(BendpointRequest)}
 * if needed.  The original figure is used for feedback and the original constraint is 
 * saved, so that it can be restored when feedback is erased.
 * @param request the BendpointRequest
 */
protected void showMoveBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    if (!isDeleting)
        setReferencePoints(request);
    
    if (lineContainsPoint(ref1, ref2, p)) {
        if (!isDeleting) {
            isDeleting = true;
            eraseSourceFeedback(request);
            showDeleteBendpointFeedback(request);
        }
        return;
    }
    if (isDeleting) {
        isDeleting = false;
        eraseSourceFeedback(request);
    }
    if (originalConstraint == null)
        saveOriginalConstraint();
    List constraint = (List)getConnection().getRoutingConstraint();
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:SequenceBendpointEditPolicy.java

示例8: showCreateBendpointFeedback

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.editpolicies.BendpointEditPolicy#showCreateBendpointFeedback(org.eclipse.gef.requests.BendpointRequest)
 */
@Override
protected void showCreateBendpointFeedback(BendpointRequest request) {

    IFigure feedback = getDragSourceFeedbackFigure();

    Rectangle bounds = new Rectangle(getInitialFeedbackBounds().getCopy());
    PrecisionRectangle rect = new PrecisionRectangle(bounds);
    getHostFigure().translateToAbsolute(rect);
    Point movePoint = request.getLocation();
    
    movePoint.x = ((GraphicalEditPart) getHost()).getFigure().getBounds().x;//movePoint.x - rect.getSize().width / 2;
    rect.setLocation(movePoint);
    feedback.translateToRelative(rect);
    feedback.setBounds(rect);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:MessageBendpointEditPolicy.java

示例9: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
@Override
protected Command getCreateBendpointCommand(BendpointRequest bendpointrequest) {
    final AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) getHost();
    final WalkerConnection connection = (WalkerConnection) connectionEditPart.getModel();

    if (connection.getSourceWalker() == connection.getTargetWalker()) {
        return null;
    }

    final Point point = bendpointrequest.getLocation();
    getConnection().translateToRelative(point);

    final CreateBendpointCommand createBendpointCommand =
            new CreateBendpointCommand(connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:18,代码来源:ERDiagramBendpointEditPolicy.java

示例10: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(
		BendpointRequest bendpointrequest) {
	AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) this
			.getHost();
	ConnectionElement connection = (ConnectionElement) connectionEditPart
			.getModel();

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

	Point point = bendpointrequest.getLocation();
	this.getConnection().translateToRelative(point);

	CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(
			connection, point.x, point.y, bendpointrequest.getIndex());

	return createBendpointCommand;
}
 
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:24,代码来源:ERDiagramBendpointEditPolicy.java

示例11: showCreateBendpointFeedback

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * Shows feedback when a bendpoint is being created. The original figure is
 * used for feedback and the original constraint is saved, so that it can be
 * restored when feedback is erased.
 * 
 * @param request
 *            the BendpointRequest
 */
protected void showCreateBendpointFeedback(BendpointRequest request) {
	Point p = new Point(request.getLocation());
	List constraint;
	getConnection().translateToRelative(p);
	Bendpoint bp = new AbsoluteBendpoint(p);
	if (originalConstraint == null) {
		saveOriginalConstraint();
		constraint = (List) getConnection().getRoutingConstraint();
		constraint.add(request.getIndex(), bp);
	} else {
		constraint = (List) getConnection().getRoutingConstraint();
	}
	constraint.set(request.getIndex(), bp);
	getConnection().setRoutingConstraint(constraint);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:24,代码来源:BendpointEditPolicy.java

示例12: showMoveBendpointFeedback

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * Shows feedback when a bendpoint is being moved. Also checks to see if the
 * bendpoint should be deleted and then calls
 * {@link #showDeleteBendpointFeedback(BendpointRequest)} if needed. The
 * original figure is used for feedback and the original constraint is
 * saved, so that it can be restored when feedback is erased.
 * 
 * @param request
 *            the BendpointRequest
 */
protected void showMoveBendpointFeedback(BendpointRequest request) {
	Point p = new Point(request.getLocation());
	if (!isDeleting)
		setReferencePoints(request);

	if (lineContainsPoint(ref1, ref2, p)) {
		if (!isDeleting) {
			isDeleting = true;
			eraseSourceFeedback(request);
			showDeleteBendpointFeedback(request);
		}
		return;
	}
	if (isDeleting) {
		isDeleting = false;
		eraseSourceFeedback(request);
	}
	if (originalConstraint == null)
		saveOriginalConstraint();
	List constraint = (List) getConnection().getRoutingConstraint();
	getConnection().translateToRelative(p);
	Bendpoint bp = new AbsoluteBendpoint(p);
	constraint.set(request.getIndex(), bp);
	getConnection().setRoutingConstraint(constraint);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:36,代码来源:BendpointEditPolicy.java

示例13: getMoveBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
/**
 * This method creats and returns a command for changing the position of a {@link Bendpoint}.
 * 
 * @return {@link ORMRelationMoveBendpointCommand}
 */
@Override
protected Command getMoveBendpointCommand(final BendpointRequest request) {
  final ORMRelationMoveBendpointCommand command = new ORMRelationMoveBendpointCommand();

  Point p = request.getLocation();
  Connection conn = getConnection();

  conn.translateToRelative(p);
  Point sourceP = conn.getSourceAnchor().getReferencePoint();
  Point targetP = conn.getTargetAnchor().getReferencePoint();

  conn.translateToRelative(sourceP);
  conn.translateToRelative(targetP);

  command.setRelation((Relation) request.getSource().getModel());
  command.setNewDimension(p.getDifference(sourceP), p.getDifference(targetP));
  command.setIndex(request.getIndex());

  return command;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:26,代码来源:ORMRelationBendpointEditPolicy.java

示例14: getCreateBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
protected Command getCreateBendpointCommand(BendpointRequest request) {
    CreateBendpointCommand cmd = new CreateBendpointCommand();
    Point p = request.getLocation();
    Connection conn = (Connection) getConnection();

     conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

     conn.translateToRelative(ref1);
     conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((com.wt.studio.plugin.modeldesigner.editor.model.NodeConnection) request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:20,代码来源:ConnectionBendPointEditPolicy.java

示例15: getMoveBendpointCommand

import org.eclipse.gef.requests.BendpointRequest; //导入方法依赖的package包/类
protected Command getMoveBendpointCommand(BendpointRequest request) {
    MoveBendpointCommand cmd = new MoveBendpointCommand();
    Point p = request.getLocation();
    Connection conn = getConnection();

    conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

    conn.translateToRelative(ref1);
    conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((com.wt.studio.plugin.modeldesigner.editor.model.NodeConnection) request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:20,代码来源:ConnectionBendPointEditPolicy.java


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