/**
   * Returns the compound command for converting the node type.
   *
   * @return the command.
   */
  public CompoundCommand createCommand() {
    Argument currentArgument = (Argument) currentDiagram.getElement();
    if (currentArgument == null) {
      return null;
    }

    Set<String> excludeIdSet = DcaseEditorUtil.getChildUUIDs(currentArgumentEditPart);

    CompoundCommand cc = new CompoundCommand(CONVERT_NODE_TYPE_CMD_LABEL);

    PreferencesHint diagramPrefHint = currentArgumentEditPart.getDiagramPreferencesHint();

    // shows children.
    NodeChildrenShowHandler showHandler = new NodeChildrenShowHandler();
    ChangeVisibleEditPartsCommand changeVisibleEditPartsCommand =
        new ChangeVisibleEditPartsCommand(
            CONST_CHANGE_VISIBLE_COMMAND_LABEL,
            showHandler.getChildrenToShow((ShapeNodeEditPart) currentEditPart),
            true);
    cc.add(new ICommandProxy(changeVisibleEditPartsCommand));

    IElementType elementType = getElementType(newNodeType);

    ViewAndElementDescriptor descriptor =
        new ViewAndElementDescriptor(
            new CreateElementRequestAdapter(new CreateElementRequest(elementType)),
            Node.class,
            ((IHintedType) elementType).getSemanticHint(),
            diagramPrefHint);

    CreateViewAndElementRequest createNodeRequest = new CreateViewAndElementRequest(descriptor);
    createNodeRequest.setLocation(getNewNodeAbsoluteLocation(currentEditPart));
    createNodeRequest.setSize(new Dimension(-1, -1));
    Command createNodeCommand = currentArgumentEditPart.getCommand(createNodeRequest);
    cc.add(createNodeCommand);

    UpdateLinkCommand convertLinkCommand =
        new UpdateLinkCommand(
            currentDomain,
            UPDATE_BASICLINK_COMMAND_LABEL,
            currentArgument,
            oldNode,
            currentArgumentEditPart,
            createNodeRequest);
    cc.add(new ICommandProxy(convertLinkCommand));

    CopyNodeAttributeCommand copyAttributeCommand =
        new CopyNodeAttributeCommand(
            currentDomain,
            COPY_NODE_ATTRIBUTE_COMMAND_LABEL,
            oldNode,
            currentArgumentEditPart,
            createNodeRequest,
            newName);
    cc.add(new ICommandProxy(copyAttributeCommand));

    ICommand selectCommand =
        new SelectExcludesCommand(SELECT_COMMAND_LABEL, currentArgumentEditPart, excludeIdSet);
    cc.add(new ICommandProxy(selectCommand));
    return cc;
  }