Search in sources :

Example 1 with CreateContainerNodeCommand

use of com.cubrid.cubridmanager.ui.replication.editor.commands.CreateContainerNodeCommand in project cubrid-manager by CUBRID.

the class DiagramLayoutEditPolicy method getCreateCommand.

/**
	 * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
	 * @param request the CreateRequest
	 * @return a Command to perform a create
	 */
protected Command getCreateCommand(CreateRequest request) {
    if (!(request.getNewObject() instanceof Node)) {
        return null;
    }
    if (!(request.getNewObject() instanceof ContainerNode)) {
        return null;
    }
    CreateContainerNodeCommand cmd = new CreateContainerNodeCommand();
    cmd.setDiagram((Diagram) getHost().getModel());
    cmd.setNode((ContainerNode) request.getNewObject());
    Rectangle constraint = (Rectangle) getConstraintFor(request);
    cmd.setLocation(constraint.getLocation());
    return cmd;
}
Also used : CreateContainerNodeCommand(com.cubrid.cubridmanager.ui.replication.editor.commands.CreateContainerNodeCommand) ContainerNode(com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode) Node(com.cubrid.cubridmanager.ui.replication.editor.model.Node) Rectangle(org.eclipse.draw2d.geometry.Rectangle) ContainerNode(com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode)

Aggregations

CreateContainerNodeCommand (com.cubrid.cubridmanager.ui.replication.editor.commands.CreateContainerNodeCommand)1 ContainerNode (com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode)1 Node (com.cubrid.cubridmanager.ui.replication.editor.model.Node)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1