Exemple #1
0
  @Override
  public void draw(DrawHandler drawHandler, DrawingInfo drawingInfo) {
    double width = drawingInfo.getSymmetricWidth(getFirstLifeline(), getLastLifeline(), tick);
    double height = getHeight(drawHandler, width);
    double topY =
        drawingInfo.getVerticalStart(tick) + (drawingInfo.getTickHeight(tick) - height) / 2;
    PointDouble topLeft =
        new PointDouble(
            drawingInfo.getHDrawingInfo(getFirstLifeline()).getSymmetricHorizontalStart(tick),
            topY);

    drawHandler.drawRectangle(topLeft.x, topLeft.y, width, height);
    PointDouble pentagonSize = PentagonDrawingHelper.draw(drawHandler, HEADER_TEXT, width, topLeft);
    TextSplitter.drawText(
        drawHandler,
        textLines,
        topLeft.x + pentagonSize.x + TEXT_X_PADDING,
        topLeft.y,
        width - (pentagonSize.x + TEXT_X_PADDING) * 2,
        height,
        AlignHorizontal.CENTER,
        AlignVertical.CENTER);

    for (Lifeline ll : coveredLifelines) {
      drawingInfo.getDrawingInfo(ll).addInterruptedArea(new Line1D(topLeft.y, topLeft.y + height));
    }
  }
Exemple #2
0
 private double getHeight(DrawHandler drawHandler, double width) {
   double textWidth =
       width
           - TEXT_X_PADDING * 2
           - PentagonDrawingHelper.getPentagonMinimumWidth(drawHandler, HEADER_TEXT) * 2;
   return Math.max(
       PentagonDrawingHelper.getHeight(drawHandler, HEADER_TEXT, width) + HEADER_BOTTOM_PADDING,
       TextSplitter.getSplitStringHeight(textLines, textWidth, drawHandler) + TEXT_Y_PADDING * 2);
 }
Exemple #3
0
 @Override
 public double getOverallMinWidth(DrawHandler drawHandler, double lifelineHorizontalPadding) {
   return PentagonDrawingHelper.getPentagonMinimumWidth(drawHandler, HEADER_TEXT) * 2
       + TEXT_X_PADDING * 2
       + TextSplitter.getTextMinWidth(textLines, drawHandler);
 }