@Override
  protected Command getCreateCommand(CreateRequest request) {
    if (request instanceof CreateViewAndElementRequest) {

      CreateViewAndElementRequest req = (CreateViewAndElementRequest) request;

      if (req.getViewAndElementDescriptor()
              .getSemanticHint()
              .equals(((IHintedType) UMLElementTypes.Pseudostate_16000).getSemanticHint())
          || req.getViewAndElementDescriptor()
              .getSemanticHint()
              .equals(((IHintedType) UMLElementTypes.Pseudostate_17000).getSemanticHint())
          || req.getViewAndElementDescriptor()
              .getSemanticHint()
              .equals(
                  ((IHintedType) UMLElementTypes.ConnectionPointReference_18000)
                      .getSemanticHint())) {

        TransactionalEditingDomain editingDomain =
            ((IGraphicalEditPart) getHost()).getEditingDomain();

        CompositeTransactionalCommand cc =
            new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label);
        Iterator<?> iter = req.getViewDescriptors().iterator();

        // Retrieve parent location
        Point parentLoc = getHostFigure().getBounds().getLocation().getCopy();

        // Compute relative creation location
        Point requestedLocation = request.getLocation().getCopy();
        getHostFigure().translateToRelative(requestedLocation);

        // Create proposed creation bounds and use the locator to find the expected position
        CustomEntryExitPointPositionLocator locator =
            new CustomEntryExitPointPositionLocator(getHostFigure(), PositionConstants.NONE);
        Rectangle proposedBounds = new Rectangle(requestedLocation, new Dimension(20, 20));
        Rectangle preferredBounds = locator.getPreferredLocation(proposedBounds);

        // Convert the calculated preferred bounds as relative to parent location
        Rectangle creationBounds = preferredBounds.getTranslated(parentLoc.getNegated());

        while (iter.hasNext()) {

          CreateViewRequest.ViewDescriptor viewDescriptor =
              (CreateViewRequest.ViewDescriptor) iter.next();
          cc.compose(
              new SetBoundsCommand(
                  editingDomain,
                  DiagramUIMessages.SetLocationCommand_Label_Resize,
                  viewDescriptor,
                  creationBounds));
        }

        if (cc.reduce() == null) {
          return null;
        }

        return new ICommandProxy(cc.reduce());
      }
    }
    return null;
  }