Пример #1
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());
  }
Пример #2
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());
  }