public CalculatedStyle getCalculatedStyle() { if (_calculatedStyle == null) { _calculatedStyle = new EmptyStyle().deriveStyle( CascadedStyle.createLayoutStyle(_ruleset.getPropertyDeclarations())); } return _calculatedStyle; } }
public CalculatedStyle getStyle(Element e, boolean restyle) { if (styleMap == null) { styleMap = new HashMap(1024, 0.75f); } CalculatedStyle result = null; if (! restyle) { result = (CalculatedStyle)styleMap.get(e); } if (result == null) { Node parent = e.getParentNode(); CalculatedStyle parentCalculatedStyle; if (parent instanceof Document) { parentCalculatedStyle = new EmptyStyle(); } else { parentCalculatedStyle = getStyle((Element)parent, false); } result = parentCalculatedStyle.deriveStyle(getCss().getCascadedStyle(e, restyle)); styleMap.put(e, result); } return result; }
public CalculatedStyle getStyle(Element e, boolean restyle) { if (styleMap == null) { styleMap = new HashMap(1024, 0.75f); } CalculatedStyle result = null; if (! restyle) { result = (CalculatedStyle)styleMap.get(e); } if (result == null) { Node parent = e.getParentNode(); CalculatedStyle parentCalculatedStyle; if (parent instanceof Document) { parentCalculatedStyle = new EmptyStyle(); } else { parentCalculatedStyle = getStyle((Element)parent, false); } result = parentCalculatedStyle.deriveStyle(getCss().getCascadedStyle(e, restyle)); styleMap.put(e, result); } return result; }
public CalculatedStyle getCalculatedStyle() { if (_calculatedStyle == null) { _calculatedStyle = new EmptyStyle().deriveStyle( CascadedStyle.createLayoutStyle(_ruleset.getPropertyDeclarations())); } return _calculatedStyle; }
PageBox result = new PageBox(); String pageName = null; // HACK We only create pages during layout, but the OutputDevice // queries page positions and since pages are created lazily, changing // this method to use LayoutContext is tricky if (c instanceof LayoutContext) { pageName = ((LayoutContext)c).getPageName(); } PageInfo pageInfo = c.getCss().getPageStyle(pageName, pseudoPage); result.setPageInfo(pageInfo); CalculatedStyle cs = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); result.setStyle(cs); result.setOuterPageWidth(result.getWidth(c)); return result; } public PageBox getFirstPage(CssContext c, Box box) {
public static PageBox createPageBox(CssContext c, String pseudoPage) { PageBox result = new PageBox(); String pageName = null; // HACK We only create pages during layout, but the OutputDevice // queries page positions and since pages are created lazily, changing // this method to use LayoutContext is tricky if (c instanceof LayoutContext) { pageName = ((LayoutContext)c).getPageName(); } PageInfo pageInfo = c.getCss().getPageStyle(pageName, pseudoPage); result.setPageInfo(pageInfo); CalculatedStyle cs = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); result.setStyle(cs); result.setOuterPageWidth(result.getWidth(c)); return result; }
CalculatedStyle style = new EmptyStyle().deriveStyle(cascadedStyle);
CalculatedStyle style = new EmptyStyle().deriveStyle(cascadedStyle);
CalculatedStyle pageStyle = new EmptyStyle().deriveStyle(pageInfo.getPageStyle());
CalculatedStyle pageStyle = new EmptyStyle().deriveStyle(pageInfo.getPageStyle());