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;
}
Aggregations