Ejemplo n.º 1
0
  Step1MessageExo(
      ParticipantRange range,
      StringBounder stringBounder,
      MessageExo message,
      DrawableSet drawingSet,
      Frontier freeY) {
    super(range, stringBounder, message, drawingSet, freeY);

    setConfig(getArrowType(message));

    this.messageArrow =
        new MessageExoArrow(
            freeY.getFreeY(range),
            drawingSet.getSkin(),
            drawingSet
                .getSkin()
                .createComponent(
                    ComponentType.ARROW,
                    getConfig(),
                    drawingSet.getSkinParam(),
                    getLabelOfMessage(message)),
            getLivingParticipantBox(),
            message.getType(),
            message.getUrl(),
            message.isShortArrow(),
            message.getArrowConfiguration());

    if (message.getNote() != null) {
      final ISkinParam skinParam =
          new SkinParamBackcolored(drawingSet.getSkinParam(), message.getSpecificBackColor());
      setNote(
          drawingSet
              .getSkin()
              .createComponent(ComponentType.NOTE, null, skinParam, message.getNote()));
      // throw new UnsupportedOperationException();
    }
  }
Ejemplo n.º 2
0
  protected final void beforeMessage(LifeEvent n, final double pos) {
    final Participant p = n.getParticipant();
    final LifeLine line = drawingSet.getLivingParticipantBox(p).getLifeLine();

    if (n.getType() != LifeEventType.ACTIVATE) {
      return;
    }
    assert n.getType() == LifeEventType.ACTIVATE;

    int delta = 0;
    if (message.isCreate()) {
      delta += 10;
    }
    line.addSegmentVariation(LifeSegmentVariation.LARGER, pos + delta, n.getSpecificBackColor());
  }
Ejemplo n.º 3
0
  protected final void afterMessage(StringBounder stringBounder, LifeEvent n, final double pos) {
    final Participant p = n.getParticipant();
    final LifeLine line = drawingSet.getLivingParticipantBox(p).getLifeLine();

    if (n.getType() == LifeEventType.ACTIVATE || n.getType() == LifeEventType.CREATE) {
      return;
    }

    if (n.getType() == LifeEventType.DESTROY) {
      final Component comp =
          drawingSet
              .getSkin()
              .createComponent(ComponentType.DESTROY, drawingSet.getSkinParam(), null);
      final double delta = comp.getPreferredHeight(stringBounder) / 2;
      final LifeDestroy destroy =
          new LifeDestroy(
              pos - delta, drawingSet.getLivingParticipantBox(p).getParticipantBox(), comp);
      drawingSet.addEvent(n, destroy);
    } else if (n.getType() != LifeEventType.DEACTIVATE) {
      throw new IllegalStateException();
    }

    line.addSegmentVariation(LifeSegmentVariation.SMALLER, pos, n.getSpecificBackColor());
  }