本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}