Package org.asem.eclipse.mii.model.commands

Examples of org.asem.eclipse.mii.model.commands.ConnectionCreateCommand


             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getConnectionCompleteCommand
             * (org.eclipse.gef.requests.CreateConnectionRequest)
             */
            protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
                ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
                cmd.setTarget((AbstractModelShape) getHost().getModel());
                return cmd;
            }

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getConnectionCreateCommand
             * (org.eclipse.gef.requests.CreateConnectionRequest)
             */
            protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
                AbstractModelShape source = (AbstractModelShape) getHost().getModel();
                int style = ((Integer) request.getNewObjectType()).intValue();
                ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, style);
                request.setStartCommand(cmd);
                return cmd;
            }

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getReconnectSourceCommand
             * (org.eclipse.gef.requests.ReconnectRequest)
             */
            protected Command getReconnectSourceCommand(ReconnectRequest request) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                AbstractModelShape newSource = (AbstractModelShape) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewSource(newSource);
                return cmd;
            }

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getReconnectTargetCommand
             * (org.eclipse.gef.requests.ReconnectRequest)
             */
            protected Command getReconnectTargetCommand(ReconnectRequest request) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                AbstractModelShape newTarget = (AbstractModelShape) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewTarget(newTarget);
                return cmd;
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.asem.eclipse.mii.model.commands.ConnectionCreateCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.