Example #1
0
 private void handleLine(
     Settings elementSettings, String line, PropertiesConfig propCfg, BaseDrawHandler drawer) {
   boolean drawText = true;
   for (Facet facet : elementSettings.getFacets()) {
     if (facet.checkStart(line)) {
       facet.handleLine(line, drawer, propCfg);
       if (facet.replacesText(line)) {
         drawText = false;
       }
     }
   }
   if (drawText) {
     XPoints xLimitsForText = propCfg.getXLimitsForArea(propCfg.getyPos(), drawer.textHeight());
     Float spaceNotUsedForText = propCfg.getGridElementSize().width - xLimitsForText.getSpace();
     if (!spaceNotUsedForText.equals(
         Float.NaN)) { // NaN is possible if xlimits calculation contains e.g. a division by zero
       propCfg.calcMaxTextWidth(spaceNotUsedForText + drawer.textWidth(line));
     }
     drawer.print(
         line,
         calcHorizontalTextBoundaries(xLimitsForText, propCfg),
         propCfg.getyPos(),
         propCfg.gethAlign());
     propCfg.addToYPos(drawer.textHeightWithSpace());
   }
 }