@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; }
@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; }
@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); }
@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; }
@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; }
@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; }
@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; }
protected FeedbackHelper getFeedbackHelper(ReconnectRequest request) { if (feedbackHelper == null) { feedbackHelper = new HyParentChildConnectionFeedbackHelper(); feedbackHelper.setConnection(getConnection()); feedbackHelper.setMovingStartAnchor(request.isMovingStartAnchor()); } return feedbackHelper; }
/** * {@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; }
/** * {@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; }
/** * 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); }
/** * @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); }
/** * @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); }
@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; }
@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; }
/** * 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; }
/** * 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; }
/** * 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); }
protected Command getReconnectSourceCommand(ReconnectRequest request) { ReconnectSourceCommand cmd = new ReconnectSourceCommand(); cmd.setTransition((Transition) request.getConnectionEditPart() .getModel()); cmd.setSource(getNodeElement()); return cmd; }
protected Command getReconnectTargetCommand(ReconnectRequest request) { ReconnectTargetCommand cmd = new ReconnectTargetCommand(); cmd.setTransition((Transition) request.getConnectionEditPart() .getModel()); cmd.setTarget(getNodeElement()); return cmd; }
/** * 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( Wc2014VisualIDRegistry.getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
public ConnectionAnchor getSourceConnectionAnchor(Request request) { //return new ChopboxAnchor(getFigure()); if(request instanceof ReconnectRequest) { ReconnectRequest r = (ReconnectRequest)request; NodeConnectionEditPart con =(NodeConnectionEditPart) r.getConnectionEditPart(); NodeConnection conModel = (NodeConnection)con.getModel(); BorderAnchor anchor = con.getSourceAnchor(); GraphicalEditPart part = (GraphicalEditPart)r.getTarget(); if(anchor == null || anchor.getOwner() != part.getFigure()) { anchor = new RectangleBorderAnchor(getFigure()); anchor.setAngle(conModel.getSourceAngle()); con.setSourceAnchor(anchor); } Point loc = r.getLocation(); Rectangle rect = Rectangle.SINGLETON; rect.setBounds(getFigure().getBounds()); getFigure().translateToAbsolute(rect); Point ref = rect.getCenter(); double dx = loc.x - ref.x; double dy = loc.y - ref.y; anchor.setAngle(Math.atan2(dy, dx)); con.setSourceAnchor(anchor); conModel.setSourceAngle(anchor.getAngle()); return anchor; } else { return new RectangleBorderAnchor(getFigure()); } }
public ConnectionAnchor getTargetConnectionAnchor(Request request) { //return new ChopboxAnchor(getFigure()); //return new ChopboxAnchor(getFigure()); if(request instanceof ReconnectRequest) { ReconnectRequest r = (ReconnectRequest)request; NodeConnectionEditPart con =(NodeConnectionEditPart) r.getConnectionEditPart(); NodeConnection conModel = (NodeConnection)con.getModel(); BorderAnchor anchor = con.getTargetAnchor(); GraphicalEditPart part = (GraphicalEditPart)r.getTarget(); if(anchor == null || anchor.getOwner() != part.getFigure()) { anchor = new RectangleBorderAnchor(getFigure()); anchor.setAngle(conModel.getTargetAngle()); con.setTargetAnchor(anchor); } Point loc = r.getLocation(); Rectangle rect = Rectangle.SINGLETON; rect.setBounds(getFigure().getBounds()); getFigure().translateToAbsolute(rect); Point ref = rect.getCenter(); double dx = loc.x - ref.x; double dy = loc.y - ref.y; anchor.setAngle(Math.atan2(dy, dx)); con.setTargetAnchor(anchor); conModel.setTargetAngle(anchor.getAngle()); return anchor; } else { return new RectangleBorderAnchor(getFigure()); } }
public ConnectionAnchor getSourceConnectionAnchor(Request request) { if(request instanceof ReconnectRequest) { ReconnectRequest r = (ReconnectRequest)request; ColumnConnectionEditPart con =(ColumnConnectionEditPart) r.getConnectionEditPart(); ColumnConnection conModel = (ColumnConnection)con.getModel(); BorderAnchor anchor = con.getSourceAnchor(); GraphicalEditPart part = (GraphicalEditPart)r.getTarget(); if(anchor == null || anchor.getOwner() != part.getFigure()) { anchor = new RectangleBorderAnchor(getFigure()); anchor.setAngle(conModel.getSourceAngle()); con.setSourceAnchor(anchor); } Point loc = r.getLocation(); Rectangle rect = Rectangle.SINGLETON; rect.setBounds(getFigure().getBounds()); getFigure().translateToAbsolute(rect); Point ref = rect.getCenter(); double dx = loc.x - ref.x; double dy = loc.y - ref.y; anchor.setAngle(Math.atan2(dy, dx)); con.setSourceAnchor(anchor); conModel.setSourceAngle(anchor.getAngle()); return anchor; } else { return new RectangleBorderAnchor(getFigure()); } }
public ConnectionAnchor getTargetConnectionAnchor(Request request) { if(request instanceof ReconnectRequest) { ReconnectRequest r = (ReconnectRequest)request; ColumnConnectionEditPart con =(ColumnConnectionEditPart) r.getConnectionEditPart(); ColumnConnection conModel = (ColumnConnection)con.getModel(); BorderAnchor anchor = con.getTargetAnchor(); GraphicalEditPart part = (GraphicalEditPart)r.getTarget(); if(anchor == null || anchor.getOwner() != part.getFigure()) { anchor = new RectangleBorderAnchor(getFigure()); anchor.setAngle(conModel.getTargetAngle()); con.setTargetAnchor(anchor); } Point loc = r.getLocation(); Rectangle rect = Rectangle.SINGLETON; rect.setBounds(getFigure().getBounds()); getFigure().translateToAbsolute(rect); Point ref = rect.getCenter(); double dx = loc.x - ref.x; double dy = loc.y - ref.y; anchor.setAngle(Math.atan2(dy, dx)); con.setTargetAnchor(anchor); conModel.setTargetAngle(anchor.getAngle()); return anchor; } else { return new RectangleBorderAnchor(getFigure()); } }
protected Command getReconnectSourceCommand(ReconnectRequest request) { ReconnectTableSourceCommand cmd = new ReconnectTableSourceCommand(); cmd.setConnection((TableConnection)request.getConnectionEditPart().getModel()); cmd.setSource((MOFunctionTableModel)getHost().getModel()); return cmd; }
protected Command getReconnectSourceCommand(ReconnectRequest request) { ReconnectSourceCommand cmd = new ReconnectSourceCommand(); cmd.setConnection((ColumnConnection)request.getConnectionEditPart().getModel()); cmd.setSource((FunctionColumnModel)getHost().getModel()); return cmd; }
protected Command getReconnectTargetCommand(ReconnectRequest request) { // IntentionalElementRef source = (IntentionalElementRef) getHost().getModel(); // CreateElementLinkCommand cmd = new CreateElementLinkCommand (source.getDiagram().getUrndefinition().getUrnspec(), source.getDef(), // (ElementLink)request.getTarget()); // request.setStartCommand(cmd); return null; }
protected Command getReconnectSourceCommand(ReconnectRequest request) { // IntentionalElementRef source = (IntentionalElementRef) getHost().getModel(); // CreateElementLinkCommand cmd = new CreateElementLinkCommand (source.getDiagram().getUrndefinition().getUrnspec(), source.getDef(), // (ElementLink)request.getTarget()); // request.setStartCommand(cmd); return null; }
/** * 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( edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVOVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.part.NECSIS14_DatabaseSchemaVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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(MIDVisualIDRegistry.getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.RelationalDatabase_MAVOVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( RelationalDatabaseVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry .getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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( IStarVisualIDRegistry.getVisualID((View) view)); request.getExtendedData().put(VISUAL_ID_KEY, id); } } return super.getCommand(request); }
/** * 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); }