Package org.locationtech.udig.printing.ui.internal.editor.commands

Examples of org.locationtech.udig.printing.ui.internal.editor.commands.ConnectionCreateCommand


    protected void createEditPolicies() {
        installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageElementEditPolicy());
        installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GraphicalNodeEditPolicy(){

            protected Command getConnectionCompleteCommand( CreateConnectionRequest request ) {
                ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
                cmd.setTarget((Box) getHost().getModel());
                return cmd;
            }

            protected Command getConnectionCreateCommand( CreateConnectionRequest request ) {
                Box source = (Box) getHost().getModel();
                ConnectionCreateCommand cmd = new ConnectionCreateCommand(source);
                request.setStartCommand(cmd);
                return cmd;
            }

            protected Command getReconnectTargetCommand( ReconnectRequest request ) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                Box newTarget = (Box) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewTarget(newTarget);
                return cmd;
            }

            protected Command getReconnectSourceCommand( ReconnectRequest request ) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                Box newSource = (Box) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewSource(newSource);
                return cmd;
            }

        });
View Full Code Here

TOP

Related Classes of org.locationtech.udig.printing.ui.internal.editor.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.