示例#1
0
 private void encodeNameAndConditionDefined(
     SheetGraphics graphics, VirtueFlawContent content, Bounds textBounds)
     throws DocumentException {
   Phrase phrase = new Phrase();
   phrase.add(new Chunk(content.getVirtueFlawName() + ": ", createNameFont(graphics)));
   phrase.add(new Chunk(content.getLimitBreakCondition(), createConditionFont(graphics)));
   graphics
       .createSimpleColumn(textBounds)
       .withLeading(REDUCED_LINE_HEIGHT)
       .andTextPart(phrase)
       .encode();
 }
示例#2
0
 @Override
 public void encode(SheetGraphics graphics, ReportContent reportContent, Bounds bounds)
     throws DocumentException {
   VirtueFlawContent content = createContent(reportContent);
   VirtueFlawBoxEncoder traitEncoder = new VirtueFlawBoxEncoder();
   float traitHeight = traitEncoder.encodeHeight(graphics, bounds, content.getLimitValue());
   float traitInterval = traitHeight + 1f;
   Bounds textBounds = new Bounds(bounds.x, bounds.y, bounds.width, bounds.height - traitInterval);
   if (!content.isNameDefined() && !content.isConditionDefined()) {
     encodeLines(graphics, bounds, REDUCED_LINE_HEIGHT, textBounds.getMaxY());
   }
   if (content.isNameDefined() && content.isConditionDefined()) {
     encodeNameAndConditionDefined(graphics, content, textBounds);
   }
   if (content.isNameDefined() && !content.isConditionDefined()) {
     encodeOnlyNameDefined(graphics, bounds, content, textBounds);
   }
   if (!content.isNameDefined() && content.isConditionDefined()) {
     encodeOnlyConditionDefined(graphics, content, textBounds);
   }
 }
示例#3
0
 private void encodeOnlyNameDefined(
     SheetGraphics graphics, Bounds bounds, VirtueFlawContent content, Bounds textBounds)
     throws DocumentException {
   Phrase phrase = new Phrase();
   phrase.add(new Chunk(content.getVirtueFlawName(), createNameFont(graphics)));
   float baseLine =
       graphics
           .createSimpleColumn(textBounds)
           .withLeading(REDUCED_LINE_HEIGHT)
           .andTextPart(phrase)
           .encode()
           .getYLine();
   encodeLines(graphics, bounds, REDUCED_LINE_HEIGHT, baseLine);
 }
示例#4
0
 private void encodeOnlyConditionDefined(
     SheetGraphics graphics, VirtueFlawContent content, Bounds textBounds)
     throws DocumentException {
   Phrase phrase = new Phrase();
   Font undefinedFont = new Font(createNameFont(graphics));
   undefinedFont.setStyle(Font.UNDERLINE);
   phrase.add(
       new Chunk("                                          : ", undefinedFont)); // $NON-NLS-1$
   phrase.add(new Chunk(": ", createNameFont(graphics))); // $NON-NLS-1$
   phrase.add(new Chunk(content.getLimitBreakCondition(), createConditionFont(graphics)));
   graphics
       .createSimpleColumn(textBounds)
       .withLeading(REDUCED_LINE_HEIGHT)
       .andTextPart(phrase)
       .encode();
 }