/** @Override Override for redirecting creation request to the lifeline */
 @Override
 public void eraseSourceFeedback(Request request) {
   if (request instanceof CreateUnspecifiedTypeRequest) {
     getParent().eraseSourceFeedback(request);
   }
   super.eraseSourceFeedback(request);
 }
  @Override
  protected void refreshBounds() {
    super.refreshBounds();

    int width =
        ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
    int height =
        ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height()))
            .intValue();
    // restore to default size
    if (width == -1) width = getFigure().getPreferredSize().width;
    if (height == -1) height = getFigure().getPreferredSize().height;

    if (width != -1 && height != -1) {
      Dimension size = primaryShape.getBounds().getSize();
      // if(size.width != width || size.height != height) { // if resize bounds
      primaryShape.setBounds(
          new Rectangle(primaryShape.getBounds().getLocation(), new Dimension(width, height)));
      // }
    }

    // fix combined fragment move
    this.getFigure().getParent().getLayoutManager().layout(this.getFigure().getParent());
    relocateLabelEditPart();
  }
 /** @Override */
 @Override
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(
       EditPolicyRoles.SEMANTIC_ROLE, new CustomDurationConstraintItemSemanticEditPolicy());
   // install a editpolicy to display stereotypes, there's a bug on super class.
   installEditPolicy(
       AppliedStereotypeCommentCreationEditPolicy.APPLIED_STEREOTYPE_COMMENT,
       new AppliedStereotypeCommentCreationEditPolicyEx());
 }
 /** @Override use ExternalLabelPositionLocator */
 @Override
 protected void addBorderItem(
     IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
   if (borderItemEditPart instanceof DurationConstraintLabelEditPart) {
     DurationConstraintLabelLocator locator = new DurationConstraintLabelLocator(getMainFigure());
     locator.setParentEditPart(this);
     borderItemContainer.add(borderItemEditPart.getFigure(), locator);
   } else if (borderItemEditPart instanceof DurationConstraintAppliedStereotypeEditPart) {
     // use ExternalLabelPositionLocator
     IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
     borderItemContainer.add(borderItemEditPart.getFigure(), locator);
   } else {
     super.addBorderItem(borderItemContainer, borderItemEditPart);
   }
 }
  @Override
  protected void handleNotificationEvent(Notification notification) {
    super.handleNotificationEvent(notification);
    Object feature = notification.getFeature();
    if ((getModel() != null) && (getModel() == notification.getNotifier())) {
      if (NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
        refreshLineWidth();
      }
    }

    if (notification.getNewValue() instanceof EAnnotation
        && ARROW.equals(((EAnnotation) notification.getNewValue()).getSource())) {
      refreshArrowDirection((EAnnotation) notification.getNewValue());
    } else if (notification.getNotifier() instanceof EAnnotation
        && ARROW.equals(((EAnnotation) notification.getNotifier()).getSource())) {
      refreshArrowDirection(
          (EAnnotation) notification.getNotifier()); // notification.getEventType() ==
    }
  }
 @Override
 protected void refreshVisuals() {
   super.refreshVisuals();
   refreshArrowDirection(null);
   refreshLineWidth();
 }