コード例 #1
0
 private StyleCollector newStyleCollector(LayoutState ls) {
   return new StyleCollector(
       context,
       ls.getFontCache(),
       defaults,
       ls.getExternalExtent(),
       ls.getReferenceExtent(),
       ls.getCellResolution(),
       ls.getWritingMode(),
       ls.getLanguage(),
       ls.getFont(),
       ls.getStyles());
 }
コード例 #2
0
 protected void layoutRegion(Element e, LayoutState ls) {
   Extent extent = ls.getExtent(e);
   double w = extent.getWidth();
   double h = extent.getHeight();
   Point origin = ls.getPosition(e, extent);
   double x = origin.getX();
   double y = origin.getY();
   boolean clip = ls.getOverflow(e).clips();
   ls.pushViewport(e, w, h, clip);
   WritingMode wm = ls.getWritingMode(e);
   TransformMatrix ctm = ls.getTransform(e);
   ls.pushReference(e, x, y, w, h, wm, ctm);
   for (Element c : getChildElements(e)) {
     if (isElement(c, ttBodyElementName)) layoutBody(c, ls);
   }
   AreaNode r = ls.peek();
   if (r instanceof ReferenceArea) alignBlockAreas((ReferenceArea) r, ls.getReferenceAlignment());
   ls.pop();
   ls.pop();
 }