示例#1
0
 private SegmentColored getSegment(StringBounder stringBounder) {
   final SegmentColored segment = p1.getLiveThicknessAt(stringBounder, getStartingY());
   final SegmentColored segment2 =
       p1.getLiveThicknessAt(
           stringBounder, getStartingY() + comp.getPreferredHeight(stringBounder));
   return segment.merge(segment2);
 }
示例#2
0
 @Override
 protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
   final StringBounder stringBounder = ug.getStringBounder();
   final double xStart = getStartingX(stringBounder);
   ug = ug.apply(new UTranslate(xStart, getStartingY()));
   final Dimension2D dimensionToUse =
       new Dimension2DDouble(
           getPreferredWidth(stringBounder), comp.getPreferredHeight(stringBounder));
   if (url != null) {
     ug.startUrl(url);
   }
   comp.drawU(ug, new Area(dimensionToUse), context);
   if (url != null) {
     ug.closeAction();
   }
 }
示例#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());
  }
示例#4
0
 @Override
 public final double getPreferredHeight(StringBounder stringBounder) {
   return comp.getPreferredHeight(stringBounder);
 }
示例#5
0
 public Dimension2D calculateDimension(StringBounder stringBounder) {
   final double height = comp.getPreferredHeight(stringBounder);
   final double width = comp.getPreferredWidth(stringBounder);
   return new Dimension2DDouble(width, height);
 }