public boolean canHandle(LayoutContext c, FSFunction function) { return c.isPrint() && isCounter(function, "page"); } }
private Rectangle getInitialExtents(LayoutContext c) { if (! c.isPrint()) { Rectangle extents = getScreenExtents(); // HACK avoid bogus warning if (extents.width == 0 && extents.height == 0) { extents = new Rectangle(0, 0, 1, 1); } return extents; } else { PageBox first = Layer.createPageBox(c, "first"); return new Rectangle(0, 0, first.getContentWidth(c), first.getContentHeight(c)); } }
public void finish(LayoutContext c) { if (c.isPrint()) { layoutAbsoluteChildren(c); } if (! isInline()) { positionChildren(c); } }
if (c.isPrint()) { layoutAbsoluteChildren(c); } if (! isInline()) { positionChildren(c); } } private void layoutAbsoluteChildren(LayoutContext c) {
public void restoreStateForRelayout(LayoutState layoutState) { _firstLines = layoutState.getFirstLines(); _firstLetters = layoutState.getFirstLetters(); _currentMarkerData = layoutState.getCurrentMarkerData(); if (isPrint()) { setPageName(layoutState.getPageName()); } }
public void restoreStateForRelayout(LayoutState layoutState) { _firstLines = layoutState.getFirstLines(); _firstLetters = layoutState.getFirstLetters(); _currentMarkerData = layoutState.getCurrentMarkerData(); if (isPrint()) { setPageName(layoutState.getPageName()); } }
protected void layoutInlineChildren( LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) { InlineBoxing.layoutContent(c, this, contentStart, breakAtLine); if (c.isPrint() && c.isPageBreaksAllowed() && getChildCount() > 1) { satisfyWidowsAndOrphans(c, contentStart, tryAgain); } if (tryAgain && getStyle().isTextJustify()) { justifyText(); } }
protected void layoutInlineChildren( LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) { InlineBoxing.layoutContent(c, this, contentStart, breakAtLine); if (c.isPrint() && c.isPageBreaksAllowed() && getChildCount() > 1) { satisfyWidowsAndOrphans(c, contentStart, tryAgain); } if (tryAgain && getStyle().isTextJustify()) { justifyText(); } }
public LayoutState copyStateForRelayout() { LayoutState result = new LayoutState(); result.setFirstLetters(_firstLetters.copyOf()); result.setFirstLines(_firstLines.copyOf()); result.setCurrentMarkerData(_currentMarkerData); if (isPrint()) { result.setPageName(getPageName()); } return result; }
public LayoutState copyStateForRelayout() { LayoutState result = new LayoutState(); result.setFirstLetters(_firstLetters.copyOf()); result.setFirstLines(_firstLines.copyOf()); result.setCurrentMarkerData(_currentMarkerData); if (isPrint()) { result.setPageName(getPageName()); } return result; }
public void positionAbsoluteOnPage(LayoutContext c) { if (c.isPrint() && (getStyle().isForcePageBreakBefore() || isNeedPageClear())) { forcePageBreakBefore(c, getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); calcCanvasLocation(); calcChildLocations(); setNeedPageClear(false); } }
public void positionAbsoluteOnPage(LayoutContext c) { if (c.isPrint() && (getStyle().isForcePageBreakBefore() || isNeedPageClear())) { forcePageBreakBefore(c, getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); calcCanvasLocation(); calcChildLocations(); setNeedPageClear(false); } }
public boolean isNeedsKeepWithInline(LayoutContext c) { if (c.isPrint() && getStyle().isKeepWithInline()) { LineBox line = findFirstLineBox(); if (line != null) { PageBox linePage = c.getRootLayer().getFirstPage(c, line); PageBox ourPage = c.getRootLayer().getFirstPage(c, this); return linePage != null && ourPage != null && linePage.getPageNo() == ourPage.getPageNo()+1; } } return false; }
public boolean isNeedsKeepWithInline(LayoutContext c) { if (c.isPrint() && getStyle().isKeepWithInline()) { LineBox line = findFirstLineBox(); if (line != null) { PageBox linePage = c.getRootLayer().getFirstPage(c, line); PageBox ourPage = c.getRootLayer().getFirstPage(c, this); return linePage != null && ourPage != null && linePage.getPageNo() == ourPage.getPageNo()+1; } } return false; }
public void layout(LayoutContext c, int contentStart) { boolean running = c.isPrint() && (isHeader() || isFooter()) && getTable().getStyle().isPaginateTable(); if (running) { c.setNoPageBreak(c.getNoPageBreak()+1); } super.layout(c, contentStart); if (running) { c.setNoPageBreak(c.getNoPageBreak()-1); } }
public void layout(LayoutContext c, int contentStart) { boolean running = c.isPrint() && (isHeader() || isFooter()) && getTable().getStyle().isPaginateTable(); if (running) { c.setNoPageBreak(c.getNoPageBreak()+1); } super.layout(c, contentStart); if (running) { c.setNoPageBreak(c.getNoPageBreak()-1); } }
public void restoreLayoutState(LayoutState layoutState) { _firstLines = layoutState.getFirstLines(); _firstLetters = layoutState.getFirstLetters(); _currentMarkerData = layoutState.getCurrentMarkerData(); _bfcs = layoutState.getBFCs(); if (isPrint()) { setPageName(layoutState.getPageName()); setExtraSpaceBottom(layoutState.getExtraSpaceBottom()); setExtraSpaceTop(layoutState.getExtraSpaceTop()); setNoPageBreak(layoutState.getNoPageBreak()); } }
public void restoreLayoutState(LayoutState layoutState) { _firstLines = layoutState.getFirstLines(); _firstLetters = layoutState.getFirstLetters(); _currentMarkerData = layoutState.getCurrentMarkerData(); _bfcs = layoutState.getBFCs(); if (isPrint()) { setPageName(layoutState.getPageName()); setExtraSpaceBottom(layoutState.getExtraSpaceBottom()); setExtraSpaceTop(layoutState.getExtraSpaceTop()); setNoPageBreak(layoutState.getNoPageBreak()); } }
private void position(LayoutContext c) { if (getMaster().getStyle().isAbsolute() && ! c.isPrint()) { ((BlockBox)getMaster()).positionAbsolute(c, BlockBox.POSITION_BOTH); } else if (getMaster().getStyle().isRelative() && (isInline() || ((BlockBox)getMaster()).isInline())) { getMaster().positionRelative(c); if (! isInline()) { getMaster().calcCanvasLocation(); getMaster().calcChildLocations(); } } }
if (getMaster().getStyle().isAbsolute() && ! c.isPrint()) { ((BlockBox)getMaster()).positionAbsolute(c, BlockBox.POSITION_BOTH); } else if (getMaster().getStyle().isRelative() && (isInline() || ((BlockBox)getMaster()).isInline())) { getMaster().positionRelative(c); if (! isInline()) { getMaster().calcCanvasLocation(); getMaster().calcChildLocations(); } } } private boolean containsFixedLayer() {